diff --git a/.gitignore b/.gitignore index 39c31e3e..4e81838d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ .prism.log .gradle .idea +.kotlin build codegen.log kls_database.db diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 563004f2..5ba086cf 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.46.0" + ".": "0.46.1" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d536f76..4ed86daa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## 0.46.1 (2025-03-07) + +Full Changelog: [v0.46.0...v0.46.1](https://github.com/orbcorp/orb-java/compare/v0.46.0...v0.46.1) + +### Chores + +* **internal:** add `.kotlin` to `.gitignore` ([#323](https://github.com/orbcorp/orb-java/issues/323)) ([8c1f105](https://github.com/orbcorp/orb-java/commit/8c1f105f073072041491eeffed999a31957c4c5e)) +* **internal:** codegen related update ([#321](https://github.com/orbcorp/orb-java/issues/321)) ([a45ffe2](https://github.com/orbcorp/orb-java/commit/a45ffe29a6f89939a7c624efac74e5ce890ca7d9)) +* **internal:** don't generate docs ([#325](https://github.com/orbcorp/orb-java/issues/325)) ([dccfa35](https://github.com/orbcorp/orb-java/commit/dccfa351f867c99eddac02c5603ac59cf892a7ef)) +* **internal:** use `getOrNull` instead of `orElse(null)` ([#324](https://github.com/orbcorp/orb-java/issues/324)) ([02fd429](https://github.com/orbcorp/orb-java/commit/02fd429784de8fe4a0ae0d4eee9fbe1544080c92)) + ## 0.46.0 (2025-03-07) Full Changelog: [v0.45.0...v0.46.0](https://github.com/orbcorp/orb-java/compare/v0.45.0...v0.46.0) diff --git a/README.md b/README.md index 77d4d1f5..928d92f0 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,7 @@ -[![Maven Central](https://img.shields.io/maven-central/v/com.withorb.api/orb-java)](https://central.sonatype.com/artifact/com.withorb.api/orb-java/0.46.0) -[![javadoc](https://javadoc.io/badge2/com.withorb.api/orb-java/0.46.0/javadoc.svg)](https://javadoc.io/doc/com.withorb.api/orb-java/0.46.0) +[![Maven Central](https://img.shields.io/maven-central/v/com.withorb.api/orb-java)](https://central.sonatype.com/artifact/com.withorb.api/orb-java/0.46.1) @@ -11,7 +10,7 @@ The Orb Java SDK provides convenient access to the Orb REST API from application The Orb Java SDK is similar to the Orb Kotlin SDK but with minor differences that make it more ergonomic for use in Java, such as `Optional` instead of nullable values, `Stream` instead of `Sequence`, and `CompletableFuture` instead of suspend functions. -The REST API documentation can be found on [docs.withorb.com](https://docs.withorb.com/reference/api-reference). Javadocs are also available on [javadoc.io](https://javadoc.io/doc/com.withorb.api/orb-java/0.45.0). +The REST API documentation can be found on [docs.withorb.com](https://docs.withorb.com/reference/api-reference). ## Installation @@ -20,7 +19,7 @@ The REST API documentation can be found on [docs.withorb.com](https://docs.witho ### Gradle ```kotlin -implementation("com.withorb.api:orb-java:0.46.0") +implementation("com.withorb.api:orb-java:0.46.1") ``` ### Maven @@ -29,7 +28,7 @@ implementation("com.withorb.api:orb-java:0.46.0") com.withorb.api orb-java - 0.46.0 + 0.46.1 ``` diff --git a/build.gradle.kts b/build.gradle.kts index 61ab6577..45f8d5a0 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,23 +1,4 @@ -plugins { - id("org.jetbrains.dokka") version "2.0.0" -} - -repositories { - mavenCentral() -} - allprojects { group = "com.withorb.api" - version = "0.46.0" // x-release-please-version -} - -subprojects { - apply(plugin = "org.jetbrains.dokka") -} - -// Avoid race conditions between `dokkaJavadocCollector` and `dokkaJavadocJar` tasks -tasks.named("dokkaJavadocCollector").configure { - subprojects.flatMap { it.tasks } - .filter { it.project.name != "orb-java" && it.name == "dokkaJavadocJar" } - .forEach { mustRunAfter(it) } + version = "0.46.1" // x-release-please-version } diff --git a/buildSrc/src/main/kotlin/orb.publish.gradle.kts b/buildSrc/src/main/kotlin/orb.publish.gradle.kts index 2f9d4b55..134e81fe 100644 --- a/buildSrc/src/main/kotlin/orb.publish.gradle.kts +++ b/buildSrc/src/main/kotlin/orb.publish.gradle.kts @@ -1,5 +1,3 @@ -import com.vanniktech.maven.publish.JavadocJar -import com.vanniktech.maven.publish.KotlinJvm import com.vanniktech.maven.publish.MavenPublishBaseExtension import com.vanniktech.maven.publish.SonatypeHost @@ -21,12 +19,6 @@ configure { publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL) coordinates(project.group.toString(), project.name, project.version.toString()) - configure( - KotlinJvm( - javadocJar = JavadocJar.Dokka("dokkaJavadoc"), - sourcesJar = true, - ) - ) pom { name.set("API Reference") 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 ba060e8a..1677b6fa 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 @@ -13,6 +13,7 @@ import java.net.Proxy import java.time.Clock import java.time.Duration import java.util.Optional +import kotlin.jvm.optionals.getOrNull class OrbOkHttpClient private constructor() { @@ -150,7 +151,7 @@ class OrbOkHttpClient private constructor() { } fun webhookSecret(webhookSecret: Optional) = - webhookSecret(webhookSecret.orElse(null)) + webhookSecret(webhookSecret.getOrNull()) fun fromEnv() = apply { clientOptions.fromEnv() } 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 b8ec3451..68cb22b4 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 @@ -13,6 +13,7 @@ import java.net.Proxy import java.time.Clock import java.time.Duration import java.util.Optional +import kotlin.jvm.optionals.getOrNull class OrbOkHttpClientAsync private constructor() { @@ -150,7 +151,7 @@ class OrbOkHttpClientAsync private constructor() { } fun webhookSecret(webhookSecret: Optional) = - webhookSecret(webhookSecret.orElse(null)) + webhookSecret(webhookSecret.getOrNull()) fun fromEnv() = apply { clientOptions.fromEnv() } 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 2c3ce89b..03889ebc 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 @@ -10,6 +10,7 @@ import com.withorb.api.core.http.QueryParams import com.withorb.api.core.http.RetryingHttpClient import java.time.Clock import java.util.Optional +import kotlin.jvm.optionals.getOrNull class ClientOptions private constructor( @@ -100,7 +101,7 @@ private constructor( fun webhookSecret(webhookSecret: String?) = apply { this.webhookSecret = webhookSecret } fun webhookSecret(webhookSecret: Optional) = - webhookSecret(webhookSecret.orElse(null)) + webhookSecret(webhookSecret.getOrNull()) fun headers(headers: Headers) = apply { this.headers.clear() 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 65438bf4..b1336402 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 @@ -5,6 +5,7 @@ package com.withorb.api.core import java.time.Duration import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull /** A class containing timeouts for various processing phases of a request. */ class Timeout @@ -96,7 +97,7 @@ private constructor( * * Defaults to `Duration.ofMinutes(1)`. */ - fun connect(connect: Optional) = connect(connect.orElse(null)) + fun connect(connect: Optional) = connect(connect.getOrNull()) /** * The maximum time allowed between two data packets when waiting for the server’s response. @@ -114,7 +115,7 @@ private constructor( * * Defaults to `request()`. */ - fun read(read: Optional) = read(read.orElse(null)) + fun read(read: Optional) = read(read.getOrNull()) /** * The maximum time allowed between two data packets when sending the request to the server. @@ -132,7 +133,7 @@ private constructor( * * Defaults to `request()`. */ - fun write(write: Optional) = write(write.orElse(null)) + fun write(write: Optional) = write(write.getOrNull()) /** * The maximum time allowed for a complete HTTP call, not including retries. @@ -156,7 +157,7 @@ private constructor( * * Defaults to `Duration.ofMinutes(1)`. */ - fun request(request: Optional) = request(request.orElse(null)) + fun request(request: Optional) = request(request.getOrNull()) fun build(): Timeout = Timeout(connect, read, write, request) } 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 9390ddc8..77cfdfbf 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 @@ -20,6 +20,7 @@ import com.withorb.api.errors.OrbInvalidDataException import java.time.OffsetDateTime import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull /** * [Alerts within Orb](/product-catalog/configuring-alerts) monitor spending, usage, or credit @@ -220,7 +221,7 @@ private constructor( fun currency(currency: String?) = currency(JsonField.ofNullable(currency)) /** The name of the currency the credit balance or invoice cost is denominated in. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** The name of the currency the credit balance or invoice cost is denominated in. */ fun currency(currency: JsonField) = apply { this.currency = currency } @@ -229,7 +230,7 @@ private constructor( fun customer(customer: Customer?) = customer(JsonField.ofNullable(customer)) /** The customer the alert applies to. */ - fun customer(customer: Optional) = customer(customer.orElse(null)) + fun customer(customer: Optional) = customer(customer.getOrNull()) /** The customer the alert applies to. */ fun customer(customer: JsonField) = apply { this.customer = customer } @@ -244,7 +245,7 @@ private constructor( fun metric(metric: Metric?) = metric(JsonField.ofNullable(metric)) /** The metric the alert applies to. */ - fun metric(metric: Optional) = metric(metric.orElse(null)) + fun metric(metric: Optional) = metric(metric.getOrNull()) /** The metric the alert applies to. */ fun metric(metric: JsonField) = apply { this.metric = metric } @@ -253,7 +254,7 @@ private constructor( fun plan(plan: Plan?) = plan(JsonField.ofNullable(plan)) /** The plan the alert applies to. */ - fun plan(plan: Optional) = plan(plan.orElse(null)) + fun plan(plan: Optional) = plan(plan.getOrNull()) /** The plan the alert applies to. */ fun plan(plan: JsonField) = apply { this.plan = plan } @@ -264,7 +265,7 @@ private constructor( /** The subscription the alert applies to. */ fun subscription(subscription: Optional) = - subscription(subscription.orElse(null)) + subscription(subscription.getOrNull()) /** The subscription the alert applies to. */ fun subscription(subscription: JsonField) = apply { @@ -275,7 +276,7 @@ private constructor( fun thresholds(thresholds: List?) = thresholds(JsonField.ofNullable(thresholds)) /** The thresholds that define the conditions under which the alert will be triggered. */ - fun thresholds(thresholds: Optional>) = thresholds(thresholds.orElse(null)) + fun thresholds(thresholds: Optional>) = thresholds(thresholds.getOrNull()) /** The thresholds that define the conditions under which the alert will be triggered. */ fun thresholds(thresholds: JsonField>) = apply { @@ -409,7 +410,7 @@ private constructor( externalCustomerId(JsonField.ofNullable(externalCustomerId)) fun externalCustomerId(externalCustomerId: Optional) = - externalCustomerId(externalCustomerId.orElse(null)) + externalCustomerId(externalCustomerId.getOrNull()) fun externalCustomerId(externalCustomerId: JsonField) = apply { this.externalCustomerId = externalCustomerId @@ -666,7 +667,7 @@ private constructor( fun id(id: String?) = id(JsonField.ofNullable(id)) - fun id(id: Optional) = id(id.orElse(null)) + fun id(id: Optional) = id(id.getOrNull()) fun id(id: JsonField) = apply { this.id = id } @@ -684,7 +685,7 @@ private constructor( * your system. */ fun externalPlanId(externalPlanId: Optional) = - externalPlanId(externalPlanId.orElse(null)) + externalPlanId(externalPlanId.getOrNull()) /** * An optional user-defined ID for this plan resource, used throughout the system as an @@ -697,7 +698,7 @@ private constructor( fun name(name: String?) = name(JsonField.ofNullable(name)) - fun name(name: Optional) = name(name.orElse(null)) + fun name(name: Optional) = name(name.getOrNull()) fun name(name: JsonField) = apply { this.name = name } 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 7889c0bf..ff46bd2c 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 @@ -22,6 +22,7 @@ import com.withorb.api.core.toImmutable import com.withorb.api.errors.OrbInvalidDataException import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull /** * This endpoint creates a new alert to monitor a customer's credit balance. There are three types @@ -181,7 +182,7 @@ private constructor( /** The thresholds that define the values at which the alert will be triggered. */ fun thresholds(thresholds: Optional>) = - thresholds(thresholds.orElse(null)) + thresholds(thresholds.getOrNull()) /** The thresholds that define the values at which the alert will be triggered. */ fun thresholds(thresholds: JsonField>) = apply { @@ -294,7 +295,7 @@ private constructor( fun thresholds(thresholds: List?) = apply { body.thresholds(thresholds) } /** The thresholds that define the values at which the alert will be triggered. */ - fun thresholds(thresholds: Optional>) = thresholds(thresholds.orElse(null)) + fun thresholds(thresholds: Optional>) = thresholds(thresholds.getOrNull()) /** The thresholds that define the values at which the alert will be triggered. */ fun thresholds(thresholds: JsonField>) = apply { 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 365b7cdf..b95bcf61 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 @@ -22,6 +22,7 @@ import com.withorb.api.core.toImmutable import com.withorb.api.errors.OrbInvalidDataException import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull /** * This endpoint creates a new alert to monitor a customer's credit balance. There are three types @@ -181,7 +182,7 @@ private constructor( /** The thresholds that define the values at which the alert will be triggered. */ fun thresholds(thresholds: Optional>) = - thresholds(thresholds.orElse(null)) + thresholds(thresholds.getOrNull()) /** The thresholds that define the values at which the alert will be triggered. */ fun thresholds(thresholds: JsonField>) = apply { @@ -300,7 +301,7 @@ private constructor( fun thresholds(thresholds: List?) = apply { body.thresholds(thresholds) } /** The thresholds that define the values at which the alert will be triggered. */ - fun thresholds(thresholds: Optional>) = thresholds(thresholds.orElse(null)) + fun thresholds(thresholds: Optional>) = thresholds(thresholds.getOrNull()) /** The thresholds that define the values at which the alert will be triggered. */ fun thresholds(thresholds: JsonField>) = apply { 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 48e4caf2..03477d54 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 @@ -22,6 +22,7 @@ import com.withorb.api.core.toImmutable import com.withorb.api.errors.OrbInvalidDataException import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull /** * This endpoint is used to create alerts at the subscription level. @@ -192,7 +193,7 @@ private constructor( fun metricId(metricId: String?) = metricId(JsonField.ofNullable(metricId)) /** The metric to track usage for. */ - fun metricId(metricId: Optional) = metricId(metricId.orElse(null)) + fun metricId(metricId: Optional) = metricId(metricId.getOrNull()) /** The metric to track usage for. */ fun metricId(metricId: JsonField) = apply { this.metricId = metricId } @@ -303,7 +304,7 @@ private constructor( fun metricId(metricId: String?) = apply { body.metricId(metricId) } /** The metric to track usage for. */ - fun metricId(metricId: Optional) = metricId(metricId.orElse(null)) + fun metricId(metricId: Optional) = metricId(metricId.getOrNull()) /** The metric to track usage for. */ fun metricId(metricId: JsonField) = apply { body.metricId(metricId) } 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 548ba857..a437d108 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 @@ -11,6 +11,7 @@ import com.withorb.api.core.http.QueryParams import com.withorb.api.core.toImmutable import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull /** * This endpoint allows you to disable an alert. To disable a plan-level alert for a specific @@ -100,7 +101,7 @@ private constructor( /** Used to update the status of a plan alert scoped to this subscription_id */ fun subscriptionId(subscriptionId: Optional) = - subscriptionId(subscriptionId.orElse(null)) + subscriptionId(subscriptionId.getOrNull()) fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() 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 c73bf567..de3a2b6d 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 @@ -11,6 +11,7 @@ import com.withorb.api.core.http.QueryParams import com.withorb.api.core.toImmutable import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull /** * This endpoint allows you to enable an alert. To enable a plan-level alert for a specific @@ -100,7 +101,7 @@ private constructor( /** Used to update the status of a plan alert scoped to this subscription_id */ fun subscriptionId(subscriptionId: Optional) = - subscriptionId(subscriptionId.orElse(null)) + subscriptionId(subscriptionId.getOrNull()) fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() 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 a186921b..3c0aa1e2 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 @@ -18,6 +18,7 @@ import java.util.Objects import java.util.Optional import java.util.stream.Stream import java.util.stream.StreamSupport +import kotlin.jvm.optionals.getOrNull /** * This endpoint returns a list of alerts within Orb. @@ -191,7 +192,7 @@ private constructor( while (index < page.data().size) { yield(page.data()[index++]) } - page = page.getNextPage().orElse(null) ?: break + page = page.getNextPage().getOrNull() ?: break index = 0 } } 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 cbde92a0..3630decd 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 @@ -10,6 +10,7 @@ import java.time.OffsetDateTime import java.time.format.DateTimeFormatter import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull /** * This endpoint returns a list of alerts within Orb. @@ -150,22 +151,22 @@ private constructor( fun createdAtGt(createdAtGt: OffsetDateTime?) = apply { this.createdAtGt = createdAtGt } fun createdAtGt(createdAtGt: Optional) = - createdAtGt(createdAtGt.orElse(null)) + createdAtGt(createdAtGt.getOrNull()) fun createdAtGte(createdAtGte: OffsetDateTime?) = apply { this.createdAtGte = createdAtGte } fun createdAtGte(createdAtGte: Optional) = - createdAtGte(createdAtGte.orElse(null)) + createdAtGte(createdAtGte.getOrNull()) fun createdAtLt(createdAtLt: OffsetDateTime?) = apply { this.createdAtLt = createdAtLt } fun createdAtLt(createdAtLt: Optional) = - createdAtLt(createdAtLt.orElse(null)) + createdAtLt(createdAtLt.getOrNull()) fun createdAtLte(createdAtLte: OffsetDateTime?) = apply { this.createdAtLte = createdAtLte } fun createdAtLte(createdAtLte: Optional) = - createdAtLte(createdAtLte.orElse(null)) + createdAtLte(createdAtLte.getOrNull()) /** * Cursor for pagination. This can be populated by the `next_cursor` value returned from the @@ -177,13 +178,13 @@ private constructor( * Cursor for pagination. This can be populated by the `next_cursor` value returned from the * initial request. */ - fun cursor(cursor: Optional) = cursor(cursor.orElse(null)) + fun cursor(cursor: Optional) = cursor(cursor.getOrNull()) /** Fetch alerts scoped to this customer_id */ fun customerId(customerId: String?) = apply { this.customerId = customerId } /** Fetch alerts scoped to this customer_id */ - fun customerId(customerId: Optional) = customerId(customerId.orElse(null)) + fun customerId(customerId: Optional) = customerId(customerId.getOrNull()) /** Fetch alerts scoped to this external_customer_id */ fun externalCustomerId(externalCustomerId: String?) = apply { @@ -192,7 +193,7 @@ private constructor( /** Fetch alerts scoped to this external_customer_id */ fun externalCustomerId(externalCustomerId: Optional) = - externalCustomerId(externalCustomerId.orElse(null)) + externalCustomerId(externalCustomerId.getOrNull()) /** The number of items to fetch. Defaults to 20. */ fun limit(limit: Long?) = apply { this.limit = limit } @@ -201,15 +202,14 @@ private constructor( fun limit(limit: Long) = limit(limit as Long?) /** The number of items to fetch. Defaults to 20. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun limit(limit: Optional) = limit(limit.orElse(null) as Long?) + fun limit(limit: Optional) = limit(limit.getOrNull()) /** Fetch alerts scoped to this subscription_id */ fun subscriptionId(subscriptionId: String?) = apply { this.subscriptionId = subscriptionId } /** Fetch alerts scoped to this subscription_id */ fun subscriptionId(subscriptionId: Optional) = - subscriptionId(subscriptionId.orElse(null)) + subscriptionId(subscriptionId.getOrNull()) fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() 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 6e629c90..e5fbce69 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 @@ -19,6 +19,7 @@ import com.withorb.api.core.toImmutable import com.withorb.api.errors.OrbInvalidDataException import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull @NoAutoDetect class AmountDiscount @@ -166,7 +167,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) fun reason(reason: JsonField) = apply { this.reason = reason } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/BillableMetric.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/BillableMetric.kt index 39c9ffa4..77e26087 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/BillableMetric.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/BillableMetric.kt @@ -18,6 +18,7 @@ import com.withorb.api.core.toImmutable import com.withorb.api.errors.OrbInvalidDataException import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull /** * The Metric resource represents a calculation of a quantity based on events. Metrics are defined @@ -155,7 +156,7 @@ private constructor( fun description(description: String?) = description(JsonField.ofNullable(description)) - fun description(description: Optional) = description(description.orElse(null)) + fun description(description: Optional) = description(description.getOrNull()) fun description(description: JsonField) = apply { this.description = description } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/Coupon.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/Coupon.kt index 51a886f4..51517bb2 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/Coupon.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/Coupon.kt @@ -215,7 +215,7 @@ private constructor( * An archived coupon can no longer be redeemed. Active coupons will have a value of null * for `archived_at`; this field will be non-null for archived coupons. */ - fun archivedAt(archivedAt: Optional) = archivedAt(archivedAt.orElse(null)) + fun archivedAt(archivedAt: Optional) = archivedAt(archivedAt.getOrNull()) /** * An archived coupon can no longer be redeemed. Active coupons will have a value of null @@ -250,9 +250,8 @@ private constructor( * This allows for a coupon's discount to apply for a limited time (determined in months); a * `null` value here means "unlimited time". */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun durationInMonths(durationInMonths: Optional) = - durationInMonths(durationInMonths.orElse(null) as Long?) + durationInMonths(durationInMonths.getOrNull()) /** * This allows for a coupon's discount to apply for a limited time (determined in months); a @@ -279,9 +278,8 @@ private constructor( * The maximum number of redemptions allowed for this coupon before it is exhausted; `null` * here means "unlimited". */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun maxRedemptions(maxRedemptions: Optional) = - maxRedemptions(maxRedemptions.orElse(null) as Long?) + maxRedemptions(maxRedemptions.getOrNull()) /** * The maximum number of redemptions allowed for this coupon before it is exhausted; `null` diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CouponCreateParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CouponCreateParams.kt index 37229820..29b370c5 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CouponCreateParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CouponCreateParams.kt @@ -262,9 +262,8 @@ private constructor( * This allows for a coupon's discount to apply for a limited time (determined in * months); a `null` value here means "unlimited time". */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun durationInMonths(durationInMonths: Optional) = - durationInMonths(durationInMonths.orElse(null) as Long?) + durationInMonths(durationInMonths.getOrNull()) /** * This allows for a coupon's discount to apply for a limited time (determined in @@ -291,9 +290,8 @@ private constructor( * The maximum number of redemptions allowed for this coupon before it is * exhausted;`null` here means "unlimited". */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun maxRedemptions(maxRedemptions: Optional) = - maxRedemptions(maxRedemptions.orElse(null) as Long?) + maxRedemptions(maxRedemptions.getOrNull()) /** * The maximum number of redemptions allowed for this coupon before it is @@ -427,9 +425,8 @@ private constructor( * This allows for a coupon's discount to apply for a limited time (determined in months); a * `null` value here means "unlimited time". */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun durationInMonths(durationInMonths: Optional) = - durationInMonths(durationInMonths.orElse(null) as Long?) + durationInMonths(durationInMonths.getOrNull()) /** * This allows for a coupon's discount to apply for a limited time (determined in months); a @@ -455,9 +452,8 @@ private constructor( * The maximum number of redemptions allowed for this coupon before it is exhausted;`null` * here means "unlimited". */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun maxRedemptions(maxRedemptions: Optional) = - maxRedemptions(maxRedemptions.orElse(null) as Long?) + maxRedemptions(maxRedemptions.getOrNull()) /** * The maximum number of redemptions allowed for this coupon before it is exhausted;`null` diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CouponListPage.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CouponListPage.kt index eefa9d40..9b1c9f7d 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CouponListPage.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CouponListPage.kt @@ -18,6 +18,7 @@ import java.util.Objects import java.util.Optional import java.util.stream.Stream import java.util.stream.StreamSupport +import kotlin.jvm.optionals.getOrNull /** * This endpoint returns a list of all coupons for an account in a list format. @@ -187,7 +188,7 @@ private constructor( while (index < page.data().size) { yield(page.data()[index++]) } - page = page.getNextPage().orElse(null) ?: break + page = page.getNextPage().getOrNull() ?: break index = 0 } } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CouponListParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CouponListParams.kt index 77b3bfd8..9a5e7ecb 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CouponListParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CouponListParams.kt @@ -8,6 +8,7 @@ import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull /** * This endpoint returns a list of all coupons for an account in a list format. @@ -98,7 +99,7 @@ private constructor( * Cursor for pagination. This can be populated by the `next_cursor` value returned from the * initial request. */ - fun cursor(cursor: Optional) = cursor(cursor.orElse(null)) + fun cursor(cursor: Optional) = cursor(cursor.getOrNull()) /** The number of items to fetch. Defaults to 20. */ fun limit(limit: Long?) = apply { this.limit = limit } @@ -107,15 +108,14 @@ private constructor( fun limit(limit: Long) = limit(limit as Long?) /** The number of items to fetch. Defaults to 20. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun limit(limit: Optional) = limit(limit.orElse(null) as Long?) + fun limit(limit: Optional) = limit(limit.getOrNull()) /** Filter to coupons matching this redemption code. */ fun redemptionCode(redemptionCode: String?) = apply { this.redemptionCode = redemptionCode } /** Filter to coupons matching this redemption code. */ fun redemptionCode(redemptionCode: Optional) = - redemptionCode(redemptionCode.orElse(null)) + redemptionCode(redemptionCode.getOrNull()) /** * Show archived coupons as well (by default, this endpoint only returns active coupons). @@ -130,9 +130,7 @@ private constructor( /** * Show archived coupons as well (by default, this endpoint only returns active coupons). */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun showArchived(showArchived: Optional) = - showArchived(showArchived.orElse(null) as Boolean?) + fun showArchived(showArchived: Optional) = showArchived(showArchived.getOrNull()) fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CouponSubscriptionListPage.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CouponSubscriptionListPage.kt index 7ded38db..5598b914 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CouponSubscriptionListPage.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CouponSubscriptionListPage.kt @@ -18,6 +18,7 @@ import java.util.Objects import java.util.Optional import java.util.stream.Stream import java.util.stream.StreamSupport +import kotlin.jvm.optionals.getOrNull /** * This endpoint returns a list of all subscriptions that have redeemed a given coupon as a @@ -192,7 +193,7 @@ private constructor( while (index < page.data().size) { yield(page.data()[index++]) } - page = page.getNextPage().orElse(null) ?: break + page = page.getNextPage().getOrNull() ?: break index = 0 } } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CouponSubscriptionListParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CouponSubscriptionListParams.kt index 886608b5..edb7fbfd 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CouponSubscriptionListParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CouponSubscriptionListParams.kt @@ -9,6 +9,7 @@ import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull /** * This endpoint returns a list of all subscriptions that have redeemed a given coupon as a @@ -103,7 +104,7 @@ private constructor( * Cursor for pagination. This can be populated by the `next_cursor` value returned from the * initial request. */ - fun cursor(cursor: Optional) = cursor(cursor.orElse(null)) + fun cursor(cursor: Optional) = cursor(cursor.getOrNull()) /** The number of items to fetch. Defaults to 20. */ fun limit(limit: Long?) = apply { this.limit = limit } @@ -112,8 +113,7 @@ private constructor( fun limit(limit: Long) = limit(limit as Long?) /** The number of items to fetch. Defaults to 20. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun limit(limit: Optional) = limit(limit.orElse(null) as Long?) + fun limit(limit: Optional) = limit(limit.getOrNull()) fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CreditNote.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CreditNote.kt index 537b0ff8..f3c33545 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CreditNote.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CreditNote.kt @@ -20,6 +20,7 @@ import com.withorb.api.errors.OrbInvalidDataException import java.time.OffsetDateTime import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull /** * The [Credit Note](/invoicing/credit-notes) resource represents a credit that has been applied to @@ -309,7 +310,7 @@ private constructor( /** A URL to a PDF of the credit note. */ fun creditNotePdf(creditNotePdf: Optional) = - creditNotePdf(creditNotePdf.orElse(null)) + creditNotePdf(creditNotePdf.getOrNull()) /** A URL to a PDF of the credit note. */ fun creditNotePdf(creditNotePdf: JsonField) = apply { @@ -348,7 +349,7 @@ private constructor( /** The maximum amount applied on the original invoice */ fun maximumAmountAdjustment(maximumAmountAdjustment: Optional) = - maximumAmountAdjustment(maximumAmountAdjustment.orElse(null)) + maximumAmountAdjustment(maximumAmountAdjustment.getOrNull()) /** The maximum amount applied on the original invoice */ fun maximumAmountAdjustment(maximumAmountAdjustment: JsonField) = @@ -360,7 +361,7 @@ private constructor( fun memo(memo: String?) = memo(JsonField.ofNullable(memo)) /** An optional memo supplied on the credit note. */ - fun memo(memo: Optional) = memo(memo.orElse(null)) + fun memo(memo: Optional) = memo(memo.getOrNull()) /** An optional memo supplied on the credit note. */ fun memo(memo: JsonField) = apply { this.memo = memo } @@ -371,7 +372,7 @@ private constructor( /** Any credited amount from the applied minimum on the invoice. */ fun minimumAmountRefunded(minimumAmountRefunded: Optional) = - minimumAmountRefunded(minimumAmountRefunded.orElse(null)) + minimumAmountRefunded(minimumAmountRefunded.getOrNull()) /** Any credited amount from the applied minimum on the invoice. */ fun minimumAmountRefunded(minimumAmountRefunded: JsonField) = apply { @@ -380,7 +381,7 @@ private constructor( fun reason(reason: Reason?) = reason(JsonField.ofNullable(reason)) - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) fun reason(reason: JsonField) = apply { this.reason = reason } @@ -404,7 +405,7 @@ private constructor( fun voidedAt(voidedAt: OffsetDateTime?) = voidedAt(JsonField.ofNullable(voidedAt)) /** The time at which the credit note was voided in Orb, if applicable. */ - fun voidedAt(voidedAt: Optional) = voidedAt(voidedAt.orElse(null)) + fun voidedAt(voidedAt: Optional) = voidedAt(voidedAt.getOrNull()) /** The time at which the credit note was voided in Orb, if applicable. */ fun voidedAt(voidedAt: JsonField) = apply { this.voidedAt = voidedAt } @@ -543,7 +544,7 @@ private constructor( externalCustomerId(JsonField.ofNullable(externalCustomerId)) fun externalCustomerId(externalCustomerId: Optional) = - externalCustomerId(externalCustomerId.orElse(null)) + externalCustomerId(externalCustomerId.getOrNull()) fun externalCustomerId(externalCustomerId: JsonField) = apply { this.externalCustomerId = externalCustomerId @@ -777,8 +778,7 @@ private constructor( fun quantity(quantity: Double) = quantity(quantity as Double?) /** An optional quantity credited. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun quantity(quantity: Optional) = quantity(quantity.orElse(null) as Double?) + fun quantity(quantity: Optional) = quantity(quantity.getOrNull()) /** An optional quantity credited. */ fun quantity(quantity: JsonField) = apply { this.quantity = quantity } @@ -966,7 +966,7 @@ private constructor( /** The tax rate percentage, out of 100. */ fun taxRatePercentage(taxRatePercentage: Optional) = - taxRatePercentage(taxRatePercentage.orElse(null)) + taxRatePercentage(taxRatePercentage.getOrNull()) /** The tax rate percentage, out of 100. */ fun taxRatePercentage(taxRatePercentage: JsonField) = apply { @@ -1198,7 +1198,7 @@ private constructor( amountDiscount(JsonField.ofNullable(amountDiscount)) fun amountDiscount(amountDiscount: Optional) = - amountDiscount(amountDiscount.orElse(null)) + amountDiscount(amountDiscount.getOrNull()) fun amountDiscount(amountDiscount: JsonField) = apply { this.amountDiscount = amountDiscount @@ -1206,7 +1206,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) fun reason(reason: JsonField) = apply { this.reason = reason } @@ -1521,7 +1521,7 @@ private constructor( appliesToPrices(JsonField.ofNullable(appliesToPrices)) fun appliesToPrices(appliesToPrices: Optional>) = - appliesToPrices(appliesToPrices.orElse(null)) + appliesToPrices(appliesToPrices.getOrNull()) fun appliesToPrices(appliesToPrices: JsonField>) = apply { this.appliesToPrices = appliesToPrices.map { it.toMutableList() } @@ -1536,7 +1536,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) fun reason(reason: JsonField) = apply { this.reason = reason } @@ -2145,7 +2145,7 @@ private constructor( appliesToPrices(JsonField.ofNullable(appliesToPrices)) fun appliesToPrices(appliesToPrices: Optional>) = - appliesToPrices(appliesToPrices.orElse(null)) + appliesToPrices(appliesToPrices.getOrNull()) fun appliesToPrices(appliesToPrices: JsonField>) = apply { this.appliesToPrices = appliesToPrices.map { it.toMutableList() } @@ -2160,7 +2160,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) fun reason(reason: JsonField) = apply { this.reason = reason } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CreditNoteCreateParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CreditNoteCreateParams.kt index 2c1746f4..196f4647 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CreditNoteCreateParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CreditNoteCreateParams.kt @@ -22,6 +22,7 @@ import com.withorb.api.core.toImmutable import com.withorb.api.errors.OrbInvalidDataException import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull /** This endpoint is used to create a single [`Credit Note`](/invoicing/credit-notes). */ class CreditNoteCreateParams @@ -159,7 +160,7 @@ private constructor( fun memo(memo: String?) = memo(JsonField.ofNullable(memo)) /** An optional memo to attach to the credit note. */ - fun memo(memo: Optional) = memo(memo.orElse(null)) + fun memo(memo: Optional) = memo(memo.getOrNull()) /** An optional memo to attach to the credit note. */ fun memo(memo: JsonField) = apply { this.memo = memo } @@ -168,7 +169,7 @@ private constructor( fun reason(reason: Reason?) = reason(JsonField.ofNullable(reason)) /** An optional reason for the credit note. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** An optional reason for the credit note. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -259,7 +260,7 @@ private constructor( fun memo(memo: String?) = apply { body.memo(memo) } /** An optional memo to attach to the credit note. */ - fun memo(memo: Optional) = memo(memo.orElse(null)) + fun memo(memo: Optional) = memo(memo.getOrNull()) /** An optional memo to attach to the credit note. */ fun memo(memo: JsonField) = apply { body.memo(memo) } @@ -268,7 +269,7 @@ private constructor( fun reason(reason: Reason?) = apply { body.reason(reason) } /** An optional reason for the credit note. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** An optional reason for the credit note. */ fun reason(reason: JsonField) = apply { body.reason(reason) } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CreditNoteListPage.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CreditNoteListPage.kt index a2d6d101..94ffe97c 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CreditNoteListPage.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CreditNoteListPage.kt @@ -18,6 +18,7 @@ import java.util.Objects import java.util.Optional import java.util.stream.Stream import java.util.stream.StreamSupport +import kotlin.jvm.optionals.getOrNull /** * Get a paginated list of CreditNotes. Users can also filter by customer_id, subscription_id, or @@ -188,7 +189,7 @@ private constructor( while (index < page.data().size) { yield(page.data()[index++]) } - page = page.getNextPage().orElse(null) ?: break + page = page.getNextPage().getOrNull() ?: break index = 0 } } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CreditNoteListParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CreditNoteListParams.kt index d7419e76..897ef1b0 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CreditNoteListParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CreditNoteListParams.kt @@ -8,6 +8,7 @@ import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull /** * Get a paginated list of CreditNotes. Users can also filter by customer_id, subscription_id, or @@ -82,7 +83,7 @@ private constructor( * Cursor for pagination. This can be populated by the `next_cursor` value returned from the * initial request. */ - fun cursor(cursor: Optional) = cursor(cursor.orElse(null)) + fun cursor(cursor: Optional) = cursor(cursor.getOrNull()) /** The number of items to fetch. Defaults to 20. */ fun limit(limit: Long?) = apply { this.limit = limit } @@ -91,8 +92,7 @@ private constructor( fun limit(limit: Long) = limit(limit as Long?) /** The number of items to fetch. Defaults to 20. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun limit(limit: Optional) = limit(limit.orElse(null) as Long?) + fun limit(limit: Optional) = limit(limit.getOrNull()) fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/Customer.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/Customer.kt index c73b8de4..691b833c 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/Customer.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/Customer.kt @@ -20,6 +20,7 @@ import com.withorb.api.errors.OrbInvalidDataException import java.time.OffsetDateTime import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull /** * A customer is a buyer of your products, and the other party to the billing relationship. @@ -659,7 +660,7 @@ private constructor( billingAddress(JsonField.ofNullable(billingAddress)) fun billingAddress(billingAddress: Optional) = - billingAddress(billingAddress.orElse(null)) + billingAddress(billingAddress.getOrNull()) fun billingAddress(billingAddress: JsonField) = apply { this.billingAddress = billingAddress @@ -671,7 +672,7 @@ private constructor( fun currency(currency: String?) = currency(JsonField.ofNullable(currency)) - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) fun currency(currency: JsonField) = apply { this.currency = currency } @@ -699,9 +700,8 @@ private constructor( fun exemptFromAutomatedTax(exemptFromAutomatedTax: Boolean) = exemptFromAutomatedTax(exemptFromAutomatedTax as Boolean?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun exemptFromAutomatedTax(exemptFromAutomatedTax: Optional) = - exemptFromAutomatedTax(exemptFromAutomatedTax.orElse(null) as Boolean?) + exemptFromAutomatedTax(exemptFromAutomatedTax.getOrNull()) fun exemptFromAutomatedTax(exemptFromAutomatedTax: JsonField) = apply { this.exemptFromAutomatedTax = exemptFromAutomatedTax @@ -721,7 +721,7 @@ private constructor( * in your system. */ fun externalCustomerId(externalCustomerId: Optional) = - externalCustomerId(externalCustomerId.orElse(null)) + externalCustomerId(externalCustomerId.getOrNull()) /** * An optional user-defined ID for this customer resource, used throughout the system as an @@ -770,7 +770,7 @@ private constructor( * test mode, the connection must first be configured in the Orb webapp. */ fun paymentProvider(paymentProvider: Optional) = - paymentProvider(paymentProvider.orElse(null)) + paymentProvider(paymentProvider.getOrNull()) /** * This is used for creating charges or invoices in an external system via Orb. When not in @@ -792,7 +792,7 @@ private constructor( * for creating charges or invoices in the external system via Orb. */ fun paymentProviderId(paymentProviderId: Optional) = - paymentProviderId(paymentProviderId.orElse(null)) + paymentProviderId(paymentProviderId.getOrNull()) /** * The ID of this customer in an external payments solution, such as Stripe. This is used @@ -804,7 +804,7 @@ private constructor( fun portalUrl(portalUrl: String?) = portalUrl(JsonField.ofNullable(portalUrl)) - fun portalUrl(portalUrl: Optional) = portalUrl(portalUrl.orElse(null)) + fun portalUrl(portalUrl: Optional) = portalUrl(portalUrl.getOrNull()) fun portalUrl(portalUrl: JsonField) = apply { this.portalUrl = portalUrl } @@ -812,7 +812,7 @@ private constructor( shippingAddress(JsonField.ofNullable(shippingAddress)) fun shippingAddress(shippingAddress: Optional) = - shippingAddress(shippingAddress.orElse(null)) + shippingAddress(shippingAddress.getOrNull()) fun shippingAddress(shippingAddress: JsonField) = apply { this.shippingAddress = shippingAddress @@ -1032,7 +1032,7 @@ private constructor( * |Venezuela |`ve_rif` |Venezuelan RIF Number | * |Vietnam |`vn_tin` |Vietnamese Tax ID Number | */ - fun taxId(taxId: Optional) = taxId(taxId.orElse(null)) + fun taxId(taxId: Optional) = taxId(taxId.getOrNull()) /** * Tax IDs are commonly required to be displayed on customer invoices, which are added to @@ -1161,7 +1161,7 @@ private constructor( fun accountingSyncConfiguration( accountingSyncConfiguration: Optional - ) = accountingSyncConfiguration(accountingSyncConfiguration.orElse(null)) + ) = accountingSyncConfiguration(accountingSyncConfiguration.getOrNull()) fun accountingSyncConfiguration( accountingSyncConfiguration: JsonField @@ -1171,7 +1171,7 @@ private constructor( reportingConfiguration(JsonField.ofNullable(reportingConfiguration)) fun reportingConfiguration(reportingConfiguration: Optional) = - reportingConfiguration(reportingConfiguration.orElse(null)) + reportingConfiguration(reportingConfiguration.getOrNull()) fun reportingConfiguration(reportingConfiguration: JsonField) = apply { @@ -1342,37 +1342,37 @@ private constructor( fun city(city: String?) = city(JsonField.ofNullable(city)) - fun city(city: Optional) = city(city.orElse(null)) + fun city(city: Optional) = city(city.getOrNull()) fun city(city: JsonField) = apply { this.city = city } fun country(country: String?) = country(JsonField.ofNullable(country)) - fun country(country: Optional) = country(country.orElse(null)) + fun country(country: Optional) = country(country.getOrNull()) fun country(country: JsonField) = apply { this.country = country } fun line1(line1: String?) = line1(JsonField.ofNullable(line1)) - fun line1(line1: Optional) = line1(line1.orElse(null)) + fun line1(line1: Optional) = line1(line1.getOrNull()) fun line1(line1: JsonField) = apply { this.line1 = line1 } fun line2(line2: String?) = line2(JsonField.ofNullable(line2)) - fun line2(line2: Optional) = line2(line2.orElse(null)) + fun line2(line2: Optional) = line2(line2.getOrNull()) fun line2(line2: JsonField) = apply { this.line2 = line2 } fun postalCode(postalCode: String?) = postalCode(JsonField.ofNullable(postalCode)) - fun postalCode(postalCode: Optional) = postalCode(postalCode.orElse(null)) + fun postalCode(postalCode: Optional) = postalCode(postalCode.getOrNull()) fun postalCode(postalCode: JsonField) = apply { this.postalCode = postalCode } fun state(state: String?) = state(JsonField.ofNullable(state)) - fun state(state: Optional) = state(state.orElse(null)) + fun state(state: Optional) = state(state.getOrNull()) fun state(state: JsonField) = apply { this.state = state } @@ -1509,7 +1509,7 @@ private constructor( fun parent(parent: Parent?) = parent(JsonField.ofNullable(parent)) - fun parent(parent: Optional) = parent(parent.orElse(null)) + fun parent(parent: Optional) = parent(parent.getOrNull()) fun parent(parent: JsonField) = apply { this.parent = parent } @@ -1619,7 +1619,7 @@ private constructor( externalCustomerId(JsonField.ofNullable(externalCustomerId)) fun externalCustomerId(externalCustomerId: Optional) = - externalCustomerId(externalCustomerId.orElse(null)) + externalCustomerId(externalCustomerId.getOrNull()) fun externalCustomerId(externalCustomerId: JsonField) = apply { this.externalCustomerId = externalCustomerId @@ -1752,7 +1752,7 @@ private constructor( externalCustomerId(JsonField.ofNullable(externalCustomerId)) fun externalCustomerId(externalCustomerId: Optional) = - externalCustomerId(externalCustomerId.orElse(null)) + externalCustomerId(externalCustomerId.getOrNull()) fun externalCustomerId(externalCustomerId: JsonField) = apply { this.externalCustomerId = externalCustomerId @@ -2148,37 +2148,37 @@ private constructor( fun city(city: String?) = city(JsonField.ofNullable(city)) - fun city(city: Optional) = city(city.orElse(null)) + fun city(city: Optional) = city(city.getOrNull()) fun city(city: JsonField) = apply { this.city = city } fun country(country: String?) = country(JsonField.ofNullable(country)) - fun country(country: Optional) = country(country.orElse(null)) + fun country(country: Optional) = country(country.getOrNull()) fun country(country: JsonField) = apply { this.country = country } fun line1(line1: String?) = line1(JsonField.ofNullable(line1)) - fun line1(line1: Optional) = line1(line1.orElse(null)) + fun line1(line1: Optional) = line1(line1.getOrNull()) fun line1(line1: JsonField) = apply { this.line1 = line1 } fun line2(line2: String?) = line2(JsonField.ofNullable(line2)) - fun line2(line2: Optional) = line2(line2.orElse(null)) + fun line2(line2: Optional) = line2(line2.getOrNull()) fun line2(line2: JsonField) = apply { this.line2 = line2 } fun postalCode(postalCode: String?) = postalCode(JsonField.ofNullable(postalCode)) - fun postalCode(postalCode: Optional) = postalCode(postalCode.orElse(null)) + fun postalCode(postalCode: Optional) = postalCode(postalCode.getOrNull()) fun postalCode(postalCode: JsonField) = apply { this.postalCode = postalCode } fun state(state: String?) = state(JsonField.ofNullable(state)) - fun state(state: Optional) = state(state.orElse(null)) + fun state(state: Optional) = state(state.getOrNull()) fun state(state: JsonField) = apply { this.state = state } @@ -3740,7 +3740,7 @@ private constructor( externalProviderId(JsonField.ofNullable(externalProviderId)) fun externalProviderId(externalProviderId: Optional) = - externalProviderId(externalProviderId.orElse(null)) + externalProviderId(externalProviderId.getOrNull()) fun externalProviderId(externalProviderId: JsonField) = apply { this.externalProviderId = externalProviderId diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerBalanceTransactionCreateParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerBalanceTransactionCreateParams.kt index 706a9065..565374d7 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerBalanceTransactionCreateParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerBalanceTransactionCreateParams.kt @@ -21,6 +21,7 @@ import com.withorb.api.core.toImmutable import com.withorb.api.errors.OrbInvalidDataException import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull /** * Creates an immutable balance transaction that updates the customer's balance and returns back the @@ -162,7 +163,7 @@ private constructor( fun description(description: String?) = description(JsonField.ofNullable(description)) /** An optional description that can be specified around this entry. */ - fun description(description: Optional) = description(description.orElse(null)) + fun description(description: Optional) = description(description.getOrNull()) /** An optional description that can be specified around this entry. */ fun description(description: JsonField) = apply { @@ -267,7 +268,7 @@ private constructor( fun description(description: String?) = apply { body.description(description) } /** An optional description that can be specified around this entry. */ - fun description(description: Optional) = description(description.orElse(null)) + fun description(description: Optional) = description(description.getOrNull()) /** An optional description that can be specified around this entry. */ fun description(description: JsonField) = apply { body.description(description) } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerBalanceTransactionCreateResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerBalanceTransactionCreateResponse.kt index ee695479..31b40c60 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerBalanceTransactionCreateResponse.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerBalanceTransactionCreateResponse.kt @@ -19,6 +19,7 @@ import com.withorb.api.errors.OrbInvalidDataException import java.time.OffsetDateTime import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull @NoAutoDetect class CustomerBalanceTransactionCreateResponse @@ -231,7 +232,7 @@ private constructor( fun creditNote(creditNote: CreditNote?) = creditNote(JsonField.ofNullable(creditNote)) - fun creditNote(creditNote: Optional) = creditNote(creditNote.orElse(null)) + fun creditNote(creditNote: Optional) = creditNote(creditNote.getOrNull()) fun creditNote(creditNote: JsonField) = apply { this.creditNote = creditNote } @@ -239,7 +240,7 @@ private constructor( fun description(description: String?) = description(JsonField.ofNullable(description)) /** An optional description provided for manual customer balance adjustments. */ - fun description(description: Optional) = description(description.orElse(null)) + fun description(description: Optional) = description(description.getOrNull()) /** An optional description provided for manual customer balance adjustments. */ fun description(description: JsonField) = apply { this.description = description } @@ -260,7 +261,7 @@ private constructor( fun invoice(invoice: Invoice?) = invoice(JsonField.ofNullable(invoice)) - fun invoice(invoice: Optional) = invoice(invoice.orElse(null)) + fun invoice(invoice: Optional) = invoice(invoice.getOrNull()) fun invoice(invoice: JsonField) = apply { this.invoice = invoice } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerBalanceTransactionListPage.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerBalanceTransactionListPage.kt index f15d0e6e..ec5e0a70 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerBalanceTransactionListPage.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerBalanceTransactionListPage.kt @@ -18,6 +18,7 @@ import java.util.Objects import java.util.Optional import java.util.stream.Stream import java.util.stream.StreamSupport +import kotlin.jvm.optionals.getOrNull /** * ## The customer balance @@ -220,7 +221,7 @@ private constructor( while (index < page.data().size) { yield(page.data()[index++]) } - page = page.getNextPage().orElse(null) ?: break + page = page.getNextPage().getOrNull() ?: break index = 0 } } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerBalanceTransactionListParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerBalanceTransactionListParams.kt index 90c577f7..c1f51227 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerBalanceTransactionListParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerBalanceTransactionListParams.kt @@ -11,6 +11,7 @@ import java.time.OffsetDateTime import java.time.format.DateTimeFormatter import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull /** * ## The customer balance @@ -173,7 +174,7 @@ private constructor( * Cursor for pagination. This can be populated by the `next_cursor` value returned from the * initial request. */ - fun cursor(cursor: Optional) = cursor(cursor.orElse(null)) + fun cursor(cursor: Optional) = cursor(cursor.getOrNull()) /** The number of items to fetch. Defaults to 20. */ fun limit(limit: Long?) = apply { this.limit = limit } @@ -182,36 +183,35 @@ private constructor( fun limit(limit: Long) = limit(limit as Long?) /** The number of items to fetch. Defaults to 20. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun limit(limit: Optional) = limit(limit.orElse(null) as Long?) + fun limit(limit: Optional) = limit(limit.getOrNull()) fun operationTimeGt(operationTimeGt: OffsetDateTime?) = apply { this.operationTimeGt = operationTimeGt } fun operationTimeGt(operationTimeGt: Optional) = - operationTimeGt(operationTimeGt.orElse(null)) + operationTimeGt(operationTimeGt.getOrNull()) fun operationTimeGte(operationTimeGte: OffsetDateTime?) = apply { this.operationTimeGte = operationTimeGte } fun operationTimeGte(operationTimeGte: Optional) = - operationTimeGte(operationTimeGte.orElse(null)) + operationTimeGte(operationTimeGte.getOrNull()) fun operationTimeLt(operationTimeLt: OffsetDateTime?) = apply { this.operationTimeLt = operationTimeLt } fun operationTimeLt(operationTimeLt: Optional) = - operationTimeLt(operationTimeLt.orElse(null)) + operationTimeLt(operationTimeLt.getOrNull()) fun operationTimeLte(operationTimeLte: OffsetDateTime?) = apply { this.operationTimeLte = operationTimeLte } fun operationTimeLte(operationTimeLte: Optional) = - operationTimeLte(operationTimeLte.orElse(null)) + operationTimeLte(operationTimeLte.getOrNull()) fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerBalanceTransactionListResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerBalanceTransactionListResponse.kt index a392db06..89340e68 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerBalanceTransactionListResponse.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerBalanceTransactionListResponse.kt @@ -19,6 +19,7 @@ import com.withorb.api.errors.OrbInvalidDataException import java.time.OffsetDateTime import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull @NoAutoDetect class CustomerBalanceTransactionListResponse @@ -231,7 +232,7 @@ private constructor( fun creditNote(creditNote: CreditNote?) = creditNote(JsonField.ofNullable(creditNote)) - fun creditNote(creditNote: Optional) = creditNote(creditNote.orElse(null)) + fun creditNote(creditNote: Optional) = creditNote(creditNote.getOrNull()) fun creditNote(creditNote: JsonField) = apply { this.creditNote = creditNote } @@ -239,7 +240,7 @@ private constructor( fun description(description: String?) = description(JsonField.ofNullable(description)) /** An optional description provided for manual customer balance adjustments. */ - fun description(description: Optional) = description(description.orElse(null)) + fun description(description: Optional) = description(description.getOrNull()) /** An optional description provided for manual customer balance adjustments. */ fun description(description: JsonField) = apply { this.description = description } @@ -260,7 +261,7 @@ private constructor( fun invoice(invoice: Invoice?) = invoice(JsonField.ofNullable(invoice)) - fun invoice(invoice: Optional) = invoice(invoice.orElse(null)) + fun invoice(invoice: Optional) = invoice(invoice.getOrNull()) fun invoice(invoice: JsonField) = apply { this.invoice = invoice } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCostListByExternalIdParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCostListByExternalIdParams.kt index 273d0c48..4024f0a2 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCostListByExternalIdParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCostListByExternalIdParams.kt @@ -15,6 +15,7 @@ import java.time.OffsetDateTime import java.time.format.DateTimeFormatter import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull /** * This endpoint is used to fetch a day-by-day snapshot of a customer's costs in Orb, calculated by @@ -235,14 +236,14 @@ private constructor( fun currency(currency: String?) = apply { this.currency = currency } /** The currency or custom pricing unit to use. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** Costs returned are exclusive of `timeframe_end`. */ fun timeframeEnd(timeframeEnd: OffsetDateTime?) = apply { this.timeframeEnd = timeframeEnd } /** Costs returned are exclusive of `timeframe_end`. */ fun timeframeEnd(timeframeEnd: Optional) = - timeframeEnd(timeframeEnd.orElse(null)) + timeframeEnd(timeframeEnd.getOrNull()) /** Costs returned are inclusive of `timeframe_start`. */ fun timeframeStart(timeframeStart: OffsetDateTime?) = apply { @@ -251,7 +252,7 @@ private constructor( /** Costs returned are inclusive of `timeframe_start`. */ fun timeframeStart(timeframeStart: Optional) = - timeframeStart(timeframeStart.orElse(null)) + timeframeStart(timeframeStart.getOrNull()) /** * Controls whether Orb returns cumulative costs since the start of the billing period, or @@ -265,7 +266,7 @@ private constructor( * incremental day-by-day costs. If your customer has minimums or discounts, it's strongly * recommended that you use the default cumulative behavior. */ - fun viewMode(viewMode: Optional) = viewMode(viewMode.orElse(null)) + fun viewMode(viewMode: Optional) = viewMode(viewMode.getOrNull()) fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCostListByExternalIdResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCostListByExternalIdResponse.kt index d569c8fe..b3848c3f 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCostListByExternalIdResponse.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCostListByExternalIdResponse.kt @@ -18,6 +18,7 @@ import com.withorb.api.core.toImmutable import java.time.OffsetDateTime import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull @NoAutoDetect class CustomerCostListByExternalIdResponse @@ -550,9 +551,7 @@ private constructor( fun quantity(quantity: Double) = quantity(quantity as Double?) /** The price's quantity for the timeframe */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun quantity(quantity: Optional) = - quantity(quantity.orElse(null) as Double?) + fun quantity(quantity: Optional) = quantity(quantity.getOrNull()) /** The price's quantity for the timeframe */ fun quantity(quantity: JsonField) = apply { this.quantity = quantity } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCostListParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCostListParams.kt index 33da10e6..74594934 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCostListParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCostListParams.kt @@ -15,6 +15,7 @@ import java.time.OffsetDateTime import java.time.format.DateTimeFormatter import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull /** * This endpoint is used to fetch a day-by-day snapshot of a customer's costs in Orb, calculated by @@ -230,14 +231,14 @@ private constructor( fun currency(currency: String?) = apply { this.currency = currency } /** The currency or custom pricing unit to use. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** Costs returned are exclusive of `timeframe_end`. */ fun timeframeEnd(timeframeEnd: OffsetDateTime?) = apply { this.timeframeEnd = timeframeEnd } /** Costs returned are exclusive of `timeframe_end`. */ fun timeframeEnd(timeframeEnd: Optional) = - timeframeEnd(timeframeEnd.orElse(null)) + timeframeEnd(timeframeEnd.getOrNull()) /** Costs returned are inclusive of `timeframe_start`. */ fun timeframeStart(timeframeStart: OffsetDateTime?) = apply { @@ -246,7 +247,7 @@ private constructor( /** Costs returned are inclusive of `timeframe_start`. */ fun timeframeStart(timeframeStart: Optional) = - timeframeStart(timeframeStart.orElse(null)) + timeframeStart(timeframeStart.getOrNull()) /** * Controls whether Orb returns cumulative costs since the start of the billing period, or @@ -260,7 +261,7 @@ private constructor( * incremental day-by-day costs. If your customer has minimums or discounts, it's strongly * recommended that you use the default cumulative behavior. */ - fun viewMode(viewMode: Optional) = viewMode(viewMode.orElse(null)) + fun viewMode(viewMode: Optional) = viewMode(viewMode.getOrNull()) fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCostListResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCostListResponse.kt index 9d12760b..46e53ee2 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCostListResponse.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCostListResponse.kt @@ -18,6 +18,7 @@ import com.withorb.api.core.toImmutable import java.time.OffsetDateTime import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull @NoAutoDetect class CustomerCostListResponse @@ -546,9 +547,7 @@ private constructor( fun quantity(quantity: Double) = quantity(quantity as Double?) /** The price's quantity for the timeframe */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun quantity(quantity: Optional) = - quantity(quantity.orElse(null) as Double?) + fun quantity(quantity: Optional) = quantity(quantity.getOrNull()) /** The price's quantity for the timeframe */ fun quantity(quantity: JsonField) = apply { this.quantity = quantity } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreateParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreateParams.kt index 10c5cb8e..319e4444 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreateParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreateParams.kt @@ -1027,7 +1027,7 @@ private constructor( fun accountingSyncConfiguration( accountingSyncConfiguration: Optional - ) = accountingSyncConfiguration(accountingSyncConfiguration.orElse(null)) + ) = accountingSyncConfiguration(accountingSyncConfiguration.getOrNull()) fun accountingSyncConfiguration( accountingSyncConfiguration: JsonField @@ -1045,7 +1045,7 @@ private constructor( * will be CC'd for customer communications. */ fun additionalEmails(additionalEmails: Optional>) = - additionalEmails(additionalEmails.orElse(null)) + additionalEmails(additionalEmails.getOrNull()) /** * Additional email addresses for this customer. If populated, these email addresses @@ -1086,9 +1086,8 @@ private constructor( * a saved payment method, if available. This parameter defaults to `True` when a * payment provider is provided on customer creation. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun autoCollection(autoCollection: Optional) = - autoCollection(autoCollection.orElse(null) as Boolean?) + autoCollection(autoCollection.getOrNull()) /** * Used to determine if invoices for this customer will automatically attempt to charge @@ -1103,7 +1102,7 @@ private constructor( billingAddress(JsonField.ofNullable(billingAddress)) fun billingAddress(billingAddress: Optional) = - billingAddress(billingAddress.orElse(null)) + billingAddress(billingAddress.getOrNull()) fun billingAddress(billingAddress: JsonField) = apply { this.billingAddress = billingAddress @@ -1119,7 +1118,7 @@ private constructor( * An ISO 4217 currency string used for the customer's invoices and balance. If not set * at creation time, will be set at subscription creation time. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string used for the customer's invoices and balance. If not set @@ -1132,9 +1131,8 @@ private constructor( fun emailDelivery(emailDelivery: Boolean) = emailDelivery(emailDelivery as Boolean?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun emailDelivery(emailDelivery: Optional) = - emailDelivery(emailDelivery.orElse(null) as Boolean?) + emailDelivery(emailDelivery.getOrNull()) fun emailDelivery(emailDelivery: JsonField) = apply { this.emailDelivery = emailDelivery @@ -1154,7 +1152,7 @@ private constructor( * identifier in your system. */ fun externalCustomerId(externalCustomerId: Optional) = - externalCustomerId(externalCustomerId.orElse(null)) + externalCustomerId(externalCustomerId.getOrNull()) /** * An optional user-defined ID for this customer resource, used throughout the system as @@ -1169,7 +1167,7 @@ private constructor( fun hierarchy(hierarchy: Hierarchy?) = hierarchy(JsonField.ofNullable(hierarchy)) /** The hierarchical relationships for this customer. */ - fun hierarchy(hierarchy: Optional) = hierarchy(hierarchy.orElse(null)) + fun hierarchy(hierarchy: Optional) = hierarchy(hierarchy.getOrNull()) /** The hierarchical relationships for this customer. */ fun hierarchy(hierarchy: JsonField) = apply { this.hierarchy = hierarchy } @@ -1186,7 +1184,7 @@ private constructor( * setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed by @@ -1207,7 +1205,7 @@ private constructor( * in test mode, the connection must first be configured in the Orb webapp. */ fun paymentProvider(paymentProvider: Optional) = - paymentProvider(paymentProvider.orElse(null)) + paymentProvider(paymentProvider.getOrNull()) /** * This is used for creating charges or invoices in an external system via Orb. When not @@ -1229,7 +1227,7 @@ private constructor( * used for creating charges or invoices in the external system via Orb. */ fun paymentProviderId(paymentProviderId: Optional) = - paymentProviderId(paymentProviderId.orElse(null)) + paymentProviderId(paymentProviderId.getOrNull()) /** * The ID of this customer in an external payments solution, such as Stripe. This is @@ -1243,7 +1241,7 @@ private constructor( reportingConfiguration(JsonField.ofNullable(reportingConfiguration)) fun reportingConfiguration(reportingConfiguration: Optional) = - reportingConfiguration(reportingConfiguration.orElse(null)) + reportingConfiguration(reportingConfiguration.getOrNull()) fun reportingConfiguration(reportingConfiguration: JsonField) = apply { @@ -1254,7 +1252,7 @@ private constructor( shippingAddress(JsonField.ofNullable(shippingAddress)) fun shippingAddress(shippingAddress: Optional) = - shippingAddress(shippingAddress.orElse(null)) + shippingAddress(shippingAddress.getOrNull()) fun shippingAddress(shippingAddress: JsonField) = apply { this.shippingAddress = shippingAddress @@ -1264,7 +1262,7 @@ private constructor( taxConfiguration(JsonField.ofNullable(taxConfiguration)) fun taxConfiguration(taxConfiguration: Optional) = - taxConfiguration(taxConfiguration.orElse(null)) + taxConfiguration(taxConfiguration.getOrNull()) fun taxConfiguration(taxConfiguration: JsonField) = apply { this.taxConfiguration = taxConfiguration @@ -1513,7 +1511,7 @@ private constructor( * |Venezuela |`ve_rif` |Venezuelan RIF Number | * |Vietnam |`vn_tin` |Vietnamese Tax ID Number | */ - fun taxId(taxId: Optional) = taxId(taxId.orElse(null)) + fun taxId(taxId: Optional) = taxId(taxId.getOrNull()) /** * Tax IDs are commonly required to be displayed on customer invoices, which are added @@ -1635,7 +1633,7 @@ private constructor( * `"America/Los_Angeles"`. This defaults to your account's timezone if not set. This * cannot be changed after customer creation. */ - fun timezone(timezone: Optional) = timezone(timezone.orElse(null)) + fun timezone(timezone: Optional) = timezone(timezone.getOrNull()) /** * A timezone identifier from the IANA timezone database, such as @@ -1761,7 +1759,7 @@ private constructor( fun accountingSyncConfiguration( accountingSyncConfiguration: Optional - ) = accountingSyncConfiguration(accountingSyncConfiguration.orElse(null)) + ) = accountingSyncConfiguration(accountingSyncConfiguration.getOrNull()) fun accountingSyncConfiguration( accountingSyncConfiguration: JsonField @@ -1780,7 +1778,7 @@ private constructor( * CC'd for customer communications. */ fun additionalEmails(additionalEmails: Optional>) = - additionalEmails(additionalEmails.orElse(null)) + additionalEmails(additionalEmails.getOrNull()) /** * Additional email addresses for this customer. If populated, these email addresses will be @@ -1817,9 +1815,8 @@ private constructor( * saved payment method, if available. This parameter defaults to `True` when a payment * provider is provided on customer creation. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun autoCollection(autoCollection: Optional) = - autoCollection(autoCollection.orElse(null) as Boolean?) + autoCollection(autoCollection.getOrNull()) /** * Used to determine if invoices for this customer will automatically attempt to charge a @@ -1835,7 +1832,7 @@ private constructor( } fun billingAddress(billingAddress: Optional) = - billingAddress(billingAddress.orElse(null)) + billingAddress(billingAddress.getOrNull()) fun billingAddress(billingAddress: JsonField) = apply { body.billingAddress(billingAddress) @@ -1851,7 +1848,7 @@ private constructor( * An ISO 4217 currency string used for the customer's invoices and balance. If not set at * creation time, will be set at subscription creation time. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string used for the customer's invoices and balance. If not set at @@ -1863,9 +1860,8 @@ private constructor( fun emailDelivery(emailDelivery: Boolean) = emailDelivery(emailDelivery as Boolean?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun emailDelivery(emailDelivery: Optional) = - emailDelivery(emailDelivery.orElse(null) as Boolean?) + emailDelivery(emailDelivery.getOrNull()) fun emailDelivery(emailDelivery: JsonField) = apply { body.emailDelivery(emailDelivery) @@ -1886,7 +1882,7 @@ private constructor( * in your system. */ fun externalCustomerId(externalCustomerId: Optional) = - externalCustomerId(externalCustomerId.orElse(null)) + externalCustomerId(externalCustomerId.getOrNull()) /** * An optional user-defined ID for this customer resource, used throughout the system as an @@ -1901,7 +1897,7 @@ private constructor( fun hierarchy(hierarchy: Hierarchy?) = apply { body.hierarchy(hierarchy) } /** The hierarchical relationships for this customer. */ - fun hierarchy(hierarchy: Optional) = hierarchy(hierarchy.orElse(null)) + fun hierarchy(hierarchy: Optional) = hierarchy(hierarchy.getOrNull()) /** The hierarchical relationships for this customer. */ fun hierarchy(hierarchy: JsonField) = apply { body.hierarchy(hierarchy) } @@ -1918,7 +1914,7 @@ private constructor( * setting the value to `null`, and the entire metadata mapping can be cleared by setting * `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed by @@ -1940,7 +1936,7 @@ private constructor( * test mode, the connection must first be configured in the Orb webapp. */ fun paymentProvider(paymentProvider: Optional) = - paymentProvider(paymentProvider.orElse(null)) + paymentProvider(paymentProvider.getOrNull()) /** * This is used for creating charges or invoices in an external system via Orb. When not in @@ -1963,7 +1959,7 @@ private constructor( * for creating charges or invoices in the external system via Orb. */ fun paymentProviderId(paymentProviderId: Optional) = - paymentProviderId(paymentProviderId.orElse(null)) + paymentProviderId(paymentProviderId.getOrNull()) /** * The ID of this customer in an external payments solution, such as Stripe. This is used @@ -1978,7 +1974,7 @@ private constructor( } fun reportingConfiguration(reportingConfiguration: Optional) = - reportingConfiguration(reportingConfiguration.orElse(null)) + reportingConfiguration(reportingConfiguration.getOrNull()) fun reportingConfiguration(reportingConfiguration: JsonField) = apply { @@ -1990,7 +1986,7 @@ private constructor( } fun shippingAddress(shippingAddress: Optional) = - shippingAddress(shippingAddress.orElse(null)) + shippingAddress(shippingAddress.getOrNull()) fun shippingAddress(shippingAddress: JsonField) = apply { body.shippingAddress(shippingAddress) @@ -2001,7 +1997,7 @@ private constructor( } fun taxConfiguration(taxConfiguration: Optional) = - taxConfiguration(taxConfiguration.orElse(null)) + taxConfiguration(taxConfiguration.getOrNull()) fun taxConfiguration(taxConfiguration: JsonField) = apply { body.taxConfiguration(taxConfiguration) @@ -2237,7 +2233,7 @@ private constructor( * |Venezuela |`ve_rif` |Venezuelan RIF Number | * |Vietnam |`vn_tin` |Vietnamese Tax ID Number | */ - fun taxId(taxId: Optional) = taxId(taxId.orElse(null)) + fun taxId(taxId: Optional) = taxId(taxId.getOrNull()) /** * Tax IDs are commonly required to be displayed on customer invoices, which are added to @@ -2359,7 +2355,7 @@ private constructor( * This defaults to your account's timezone if not set. This cannot be changed after * customer creation. */ - fun timezone(timezone: Optional) = timezone(timezone.orElse(null)) + fun timezone(timezone: Optional) = timezone(timezone.getOrNull()) /** * A timezone identifier from the IANA timezone database, such as `"America/Los_Angeles"`. @@ -2565,7 +2561,7 @@ private constructor( accountingProviders(JsonField.ofNullable(accountingProviders)) fun accountingProviders(accountingProviders: Optional>) = - accountingProviders(accountingProviders.orElse(null)) + accountingProviders(accountingProviders.getOrNull()) fun accountingProviders(accountingProviders: JsonField>) = apply { @@ -2583,8 +2579,7 @@ private constructor( fun excluded(excluded: Boolean) = excluded(excluded as Boolean?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun excluded(excluded: Optional) = excluded(excluded.orElse(null) as Boolean?) + fun excluded(excluded: Optional) = excluded(excluded.getOrNull()) fun excluded(excluded: JsonField) = apply { this.excluded = excluded } @@ -2872,37 +2867,37 @@ private constructor( fun city(city: String?) = city(JsonField.ofNullable(city)) - fun city(city: Optional) = city(city.orElse(null)) + fun city(city: Optional) = city(city.getOrNull()) fun city(city: JsonField) = apply { this.city = city } fun country(country: String?) = country(JsonField.ofNullable(country)) - fun country(country: Optional) = country(country.orElse(null)) + fun country(country: Optional) = country(country.getOrNull()) fun country(country: JsonField) = apply { this.country = country } fun line1(line1: String?) = line1(JsonField.ofNullable(line1)) - fun line1(line1: Optional) = line1(line1.orElse(null)) + fun line1(line1: Optional) = line1(line1.getOrNull()) fun line1(line1: JsonField) = apply { this.line1 = line1 } fun line2(line2: String?) = line2(JsonField.ofNullable(line2)) - fun line2(line2: Optional) = line2(line2.orElse(null)) + fun line2(line2: Optional) = line2(line2.getOrNull()) fun line2(line2: JsonField) = apply { this.line2 = line2 } fun postalCode(postalCode: String?) = postalCode(JsonField.ofNullable(postalCode)) - fun postalCode(postalCode: Optional) = postalCode(postalCode.orElse(null)) + fun postalCode(postalCode: Optional) = postalCode(postalCode.getOrNull()) fun postalCode(postalCode: JsonField) = apply { this.postalCode = postalCode } fun state(state: String?) = state(JsonField.ofNullable(state)) - fun state(state: Optional) = state(state.orElse(null)) + fun state(state: Optional) = state(state.getOrNull()) fun state(state: JsonField) = apply { this.state = state } @@ -3076,7 +3071,7 @@ private constructor( * be a child of another customer. */ fun parentCustomerId(parentCustomerId: Optional) = - parentCustomerId(parentCustomerId.orElse(null)) + parentCustomerId(parentCustomerId.getOrNull()) /** * The ID of the parent customer in the hierarchy. The desired parent customer must not @@ -3548,37 +3543,37 @@ private constructor( fun city(city: String?) = city(JsonField.ofNullable(city)) - fun city(city: Optional) = city(city.orElse(null)) + fun city(city: Optional) = city(city.getOrNull()) fun city(city: JsonField) = apply { this.city = city } fun country(country: String?) = country(JsonField.ofNullable(country)) - fun country(country: Optional) = country(country.orElse(null)) + fun country(country: Optional) = country(country.getOrNull()) fun country(country: JsonField) = apply { this.country = country } fun line1(line1: String?) = line1(JsonField.ofNullable(line1)) - fun line1(line1: Optional) = line1(line1.orElse(null)) + fun line1(line1: Optional) = line1(line1.getOrNull()) fun line1(line1: JsonField) = apply { this.line1 = line1 } fun line2(line2: String?) = line2(JsonField.ofNullable(line2)) - fun line2(line2: Optional) = line2(line2.orElse(null)) + fun line2(line2: Optional) = line2(line2.getOrNull()) fun line2(line2: JsonField) = apply { this.line2 = line2 } fun postalCode(postalCode: String?) = postalCode(JsonField.ofNullable(postalCode)) - fun postalCode(postalCode: Optional) = postalCode(postalCode.orElse(null)) + fun postalCode(postalCode: Optional) = postalCode(postalCode.getOrNull()) fun postalCode(postalCode: JsonField) = apply { this.postalCode = postalCode } fun state(state: String?) = state(JsonField.ofNullable(state)) - fun state(state: Optional) = state(state.orElse(null)) + fun state(state: Optional) = state(state.getOrNull()) fun state(state: JsonField) = apply { this.state = state } @@ -3884,7 +3879,7 @@ private constructor( taxExemptionCode(JsonField.ofNullable(taxExemptionCode)) fun taxExemptionCode(taxExemptionCode: Optional) = - taxExemptionCode(taxExemptionCode.orElse(null)) + taxExemptionCode(taxExemptionCode.getOrNull()) fun taxExemptionCode(taxExemptionCode: JsonField) = apply { this.taxExemptionCode = taxExemptionCode diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerCreateEntryByExternalIdParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerCreateEntryByExternalIdParams.kt index 11cd2491..ba43107c 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerCreateEntryByExternalIdParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerCreateEntryByExternalIdParams.kt @@ -807,7 +807,7 @@ private constructor( * The currency or custom pricing unit to use for this ledger entry. If this is a * real-world currency, it must match the customer's invoicing currency. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * The currency or custom pricing unit to use for this ledger entry. If this is a @@ -829,7 +829,7 @@ private constructor( * for noting corrections as a result of an incident, etc. */ fun description(description: Optional) = - description(description.orElse(null)) + description(description.getOrNull()) /** * Optional metadata that can be specified when adding ledger results via the API. @@ -852,7 +852,7 @@ private constructor( * available for use. */ fun effectiveDate(effectiveDate: Optional) = - effectiveDate(effectiveDate.orElse(null)) + effectiveDate(effectiveDate.getOrNull()) /** * An ISO 8601 format date that denotes when this credit balance should become @@ -868,7 +868,7 @@ private constructor( /** An ISO 8601 format date that denotes when this credit balance should expire. */ fun expiryDate(expiryDate: Optional) = - expiryDate(expiryDate.orElse(null)) + expiryDate(expiryDate.getOrNull()) /** An ISO 8601 format date that denotes when this credit balance should expire. */ fun expiryDate(expiryDate: JsonField) = apply { @@ -889,7 +889,7 @@ private constructor( * as the calculation of the invoice total is done on that basis. */ fun invoiceSettings(invoiceSettings: Optional) = - invoiceSettings(invoiceSettings.orElse(null)) + invoiceSettings(invoiceSettings.getOrNull()) /** * Passing `invoice_settings` automatically generates an invoice for the newly added @@ -912,7 +912,7 @@ private constructor( * by setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -933,7 +933,7 @@ private constructor( * currency, a customer paid for a single credit in this block */ fun perUnitCostBasis(perUnitCostBasis: Optional) = - perUnitCostBasis(perUnitCostBasis.orElse(null)) + perUnitCostBasis(perUnitCostBasis.getOrNull()) /** * Can only be specified when entry_type=increment. How much, in the customer's @@ -1241,7 +1241,7 @@ private constructor( fun memo(memo: String?) = memo(JsonField.ofNullable(memo)) /** An optional memo to display on the invoice. */ - fun memo(memo: Optional) = memo(memo.orElse(null)) + fun memo(memo: Optional) = memo(memo.getOrNull()) /** An optional memo to display on the invoice. */ fun memo(memo: JsonField) = apply { this.memo = memo } @@ -1593,7 +1593,7 @@ private constructor( * The currency or custom pricing unit to use for this ledger entry. If this is a * real-world currency, it must match the customer's invoicing currency. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * The currency or custom pricing unit to use for this ledger entry. If this is a @@ -1615,7 +1615,7 @@ private constructor( * for noting corrections as a result of an incident, etc. */ fun description(description: Optional) = - description(description.orElse(null)) + description(description.getOrNull()) /** * Optional metadata that can be specified when adding ledger results via the API. @@ -1638,7 +1638,7 @@ private constructor( * by setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -2102,7 +2102,7 @@ private constructor( * An ISO 8601 format date that identifies the origination credit block to expire */ fun expiryDate(expiryDate: Optional) = - expiryDate(expiryDate.orElse(null)) + expiryDate(expiryDate.getOrNull()) /** * An ISO 8601 format date that identifies the origination credit block to expire @@ -2144,8 +2144,7 @@ private constructor( * The number of credits to effect. Note that this is required for increment, * decrement, void, or undo operations. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun amount(amount: Optional) = amount(amount.orElse(null) as Double?) + fun amount(amount: Optional) = amount(amount.getOrNull()) /** * The number of credits to effect. Note that this is required for increment, @@ -2163,7 +2162,7 @@ private constructor( * The ID of the block affected by an expiration_change, used to differentiate * between multiple blocks with the same `expiry_date`. */ - fun blockId(blockId: Optional) = blockId(blockId.orElse(null)) + fun blockId(blockId: Optional) = blockId(blockId.getOrNull()) /** * The ID of the block affected by an expiration_change, used to differentiate @@ -2181,7 +2180,7 @@ private constructor( * The currency or custom pricing unit to use for this ledger entry. If this is a * real-world currency, it must match the customer's invoicing currency. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * The currency or custom pricing unit to use for this ledger entry. If this is a @@ -2203,7 +2202,7 @@ private constructor( * for noting corrections as a result of an incident, etc. */ fun description(description: Optional) = - description(description.orElse(null)) + description(description.getOrNull()) /** * Optional metadata that can be specified when adding ledger results via the API. @@ -2226,7 +2225,7 @@ private constructor( * by setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -2682,7 +2681,7 @@ private constructor( * The currency or custom pricing unit to use for this ledger entry. If this is a * real-world currency, it must match the customer's invoicing currency. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * The currency or custom pricing unit to use for this ledger entry. If this is a @@ -2704,7 +2703,7 @@ private constructor( * for noting corrections as a result of an incident, etc. */ fun description(description: Optional) = - description(description.orElse(null)) + description(description.getOrNull()) /** * Optional metadata that can be specified when adding ledger results via the API. @@ -2727,7 +2726,7 @@ private constructor( * by setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -2742,7 +2741,7 @@ private constructor( /** Can only be specified when `entry_type=void`. The reason for the void. */ fun voidReason(voidReason: Optional) = - voidReason(voidReason.orElse(null)) + voidReason(voidReason.getOrNull()) /** Can only be specified when `entry_type=void`. The reason for the void. */ fun voidReason(voidReason: JsonField) = apply { @@ -3282,7 +3281,7 @@ private constructor( * The currency or custom pricing unit to use for this ledger entry. If this is a * real-world currency, it must match the customer's invoicing currency. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * The currency or custom pricing unit to use for this ledger entry. If this is a @@ -3304,7 +3303,7 @@ private constructor( * for noting corrections as a result of an incident, etc. */ fun description(description: Optional) = - description(description.orElse(null)) + description(description.getOrNull()) /** * Optional metadata that can be specified when adding ledger results via the API. @@ -3327,7 +3326,7 @@ private constructor( * by setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerCreateEntryByExternalIdResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerCreateEntryByExternalIdResponse.kt index 38993075..469c6970 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerCreateEntryByExternalIdResponse.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerCreateEntryByExternalIdResponse.kt @@ -655,7 +655,7 @@ private constructor( fun description(description: String?) = description(JsonField.ofNullable(description)) - fun description(description: Optional) = description(description.orElse(null)) + fun description(description: Optional) = description(description.getOrNull()) fun description(description: JsonField) = apply { this.description = description @@ -836,7 +836,7 @@ private constructor( expiryDate(JsonField.ofNullable(expiryDate)) fun expiryDate(expiryDate: Optional) = - expiryDate(expiryDate.orElse(null)) + expiryDate(expiryDate.getOrNull()) fun expiryDate(expiryDate: JsonField) = apply { this.expiryDate = expiryDate @@ -846,7 +846,7 @@ private constructor( perUnitCostBasis(JsonField.ofNullable(perUnitCostBasis)) fun perUnitCostBasis(perUnitCostBasis: Optional) = - perUnitCostBasis(perUnitCostBasis.orElse(null)) + perUnitCostBasis(perUnitCostBasis.getOrNull()) fun perUnitCostBasis(perUnitCostBasis: JsonField) = apply { this.perUnitCostBasis = perUnitCostBasis @@ -980,7 +980,7 @@ private constructor( externalCustomerId(JsonField.ofNullable(externalCustomerId)) fun externalCustomerId(externalCustomerId: Optional) = - externalCustomerId(externalCustomerId.orElse(null)) + externalCustomerId(externalCustomerId.getOrNull()) fun externalCustomerId(externalCustomerId: JsonField) = apply { this.externalCustomerId = externalCustomerId @@ -1612,7 +1612,7 @@ private constructor( fun description(description: String?) = description(JsonField.ofNullable(description)) - fun description(description: Optional) = description(description.orElse(null)) + fun description(description: Optional) = description(description.getOrNull()) fun description(description: JsonField) = apply { this.description = description @@ -1664,19 +1664,19 @@ private constructor( fun eventId(eventId: String?) = eventId(JsonField.ofNullable(eventId)) - fun eventId(eventId: Optional) = eventId(eventId.orElse(null)) + fun eventId(eventId: Optional) = eventId(eventId.getOrNull()) fun eventId(eventId: JsonField) = apply { this.eventId = eventId } fun invoiceId(invoiceId: String?) = invoiceId(JsonField.ofNullable(invoiceId)) - fun invoiceId(invoiceId: Optional) = invoiceId(invoiceId.orElse(null)) + fun invoiceId(invoiceId: Optional) = invoiceId(invoiceId.getOrNull()) fun invoiceId(invoiceId: JsonField) = apply { this.invoiceId = invoiceId } fun priceId(priceId: String?) = priceId(JsonField.ofNullable(priceId)) - fun priceId(priceId: Optional) = priceId(priceId.orElse(null)) + fun priceId(priceId: Optional) = priceId(priceId.getOrNull()) fun priceId(priceId: JsonField) = apply { this.priceId = priceId } @@ -1814,7 +1814,7 @@ private constructor( expiryDate(JsonField.ofNullable(expiryDate)) fun expiryDate(expiryDate: Optional) = - expiryDate(expiryDate.orElse(null)) + expiryDate(expiryDate.getOrNull()) fun expiryDate(expiryDate: JsonField) = apply { this.expiryDate = expiryDate @@ -1824,7 +1824,7 @@ private constructor( perUnitCostBasis(JsonField.ofNullable(perUnitCostBasis)) fun perUnitCostBasis(perUnitCostBasis: Optional) = - perUnitCostBasis(perUnitCostBasis.orElse(null)) + perUnitCostBasis(perUnitCostBasis.getOrNull()) fun perUnitCostBasis(perUnitCostBasis: JsonField) = apply { this.perUnitCostBasis = perUnitCostBasis @@ -1958,7 +1958,7 @@ private constructor( externalCustomerId(JsonField.ofNullable(externalCustomerId)) fun externalCustomerId(externalCustomerId: Optional) = - externalCustomerId(externalCustomerId.orElse(null)) + externalCustomerId(externalCustomerId.getOrNull()) fun externalCustomerId(externalCustomerId: JsonField) = apply { this.externalCustomerId = externalCustomerId @@ -2576,7 +2576,7 @@ private constructor( fun description(description: String?) = description(JsonField.ofNullable(description)) - fun description(description: Optional) = description(description.orElse(null)) + fun description(description: Optional) = description(description.getOrNull()) fun description(description: JsonField) = apply { this.description = description @@ -2623,7 +2623,7 @@ private constructor( newBlockExpiryDate(JsonField.ofNullable(newBlockExpiryDate)) fun newBlockExpiryDate(newBlockExpiryDate: Optional) = - newBlockExpiryDate(newBlockExpiryDate.orElse(null)) + newBlockExpiryDate(newBlockExpiryDate.getOrNull()) fun newBlockExpiryDate(newBlockExpiryDate: JsonField) = apply { this.newBlockExpiryDate = newBlockExpiryDate @@ -2768,7 +2768,7 @@ private constructor( expiryDate(JsonField.ofNullable(expiryDate)) fun expiryDate(expiryDate: Optional) = - expiryDate(expiryDate.orElse(null)) + expiryDate(expiryDate.getOrNull()) fun expiryDate(expiryDate: JsonField) = apply { this.expiryDate = expiryDate @@ -2778,7 +2778,7 @@ private constructor( perUnitCostBasis(JsonField.ofNullable(perUnitCostBasis)) fun perUnitCostBasis(perUnitCostBasis: Optional) = - perUnitCostBasis(perUnitCostBasis.orElse(null)) + perUnitCostBasis(perUnitCostBasis.getOrNull()) fun perUnitCostBasis(perUnitCostBasis: JsonField) = apply { this.perUnitCostBasis = perUnitCostBasis @@ -2912,7 +2912,7 @@ private constructor( externalCustomerId(JsonField.ofNullable(externalCustomerId)) fun externalCustomerId(externalCustomerId: Optional) = - externalCustomerId(externalCustomerId.orElse(null)) + externalCustomerId(externalCustomerId.getOrNull()) fun externalCustomerId(externalCustomerId: JsonField) = apply { this.externalCustomerId = externalCustomerId @@ -3516,7 +3516,7 @@ private constructor( fun description(description: String?) = description(JsonField.ofNullable(description)) - fun description(description: Optional) = description(description.orElse(null)) + fun description(description: Optional) = description(description.getOrNull()) fun description(description: JsonField) = apply { this.description = description @@ -3697,7 +3697,7 @@ private constructor( expiryDate(JsonField.ofNullable(expiryDate)) fun expiryDate(expiryDate: Optional) = - expiryDate(expiryDate.orElse(null)) + expiryDate(expiryDate.getOrNull()) fun expiryDate(expiryDate: JsonField) = apply { this.expiryDate = expiryDate @@ -3707,7 +3707,7 @@ private constructor( perUnitCostBasis(JsonField.ofNullable(perUnitCostBasis)) fun perUnitCostBasis(perUnitCostBasis: Optional) = - perUnitCostBasis(perUnitCostBasis.orElse(null)) + perUnitCostBasis(perUnitCostBasis.getOrNull()) fun perUnitCostBasis(perUnitCostBasis: JsonField) = apply { this.perUnitCostBasis = perUnitCostBasis @@ -3841,7 +3841,7 @@ private constructor( externalCustomerId(JsonField.ofNullable(externalCustomerId)) fun externalCustomerId(externalCustomerId: Optional) = - externalCustomerId(externalCustomerId.orElse(null)) + externalCustomerId(externalCustomerId.getOrNull()) fun externalCustomerId(externalCustomerId: JsonField) = apply { this.externalCustomerId = externalCustomerId @@ -4470,7 +4470,7 @@ private constructor( fun description(description: String?) = description(JsonField.ofNullable(description)) - fun description(description: Optional) = description(description.orElse(null)) + fun description(description: Optional) = description(description.getOrNull()) fun description(description: JsonField) = apply { this.description = description @@ -4526,7 +4526,7 @@ private constructor( fun voidReason(voidReason: String?) = voidReason(JsonField.ofNullable(voidReason)) - fun voidReason(voidReason: Optional) = voidReason(voidReason.orElse(null)) + fun voidReason(voidReason: Optional) = voidReason(voidReason.getOrNull()) fun voidReason(voidReason: JsonField) = apply { this.voidReason = voidReason } @@ -4663,7 +4663,7 @@ private constructor( expiryDate(JsonField.ofNullable(expiryDate)) fun expiryDate(expiryDate: Optional) = - expiryDate(expiryDate.orElse(null)) + expiryDate(expiryDate.getOrNull()) fun expiryDate(expiryDate: JsonField) = apply { this.expiryDate = expiryDate @@ -4673,7 +4673,7 @@ private constructor( perUnitCostBasis(JsonField.ofNullable(perUnitCostBasis)) fun perUnitCostBasis(perUnitCostBasis: Optional) = - perUnitCostBasis(perUnitCostBasis.orElse(null)) + perUnitCostBasis(perUnitCostBasis.getOrNull()) fun perUnitCostBasis(perUnitCostBasis: JsonField) = apply { this.perUnitCostBasis = perUnitCostBasis @@ -4807,7 +4807,7 @@ private constructor( externalCustomerId(JsonField.ofNullable(externalCustomerId)) fun externalCustomerId(externalCustomerId: Optional) = - externalCustomerId(externalCustomerId.orElse(null)) + externalCustomerId(externalCustomerId.getOrNull()) fun externalCustomerId(externalCustomerId: JsonField) = apply { this.externalCustomerId = externalCustomerId @@ -5450,7 +5450,7 @@ private constructor( fun description(description: String?) = description(JsonField.ofNullable(description)) - fun description(description: Optional) = description(description.orElse(null)) + fun description(description: Optional) = description(description.getOrNull()) fun description(description: JsonField) = apply { this.description = description @@ -5513,7 +5513,7 @@ private constructor( fun voidReason(voidReason: String?) = voidReason(JsonField.ofNullable(voidReason)) - fun voidReason(voidReason: Optional) = voidReason(voidReason.orElse(null)) + fun voidReason(voidReason: Optional) = voidReason(voidReason.getOrNull()) fun voidReason(voidReason: JsonField) = apply { this.voidReason = voidReason } @@ -5651,7 +5651,7 @@ private constructor( expiryDate(JsonField.ofNullable(expiryDate)) fun expiryDate(expiryDate: Optional) = - expiryDate(expiryDate.orElse(null)) + expiryDate(expiryDate.getOrNull()) fun expiryDate(expiryDate: JsonField) = apply { this.expiryDate = expiryDate @@ -5661,7 +5661,7 @@ private constructor( perUnitCostBasis(JsonField.ofNullable(perUnitCostBasis)) fun perUnitCostBasis(perUnitCostBasis: Optional) = - perUnitCostBasis(perUnitCostBasis.orElse(null)) + perUnitCostBasis(perUnitCostBasis.getOrNull()) fun perUnitCostBasis(perUnitCostBasis: JsonField) = apply { this.perUnitCostBasis = perUnitCostBasis @@ -5795,7 +5795,7 @@ private constructor( externalCustomerId(JsonField.ofNullable(externalCustomerId)) fun externalCustomerId(externalCustomerId: Optional) = - externalCustomerId(externalCustomerId.orElse(null)) + externalCustomerId(externalCustomerId.getOrNull()) fun externalCustomerId(externalCustomerId: JsonField) = apply { this.externalCustomerId = externalCustomerId @@ -6397,7 +6397,7 @@ private constructor( fun description(description: String?) = description(JsonField.ofNullable(description)) - fun description(description: Optional) = description(description.orElse(null)) + fun description(description: Optional) = description(description.getOrNull()) fun description(description: JsonField) = apply { this.description = description @@ -6578,7 +6578,7 @@ private constructor( expiryDate(JsonField.ofNullable(expiryDate)) fun expiryDate(expiryDate: Optional) = - expiryDate(expiryDate.orElse(null)) + expiryDate(expiryDate.getOrNull()) fun expiryDate(expiryDate: JsonField) = apply { this.expiryDate = expiryDate @@ -6588,7 +6588,7 @@ private constructor( perUnitCostBasis(JsonField.ofNullable(perUnitCostBasis)) fun perUnitCostBasis(perUnitCostBasis: Optional) = - perUnitCostBasis(perUnitCostBasis.orElse(null)) + perUnitCostBasis(perUnitCostBasis.getOrNull()) fun perUnitCostBasis(perUnitCostBasis: JsonField) = apply { this.perUnitCostBasis = perUnitCostBasis @@ -6722,7 +6722,7 @@ private constructor( externalCustomerId(JsonField.ofNullable(externalCustomerId)) fun externalCustomerId(externalCustomerId: Optional) = - externalCustomerId(externalCustomerId.orElse(null)) + externalCustomerId(externalCustomerId.getOrNull()) fun externalCustomerId(externalCustomerId: JsonField) = apply { this.externalCustomerId = externalCustomerId diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerCreateEntryParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerCreateEntryParams.kt index 7057a6d8..5c3f27c6 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerCreateEntryParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerCreateEntryParams.kt @@ -807,7 +807,7 @@ private constructor( * The currency or custom pricing unit to use for this ledger entry. If this is a * real-world currency, it must match the customer's invoicing currency. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * The currency or custom pricing unit to use for this ledger entry. If this is a @@ -829,7 +829,7 @@ private constructor( * for noting corrections as a result of an incident, etc. */ fun description(description: Optional) = - description(description.orElse(null)) + description(description.getOrNull()) /** * Optional metadata that can be specified when adding ledger results via the API. @@ -852,7 +852,7 @@ private constructor( * available for use. */ fun effectiveDate(effectiveDate: Optional) = - effectiveDate(effectiveDate.orElse(null)) + effectiveDate(effectiveDate.getOrNull()) /** * An ISO 8601 format date that denotes when this credit balance should become @@ -868,7 +868,7 @@ private constructor( /** An ISO 8601 format date that denotes when this credit balance should expire. */ fun expiryDate(expiryDate: Optional) = - expiryDate(expiryDate.orElse(null)) + expiryDate(expiryDate.getOrNull()) /** An ISO 8601 format date that denotes when this credit balance should expire. */ fun expiryDate(expiryDate: JsonField) = apply { @@ -889,7 +889,7 @@ private constructor( * as the calculation of the invoice total is done on that basis. */ fun invoiceSettings(invoiceSettings: Optional) = - invoiceSettings(invoiceSettings.orElse(null)) + invoiceSettings(invoiceSettings.getOrNull()) /** * Passing `invoice_settings` automatically generates an invoice for the newly added @@ -912,7 +912,7 @@ private constructor( * by setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -933,7 +933,7 @@ private constructor( * currency, a customer paid for a single credit in this block */ fun perUnitCostBasis(perUnitCostBasis: Optional) = - perUnitCostBasis(perUnitCostBasis.orElse(null)) + perUnitCostBasis(perUnitCostBasis.getOrNull()) /** * Can only be specified when entry_type=increment. How much, in the customer's @@ -1241,7 +1241,7 @@ private constructor( fun memo(memo: String?) = memo(JsonField.ofNullable(memo)) /** An optional memo to display on the invoice. */ - fun memo(memo: Optional) = memo(memo.orElse(null)) + fun memo(memo: Optional) = memo(memo.getOrNull()) /** An optional memo to display on the invoice. */ fun memo(memo: JsonField) = apply { this.memo = memo } @@ -1593,7 +1593,7 @@ private constructor( * The currency or custom pricing unit to use for this ledger entry. If this is a * real-world currency, it must match the customer's invoicing currency. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * The currency or custom pricing unit to use for this ledger entry. If this is a @@ -1615,7 +1615,7 @@ private constructor( * for noting corrections as a result of an incident, etc. */ fun description(description: Optional) = - description(description.orElse(null)) + description(description.getOrNull()) /** * Optional metadata that can be specified when adding ledger results via the API. @@ -1638,7 +1638,7 @@ private constructor( * by setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -2102,7 +2102,7 @@ private constructor( * An ISO 8601 format date that identifies the origination credit block to expire */ fun expiryDate(expiryDate: Optional) = - expiryDate(expiryDate.orElse(null)) + expiryDate(expiryDate.getOrNull()) /** * An ISO 8601 format date that identifies the origination credit block to expire @@ -2144,8 +2144,7 @@ private constructor( * The number of credits to effect. Note that this is required for increment, * decrement, void, or undo operations. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun amount(amount: Optional) = amount(amount.orElse(null) as Double?) + fun amount(amount: Optional) = amount(amount.getOrNull()) /** * The number of credits to effect. Note that this is required for increment, @@ -2163,7 +2162,7 @@ private constructor( * The ID of the block affected by an expiration_change, used to differentiate * between multiple blocks with the same `expiry_date`. */ - fun blockId(blockId: Optional) = blockId(blockId.orElse(null)) + fun blockId(blockId: Optional) = blockId(blockId.getOrNull()) /** * The ID of the block affected by an expiration_change, used to differentiate @@ -2181,7 +2180,7 @@ private constructor( * The currency or custom pricing unit to use for this ledger entry. If this is a * real-world currency, it must match the customer's invoicing currency. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * The currency or custom pricing unit to use for this ledger entry. If this is a @@ -2203,7 +2202,7 @@ private constructor( * for noting corrections as a result of an incident, etc. */ fun description(description: Optional) = - description(description.orElse(null)) + description(description.getOrNull()) /** * Optional metadata that can be specified when adding ledger results via the API. @@ -2226,7 +2225,7 @@ private constructor( * by setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -2682,7 +2681,7 @@ private constructor( * The currency or custom pricing unit to use for this ledger entry. If this is a * real-world currency, it must match the customer's invoicing currency. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * The currency or custom pricing unit to use for this ledger entry. If this is a @@ -2704,7 +2703,7 @@ private constructor( * for noting corrections as a result of an incident, etc. */ fun description(description: Optional) = - description(description.orElse(null)) + description(description.getOrNull()) /** * Optional metadata that can be specified when adding ledger results via the API. @@ -2727,7 +2726,7 @@ private constructor( * by setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -2742,7 +2741,7 @@ private constructor( /** Can only be specified when `entry_type=void`. The reason for the void. */ fun voidReason(voidReason: Optional) = - voidReason(voidReason.orElse(null)) + voidReason(voidReason.getOrNull()) /** Can only be specified when `entry_type=void`. The reason for the void. */ fun voidReason(voidReason: JsonField) = apply { @@ -3282,7 +3281,7 @@ private constructor( * The currency or custom pricing unit to use for this ledger entry. If this is a * real-world currency, it must match the customer's invoicing currency. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * The currency or custom pricing unit to use for this ledger entry. If this is a @@ -3304,7 +3303,7 @@ private constructor( * for noting corrections as a result of an incident, etc. */ fun description(description: Optional) = - description(description.orElse(null)) + description(description.getOrNull()) /** * Optional metadata that can be specified when adding ledger results via the API. @@ -3327,7 +3326,7 @@ private constructor( * by setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerCreateEntryResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerCreateEntryResponse.kt index 32c9b21e..7dde6a88 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerCreateEntryResponse.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerCreateEntryResponse.kt @@ -642,7 +642,7 @@ private constructor( fun description(description: String?) = description(JsonField.ofNullable(description)) - fun description(description: Optional) = description(description.orElse(null)) + fun description(description: Optional) = description(description.getOrNull()) fun description(description: JsonField) = apply { this.description = description @@ -823,7 +823,7 @@ private constructor( expiryDate(JsonField.ofNullable(expiryDate)) fun expiryDate(expiryDate: Optional) = - expiryDate(expiryDate.orElse(null)) + expiryDate(expiryDate.getOrNull()) fun expiryDate(expiryDate: JsonField) = apply { this.expiryDate = expiryDate @@ -833,7 +833,7 @@ private constructor( perUnitCostBasis(JsonField.ofNullable(perUnitCostBasis)) fun perUnitCostBasis(perUnitCostBasis: Optional) = - perUnitCostBasis(perUnitCostBasis.orElse(null)) + perUnitCostBasis(perUnitCostBasis.getOrNull()) fun perUnitCostBasis(perUnitCostBasis: JsonField) = apply { this.perUnitCostBasis = perUnitCostBasis @@ -967,7 +967,7 @@ private constructor( externalCustomerId(JsonField.ofNullable(externalCustomerId)) fun externalCustomerId(externalCustomerId: Optional) = - externalCustomerId(externalCustomerId.orElse(null)) + externalCustomerId(externalCustomerId.getOrNull()) fun externalCustomerId(externalCustomerId: JsonField) = apply { this.externalCustomerId = externalCustomerId @@ -1599,7 +1599,7 @@ private constructor( fun description(description: String?) = description(JsonField.ofNullable(description)) - fun description(description: Optional) = description(description.orElse(null)) + fun description(description: Optional) = description(description.getOrNull()) fun description(description: JsonField) = apply { this.description = description @@ -1651,19 +1651,19 @@ private constructor( fun eventId(eventId: String?) = eventId(JsonField.ofNullable(eventId)) - fun eventId(eventId: Optional) = eventId(eventId.orElse(null)) + fun eventId(eventId: Optional) = eventId(eventId.getOrNull()) fun eventId(eventId: JsonField) = apply { this.eventId = eventId } fun invoiceId(invoiceId: String?) = invoiceId(JsonField.ofNullable(invoiceId)) - fun invoiceId(invoiceId: Optional) = invoiceId(invoiceId.orElse(null)) + fun invoiceId(invoiceId: Optional) = invoiceId(invoiceId.getOrNull()) fun invoiceId(invoiceId: JsonField) = apply { this.invoiceId = invoiceId } fun priceId(priceId: String?) = priceId(JsonField.ofNullable(priceId)) - fun priceId(priceId: Optional) = priceId(priceId.orElse(null)) + fun priceId(priceId: Optional) = priceId(priceId.getOrNull()) fun priceId(priceId: JsonField) = apply { this.priceId = priceId } @@ -1801,7 +1801,7 @@ private constructor( expiryDate(JsonField.ofNullable(expiryDate)) fun expiryDate(expiryDate: Optional) = - expiryDate(expiryDate.orElse(null)) + expiryDate(expiryDate.getOrNull()) fun expiryDate(expiryDate: JsonField) = apply { this.expiryDate = expiryDate @@ -1811,7 +1811,7 @@ private constructor( perUnitCostBasis(JsonField.ofNullable(perUnitCostBasis)) fun perUnitCostBasis(perUnitCostBasis: Optional) = - perUnitCostBasis(perUnitCostBasis.orElse(null)) + perUnitCostBasis(perUnitCostBasis.getOrNull()) fun perUnitCostBasis(perUnitCostBasis: JsonField) = apply { this.perUnitCostBasis = perUnitCostBasis @@ -1945,7 +1945,7 @@ private constructor( externalCustomerId(JsonField.ofNullable(externalCustomerId)) fun externalCustomerId(externalCustomerId: Optional) = - externalCustomerId(externalCustomerId.orElse(null)) + externalCustomerId(externalCustomerId.getOrNull()) fun externalCustomerId(externalCustomerId: JsonField) = apply { this.externalCustomerId = externalCustomerId @@ -2563,7 +2563,7 @@ private constructor( fun description(description: String?) = description(JsonField.ofNullable(description)) - fun description(description: Optional) = description(description.orElse(null)) + fun description(description: Optional) = description(description.getOrNull()) fun description(description: JsonField) = apply { this.description = description @@ -2610,7 +2610,7 @@ private constructor( newBlockExpiryDate(JsonField.ofNullable(newBlockExpiryDate)) fun newBlockExpiryDate(newBlockExpiryDate: Optional) = - newBlockExpiryDate(newBlockExpiryDate.orElse(null)) + newBlockExpiryDate(newBlockExpiryDate.getOrNull()) fun newBlockExpiryDate(newBlockExpiryDate: JsonField) = apply { this.newBlockExpiryDate = newBlockExpiryDate @@ -2755,7 +2755,7 @@ private constructor( expiryDate(JsonField.ofNullable(expiryDate)) fun expiryDate(expiryDate: Optional) = - expiryDate(expiryDate.orElse(null)) + expiryDate(expiryDate.getOrNull()) fun expiryDate(expiryDate: JsonField) = apply { this.expiryDate = expiryDate @@ -2765,7 +2765,7 @@ private constructor( perUnitCostBasis(JsonField.ofNullable(perUnitCostBasis)) fun perUnitCostBasis(perUnitCostBasis: Optional) = - perUnitCostBasis(perUnitCostBasis.orElse(null)) + perUnitCostBasis(perUnitCostBasis.getOrNull()) fun perUnitCostBasis(perUnitCostBasis: JsonField) = apply { this.perUnitCostBasis = perUnitCostBasis @@ -2899,7 +2899,7 @@ private constructor( externalCustomerId(JsonField.ofNullable(externalCustomerId)) fun externalCustomerId(externalCustomerId: Optional) = - externalCustomerId(externalCustomerId.orElse(null)) + externalCustomerId(externalCustomerId.getOrNull()) fun externalCustomerId(externalCustomerId: JsonField) = apply { this.externalCustomerId = externalCustomerId @@ -3503,7 +3503,7 @@ private constructor( fun description(description: String?) = description(JsonField.ofNullable(description)) - fun description(description: Optional) = description(description.orElse(null)) + fun description(description: Optional) = description(description.getOrNull()) fun description(description: JsonField) = apply { this.description = description @@ -3684,7 +3684,7 @@ private constructor( expiryDate(JsonField.ofNullable(expiryDate)) fun expiryDate(expiryDate: Optional) = - expiryDate(expiryDate.orElse(null)) + expiryDate(expiryDate.getOrNull()) fun expiryDate(expiryDate: JsonField) = apply { this.expiryDate = expiryDate @@ -3694,7 +3694,7 @@ private constructor( perUnitCostBasis(JsonField.ofNullable(perUnitCostBasis)) fun perUnitCostBasis(perUnitCostBasis: Optional) = - perUnitCostBasis(perUnitCostBasis.orElse(null)) + perUnitCostBasis(perUnitCostBasis.getOrNull()) fun perUnitCostBasis(perUnitCostBasis: JsonField) = apply { this.perUnitCostBasis = perUnitCostBasis @@ -3828,7 +3828,7 @@ private constructor( externalCustomerId(JsonField.ofNullable(externalCustomerId)) fun externalCustomerId(externalCustomerId: Optional) = - externalCustomerId(externalCustomerId.orElse(null)) + externalCustomerId(externalCustomerId.getOrNull()) fun externalCustomerId(externalCustomerId: JsonField) = apply { this.externalCustomerId = externalCustomerId @@ -4457,7 +4457,7 @@ private constructor( fun description(description: String?) = description(JsonField.ofNullable(description)) - fun description(description: Optional) = description(description.orElse(null)) + fun description(description: Optional) = description(description.getOrNull()) fun description(description: JsonField) = apply { this.description = description @@ -4513,7 +4513,7 @@ private constructor( fun voidReason(voidReason: String?) = voidReason(JsonField.ofNullable(voidReason)) - fun voidReason(voidReason: Optional) = voidReason(voidReason.orElse(null)) + fun voidReason(voidReason: Optional) = voidReason(voidReason.getOrNull()) fun voidReason(voidReason: JsonField) = apply { this.voidReason = voidReason } @@ -4650,7 +4650,7 @@ private constructor( expiryDate(JsonField.ofNullable(expiryDate)) fun expiryDate(expiryDate: Optional) = - expiryDate(expiryDate.orElse(null)) + expiryDate(expiryDate.getOrNull()) fun expiryDate(expiryDate: JsonField) = apply { this.expiryDate = expiryDate @@ -4660,7 +4660,7 @@ private constructor( perUnitCostBasis(JsonField.ofNullable(perUnitCostBasis)) fun perUnitCostBasis(perUnitCostBasis: Optional) = - perUnitCostBasis(perUnitCostBasis.orElse(null)) + perUnitCostBasis(perUnitCostBasis.getOrNull()) fun perUnitCostBasis(perUnitCostBasis: JsonField) = apply { this.perUnitCostBasis = perUnitCostBasis @@ -4794,7 +4794,7 @@ private constructor( externalCustomerId(JsonField.ofNullable(externalCustomerId)) fun externalCustomerId(externalCustomerId: Optional) = - externalCustomerId(externalCustomerId.orElse(null)) + externalCustomerId(externalCustomerId.getOrNull()) fun externalCustomerId(externalCustomerId: JsonField) = apply { this.externalCustomerId = externalCustomerId @@ -5437,7 +5437,7 @@ private constructor( fun description(description: String?) = description(JsonField.ofNullable(description)) - fun description(description: Optional) = description(description.orElse(null)) + fun description(description: Optional) = description(description.getOrNull()) fun description(description: JsonField) = apply { this.description = description @@ -5500,7 +5500,7 @@ private constructor( fun voidReason(voidReason: String?) = voidReason(JsonField.ofNullable(voidReason)) - fun voidReason(voidReason: Optional) = voidReason(voidReason.orElse(null)) + fun voidReason(voidReason: Optional) = voidReason(voidReason.getOrNull()) fun voidReason(voidReason: JsonField) = apply { this.voidReason = voidReason } @@ -5638,7 +5638,7 @@ private constructor( expiryDate(JsonField.ofNullable(expiryDate)) fun expiryDate(expiryDate: Optional) = - expiryDate(expiryDate.orElse(null)) + expiryDate(expiryDate.getOrNull()) fun expiryDate(expiryDate: JsonField) = apply { this.expiryDate = expiryDate @@ -5648,7 +5648,7 @@ private constructor( perUnitCostBasis(JsonField.ofNullable(perUnitCostBasis)) fun perUnitCostBasis(perUnitCostBasis: Optional) = - perUnitCostBasis(perUnitCostBasis.orElse(null)) + perUnitCostBasis(perUnitCostBasis.getOrNull()) fun perUnitCostBasis(perUnitCostBasis: JsonField) = apply { this.perUnitCostBasis = perUnitCostBasis @@ -5782,7 +5782,7 @@ private constructor( externalCustomerId(JsonField.ofNullable(externalCustomerId)) fun externalCustomerId(externalCustomerId: Optional) = - externalCustomerId(externalCustomerId.orElse(null)) + externalCustomerId(externalCustomerId.getOrNull()) fun externalCustomerId(externalCustomerId: JsonField) = apply { this.externalCustomerId = externalCustomerId @@ -6384,7 +6384,7 @@ private constructor( fun description(description: String?) = description(JsonField.ofNullable(description)) - fun description(description: Optional) = description(description.orElse(null)) + fun description(description: Optional) = description(description.getOrNull()) fun description(description: JsonField) = apply { this.description = description @@ -6565,7 +6565,7 @@ private constructor( expiryDate(JsonField.ofNullable(expiryDate)) fun expiryDate(expiryDate: Optional) = - expiryDate(expiryDate.orElse(null)) + expiryDate(expiryDate.getOrNull()) fun expiryDate(expiryDate: JsonField) = apply { this.expiryDate = expiryDate @@ -6575,7 +6575,7 @@ private constructor( perUnitCostBasis(JsonField.ofNullable(perUnitCostBasis)) fun perUnitCostBasis(perUnitCostBasis: Optional) = - perUnitCostBasis(perUnitCostBasis.orElse(null)) + perUnitCostBasis(perUnitCostBasis.getOrNull()) fun perUnitCostBasis(perUnitCostBasis: JsonField) = apply { this.perUnitCostBasis = perUnitCostBasis @@ -6709,7 +6709,7 @@ private constructor( externalCustomerId(JsonField.ofNullable(externalCustomerId)) fun externalCustomerId(externalCustomerId: Optional) = - externalCustomerId(externalCustomerId.orElse(null)) + externalCustomerId(externalCustomerId.getOrNull()) fun externalCustomerId(externalCustomerId: JsonField) = apply { this.externalCustomerId = externalCustomerId diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerListByExternalIdPage.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerListByExternalIdPage.kt index b558665f..941d5d9c 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerListByExternalIdPage.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerListByExternalIdPage.kt @@ -18,6 +18,7 @@ import java.util.Objects import java.util.Optional import java.util.stream.Stream import java.util.stream.StreamSupport +import kotlin.jvm.optionals.getOrNull /** * The credits ledger provides _auditing_ functionality over Orb's credits system with a list of @@ -272,7 +273,7 @@ private constructor( while (index < page.data().size) { yield(page.data()[index++]) } - page = page.getNextPage().orElse(null) ?: break + page = page.getNextPage().getOrNull() ?: break index = 0 } } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerListByExternalIdParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerListByExternalIdParams.kt index 6ac166a1..ea86087c 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerListByExternalIdParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerListByExternalIdParams.kt @@ -15,6 +15,7 @@ import java.time.OffsetDateTime import java.time.format.DateTimeFormatter import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull /** * The credits ledger provides _auditing_ functionality over Orb's credits system with a list of @@ -249,28 +250,28 @@ private constructor( fun createdAtGt(createdAtGt: OffsetDateTime?) = apply { this.createdAtGt = createdAtGt } fun createdAtGt(createdAtGt: Optional) = - createdAtGt(createdAtGt.orElse(null)) + createdAtGt(createdAtGt.getOrNull()) fun createdAtGte(createdAtGte: OffsetDateTime?) = apply { this.createdAtGte = createdAtGte } fun createdAtGte(createdAtGte: Optional) = - createdAtGte(createdAtGte.orElse(null)) + createdAtGte(createdAtGte.getOrNull()) fun createdAtLt(createdAtLt: OffsetDateTime?) = apply { this.createdAtLt = createdAtLt } fun createdAtLt(createdAtLt: Optional) = - createdAtLt(createdAtLt.orElse(null)) + createdAtLt(createdAtLt.getOrNull()) fun createdAtLte(createdAtLte: OffsetDateTime?) = apply { this.createdAtLte = createdAtLte } fun createdAtLte(createdAtLte: Optional) = - createdAtLte(createdAtLte.orElse(null)) + createdAtLte(createdAtLte.getOrNull()) /** The ledger currency or custom pricing unit to use. */ fun currency(currency: String?) = apply { this.currency = currency } /** The ledger currency or custom pricing unit to use. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * Cursor for pagination. This can be populated by the `next_cursor` value returned from the @@ -282,15 +283,15 @@ private constructor( * Cursor for pagination. This can be populated by the `next_cursor` value returned from the * initial request. */ - fun cursor(cursor: Optional) = cursor(cursor.orElse(null)) + fun cursor(cursor: Optional) = cursor(cursor.getOrNull()) fun entryStatus(entryStatus: EntryStatus?) = apply { this.entryStatus = entryStatus } - fun entryStatus(entryStatus: Optional) = entryStatus(entryStatus.orElse(null)) + fun entryStatus(entryStatus: Optional) = entryStatus(entryStatus.getOrNull()) fun entryType(entryType: EntryType?) = apply { this.entryType = entryType } - fun entryType(entryType: Optional) = entryType(entryType.orElse(null)) + fun entryType(entryType: Optional) = entryType(entryType.getOrNull()) /** The number of items to fetch. Defaults to 20. */ fun limit(limit: Long?) = apply { this.limit = limit } @@ -299,13 +300,12 @@ private constructor( fun limit(limit: Long) = limit(limit as Long?) /** The number of items to fetch. Defaults to 20. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun limit(limit: Optional) = limit(limit.orElse(null) as Long?) + fun limit(limit: Optional) = limit(limit.getOrNull()) fun minimumAmount(minimumAmount: String?) = apply { this.minimumAmount = minimumAmount } fun minimumAmount(minimumAmount: Optional) = - minimumAmount(minimumAmount.orElse(null)) + minimumAmount(minimumAmount.getOrNull()) fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerListByExternalIdResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerListByExternalIdResponse.kt index ece9fe49..fbe1075c 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerListByExternalIdResponse.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerListByExternalIdResponse.kt @@ -653,7 +653,7 @@ private constructor( fun description(description: String?) = description(JsonField.ofNullable(description)) - fun description(description: Optional) = description(description.orElse(null)) + fun description(description: Optional) = description(description.getOrNull()) fun description(description: JsonField) = apply { this.description = description @@ -834,7 +834,7 @@ private constructor( expiryDate(JsonField.ofNullable(expiryDate)) fun expiryDate(expiryDate: Optional) = - expiryDate(expiryDate.orElse(null)) + expiryDate(expiryDate.getOrNull()) fun expiryDate(expiryDate: JsonField) = apply { this.expiryDate = expiryDate @@ -844,7 +844,7 @@ private constructor( perUnitCostBasis(JsonField.ofNullable(perUnitCostBasis)) fun perUnitCostBasis(perUnitCostBasis: Optional) = - perUnitCostBasis(perUnitCostBasis.orElse(null)) + perUnitCostBasis(perUnitCostBasis.getOrNull()) fun perUnitCostBasis(perUnitCostBasis: JsonField) = apply { this.perUnitCostBasis = perUnitCostBasis @@ -978,7 +978,7 @@ private constructor( externalCustomerId(JsonField.ofNullable(externalCustomerId)) fun externalCustomerId(externalCustomerId: Optional) = - externalCustomerId(externalCustomerId.orElse(null)) + externalCustomerId(externalCustomerId.getOrNull()) fun externalCustomerId(externalCustomerId: JsonField) = apply { this.externalCustomerId = externalCustomerId @@ -1610,7 +1610,7 @@ private constructor( fun description(description: String?) = description(JsonField.ofNullable(description)) - fun description(description: Optional) = description(description.orElse(null)) + fun description(description: Optional) = description(description.getOrNull()) fun description(description: JsonField) = apply { this.description = description @@ -1662,19 +1662,19 @@ private constructor( fun eventId(eventId: String?) = eventId(JsonField.ofNullable(eventId)) - fun eventId(eventId: Optional) = eventId(eventId.orElse(null)) + fun eventId(eventId: Optional) = eventId(eventId.getOrNull()) fun eventId(eventId: JsonField) = apply { this.eventId = eventId } fun invoiceId(invoiceId: String?) = invoiceId(JsonField.ofNullable(invoiceId)) - fun invoiceId(invoiceId: Optional) = invoiceId(invoiceId.orElse(null)) + fun invoiceId(invoiceId: Optional) = invoiceId(invoiceId.getOrNull()) fun invoiceId(invoiceId: JsonField) = apply { this.invoiceId = invoiceId } fun priceId(priceId: String?) = priceId(JsonField.ofNullable(priceId)) - fun priceId(priceId: Optional) = priceId(priceId.orElse(null)) + fun priceId(priceId: Optional) = priceId(priceId.getOrNull()) fun priceId(priceId: JsonField) = apply { this.priceId = priceId } @@ -1812,7 +1812,7 @@ private constructor( expiryDate(JsonField.ofNullable(expiryDate)) fun expiryDate(expiryDate: Optional) = - expiryDate(expiryDate.orElse(null)) + expiryDate(expiryDate.getOrNull()) fun expiryDate(expiryDate: JsonField) = apply { this.expiryDate = expiryDate @@ -1822,7 +1822,7 @@ private constructor( perUnitCostBasis(JsonField.ofNullable(perUnitCostBasis)) fun perUnitCostBasis(perUnitCostBasis: Optional) = - perUnitCostBasis(perUnitCostBasis.orElse(null)) + perUnitCostBasis(perUnitCostBasis.getOrNull()) fun perUnitCostBasis(perUnitCostBasis: JsonField) = apply { this.perUnitCostBasis = perUnitCostBasis @@ -1956,7 +1956,7 @@ private constructor( externalCustomerId(JsonField.ofNullable(externalCustomerId)) fun externalCustomerId(externalCustomerId: Optional) = - externalCustomerId(externalCustomerId.orElse(null)) + externalCustomerId(externalCustomerId.getOrNull()) fun externalCustomerId(externalCustomerId: JsonField) = apply { this.externalCustomerId = externalCustomerId @@ -2574,7 +2574,7 @@ private constructor( fun description(description: String?) = description(JsonField.ofNullable(description)) - fun description(description: Optional) = description(description.orElse(null)) + fun description(description: Optional) = description(description.getOrNull()) fun description(description: JsonField) = apply { this.description = description @@ -2621,7 +2621,7 @@ private constructor( newBlockExpiryDate(JsonField.ofNullable(newBlockExpiryDate)) fun newBlockExpiryDate(newBlockExpiryDate: Optional) = - newBlockExpiryDate(newBlockExpiryDate.orElse(null)) + newBlockExpiryDate(newBlockExpiryDate.getOrNull()) fun newBlockExpiryDate(newBlockExpiryDate: JsonField) = apply { this.newBlockExpiryDate = newBlockExpiryDate @@ -2766,7 +2766,7 @@ private constructor( expiryDate(JsonField.ofNullable(expiryDate)) fun expiryDate(expiryDate: Optional) = - expiryDate(expiryDate.orElse(null)) + expiryDate(expiryDate.getOrNull()) fun expiryDate(expiryDate: JsonField) = apply { this.expiryDate = expiryDate @@ -2776,7 +2776,7 @@ private constructor( perUnitCostBasis(JsonField.ofNullable(perUnitCostBasis)) fun perUnitCostBasis(perUnitCostBasis: Optional) = - perUnitCostBasis(perUnitCostBasis.orElse(null)) + perUnitCostBasis(perUnitCostBasis.getOrNull()) fun perUnitCostBasis(perUnitCostBasis: JsonField) = apply { this.perUnitCostBasis = perUnitCostBasis @@ -2910,7 +2910,7 @@ private constructor( externalCustomerId(JsonField.ofNullable(externalCustomerId)) fun externalCustomerId(externalCustomerId: Optional) = - externalCustomerId(externalCustomerId.orElse(null)) + externalCustomerId(externalCustomerId.getOrNull()) fun externalCustomerId(externalCustomerId: JsonField) = apply { this.externalCustomerId = externalCustomerId @@ -3514,7 +3514,7 @@ private constructor( fun description(description: String?) = description(JsonField.ofNullable(description)) - fun description(description: Optional) = description(description.orElse(null)) + fun description(description: Optional) = description(description.getOrNull()) fun description(description: JsonField) = apply { this.description = description @@ -3695,7 +3695,7 @@ private constructor( expiryDate(JsonField.ofNullable(expiryDate)) fun expiryDate(expiryDate: Optional) = - expiryDate(expiryDate.orElse(null)) + expiryDate(expiryDate.getOrNull()) fun expiryDate(expiryDate: JsonField) = apply { this.expiryDate = expiryDate @@ -3705,7 +3705,7 @@ private constructor( perUnitCostBasis(JsonField.ofNullable(perUnitCostBasis)) fun perUnitCostBasis(perUnitCostBasis: Optional) = - perUnitCostBasis(perUnitCostBasis.orElse(null)) + perUnitCostBasis(perUnitCostBasis.getOrNull()) fun perUnitCostBasis(perUnitCostBasis: JsonField) = apply { this.perUnitCostBasis = perUnitCostBasis @@ -3839,7 +3839,7 @@ private constructor( externalCustomerId(JsonField.ofNullable(externalCustomerId)) fun externalCustomerId(externalCustomerId: Optional) = - externalCustomerId(externalCustomerId.orElse(null)) + externalCustomerId(externalCustomerId.getOrNull()) fun externalCustomerId(externalCustomerId: JsonField) = apply { this.externalCustomerId = externalCustomerId @@ -4468,7 +4468,7 @@ private constructor( fun description(description: String?) = description(JsonField.ofNullable(description)) - fun description(description: Optional) = description(description.orElse(null)) + fun description(description: Optional) = description(description.getOrNull()) fun description(description: JsonField) = apply { this.description = description @@ -4524,7 +4524,7 @@ private constructor( fun voidReason(voidReason: String?) = voidReason(JsonField.ofNullable(voidReason)) - fun voidReason(voidReason: Optional) = voidReason(voidReason.orElse(null)) + fun voidReason(voidReason: Optional) = voidReason(voidReason.getOrNull()) fun voidReason(voidReason: JsonField) = apply { this.voidReason = voidReason } @@ -4661,7 +4661,7 @@ private constructor( expiryDate(JsonField.ofNullable(expiryDate)) fun expiryDate(expiryDate: Optional) = - expiryDate(expiryDate.orElse(null)) + expiryDate(expiryDate.getOrNull()) fun expiryDate(expiryDate: JsonField) = apply { this.expiryDate = expiryDate @@ -4671,7 +4671,7 @@ private constructor( perUnitCostBasis(JsonField.ofNullable(perUnitCostBasis)) fun perUnitCostBasis(perUnitCostBasis: Optional) = - perUnitCostBasis(perUnitCostBasis.orElse(null)) + perUnitCostBasis(perUnitCostBasis.getOrNull()) fun perUnitCostBasis(perUnitCostBasis: JsonField) = apply { this.perUnitCostBasis = perUnitCostBasis @@ -4805,7 +4805,7 @@ private constructor( externalCustomerId(JsonField.ofNullable(externalCustomerId)) fun externalCustomerId(externalCustomerId: Optional) = - externalCustomerId(externalCustomerId.orElse(null)) + externalCustomerId(externalCustomerId.getOrNull()) fun externalCustomerId(externalCustomerId: JsonField) = apply { this.externalCustomerId = externalCustomerId @@ -5448,7 +5448,7 @@ private constructor( fun description(description: String?) = description(JsonField.ofNullable(description)) - fun description(description: Optional) = description(description.orElse(null)) + fun description(description: Optional) = description(description.getOrNull()) fun description(description: JsonField) = apply { this.description = description @@ -5511,7 +5511,7 @@ private constructor( fun voidReason(voidReason: String?) = voidReason(JsonField.ofNullable(voidReason)) - fun voidReason(voidReason: Optional) = voidReason(voidReason.orElse(null)) + fun voidReason(voidReason: Optional) = voidReason(voidReason.getOrNull()) fun voidReason(voidReason: JsonField) = apply { this.voidReason = voidReason } @@ -5649,7 +5649,7 @@ private constructor( expiryDate(JsonField.ofNullable(expiryDate)) fun expiryDate(expiryDate: Optional) = - expiryDate(expiryDate.orElse(null)) + expiryDate(expiryDate.getOrNull()) fun expiryDate(expiryDate: JsonField) = apply { this.expiryDate = expiryDate @@ -5659,7 +5659,7 @@ private constructor( perUnitCostBasis(JsonField.ofNullable(perUnitCostBasis)) fun perUnitCostBasis(perUnitCostBasis: Optional) = - perUnitCostBasis(perUnitCostBasis.orElse(null)) + perUnitCostBasis(perUnitCostBasis.getOrNull()) fun perUnitCostBasis(perUnitCostBasis: JsonField) = apply { this.perUnitCostBasis = perUnitCostBasis @@ -5793,7 +5793,7 @@ private constructor( externalCustomerId(JsonField.ofNullable(externalCustomerId)) fun externalCustomerId(externalCustomerId: Optional) = - externalCustomerId(externalCustomerId.orElse(null)) + externalCustomerId(externalCustomerId.getOrNull()) fun externalCustomerId(externalCustomerId: JsonField) = apply { this.externalCustomerId = externalCustomerId @@ -6395,7 +6395,7 @@ private constructor( fun description(description: String?) = description(JsonField.ofNullable(description)) - fun description(description: Optional) = description(description.orElse(null)) + fun description(description: Optional) = description(description.getOrNull()) fun description(description: JsonField) = apply { this.description = description @@ -6576,7 +6576,7 @@ private constructor( expiryDate(JsonField.ofNullable(expiryDate)) fun expiryDate(expiryDate: Optional) = - expiryDate(expiryDate.orElse(null)) + expiryDate(expiryDate.getOrNull()) fun expiryDate(expiryDate: JsonField) = apply { this.expiryDate = expiryDate @@ -6586,7 +6586,7 @@ private constructor( perUnitCostBasis(JsonField.ofNullable(perUnitCostBasis)) fun perUnitCostBasis(perUnitCostBasis: Optional) = - perUnitCostBasis(perUnitCostBasis.orElse(null)) + perUnitCostBasis(perUnitCostBasis.getOrNull()) fun perUnitCostBasis(perUnitCostBasis: JsonField) = apply { this.perUnitCostBasis = perUnitCostBasis @@ -6720,7 +6720,7 @@ private constructor( externalCustomerId(JsonField.ofNullable(externalCustomerId)) fun externalCustomerId(externalCustomerId: Optional) = - externalCustomerId(externalCustomerId.orElse(null)) + externalCustomerId(externalCustomerId.getOrNull()) fun externalCustomerId(externalCustomerId: JsonField) = apply { this.externalCustomerId = externalCustomerId diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerListPage.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerListPage.kt index 30f3d6c2..0c21049d 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerListPage.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerListPage.kt @@ -18,6 +18,7 @@ import java.util.Objects import java.util.Optional import java.util.stream.Stream import java.util.stream.StreamSupport +import kotlin.jvm.optionals.getOrNull /** * The credits ledger provides _auditing_ functionality over Orb's credits system with a list of @@ -268,7 +269,7 @@ private constructor( while (index < page.data().size) { yield(page.data()[index++]) } - page = page.getNextPage().orElse(null) ?: break + page = page.getNextPage().getOrNull() ?: break index = 0 } } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerListParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerListParams.kt index fcea2555..4e1919dd 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerListParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerListParams.kt @@ -15,6 +15,7 @@ import java.time.OffsetDateTime import java.time.format.DateTimeFormatter import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull /** * The credits ledger provides _auditing_ functionality over Orb's credits system with a list of @@ -243,28 +244,28 @@ private constructor( fun createdAtGt(createdAtGt: OffsetDateTime?) = apply { this.createdAtGt = createdAtGt } fun createdAtGt(createdAtGt: Optional) = - createdAtGt(createdAtGt.orElse(null)) + createdAtGt(createdAtGt.getOrNull()) fun createdAtGte(createdAtGte: OffsetDateTime?) = apply { this.createdAtGte = createdAtGte } fun createdAtGte(createdAtGte: Optional) = - createdAtGte(createdAtGte.orElse(null)) + createdAtGte(createdAtGte.getOrNull()) fun createdAtLt(createdAtLt: OffsetDateTime?) = apply { this.createdAtLt = createdAtLt } fun createdAtLt(createdAtLt: Optional) = - createdAtLt(createdAtLt.orElse(null)) + createdAtLt(createdAtLt.getOrNull()) fun createdAtLte(createdAtLte: OffsetDateTime?) = apply { this.createdAtLte = createdAtLte } fun createdAtLte(createdAtLte: Optional) = - createdAtLte(createdAtLte.orElse(null)) + createdAtLte(createdAtLte.getOrNull()) /** The ledger currency or custom pricing unit to use. */ fun currency(currency: String?) = apply { this.currency = currency } /** The ledger currency or custom pricing unit to use. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * Cursor for pagination. This can be populated by the `next_cursor` value returned from the @@ -276,15 +277,15 @@ private constructor( * Cursor for pagination. This can be populated by the `next_cursor` value returned from the * initial request. */ - fun cursor(cursor: Optional) = cursor(cursor.orElse(null)) + fun cursor(cursor: Optional) = cursor(cursor.getOrNull()) fun entryStatus(entryStatus: EntryStatus?) = apply { this.entryStatus = entryStatus } - fun entryStatus(entryStatus: Optional) = entryStatus(entryStatus.orElse(null)) + fun entryStatus(entryStatus: Optional) = entryStatus(entryStatus.getOrNull()) fun entryType(entryType: EntryType?) = apply { this.entryType = entryType } - fun entryType(entryType: Optional) = entryType(entryType.orElse(null)) + fun entryType(entryType: Optional) = entryType(entryType.getOrNull()) /** The number of items to fetch. Defaults to 20. */ fun limit(limit: Long?) = apply { this.limit = limit } @@ -293,13 +294,12 @@ private constructor( fun limit(limit: Long) = limit(limit as Long?) /** The number of items to fetch. Defaults to 20. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun limit(limit: Optional) = limit(limit.orElse(null) as Long?) + fun limit(limit: Optional) = limit(limit.getOrNull()) fun minimumAmount(minimumAmount: String?) = apply { this.minimumAmount = minimumAmount } fun minimumAmount(minimumAmount: Optional) = - minimumAmount(minimumAmount.orElse(null)) + minimumAmount(minimumAmount.getOrNull()) fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerListResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerListResponse.kt index 775509d1..92c3ea08 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerListResponse.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerListResponse.kt @@ -634,7 +634,7 @@ private constructor( fun description(description: String?) = description(JsonField.ofNullable(description)) - fun description(description: Optional) = description(description.orElse(null)) + fun description(description: Optional) = description(description.getOrNull()) fun description(description: JsonField) = apply { this.description = description @@ -815,7 +815,7 @@ private constructor( expiryDate(JsonField.ofNullable(expiryDate)) fun expiryDate(expiryDate: Optional) = - expiryDate(expiryDate.orElse(null)) + expiryDate(expiryDate.getOrNull()) fun expiryDate(expiryDate: JsonField) = apply { this.expiryDate = expiryDate @@ -825,7 +825,7 @@ private constructor( perUnitCostBasis(JsonField.ofNullable(perUnitCostBasis)) fun perUnitCostBasis(perUnitCostBasis: Optional) = - perUnitCostBasis(perUnitCostBasis.orElse(null)) + perUnitCostBasis(perUnitCostBasis.getOrNull()) fun perUnitCostBasis(perUnitCostBasis: JsonField) = apply { this.perUnitCostBasis = perUnitCostBasis @@ -959,7 +959,7 @@ private constructor( externalCustomerId(JsonField.ofNullable(externalCustomerId)) fun externalCustomerId(externalCustomerId: Optional) = - externalCustomerId(externalCustomerId.orElse(null)) + externalCustomerId(externalCustomerId.getOrNull()) fun externalCustomerId(externalCustomerId: JsonField) = apply { this.externalCustomerId = externalCustomerId @@ -1591,7 +1591,7 @@ private constructor( fun description(description: String?) = description(JsonField.ofNullable(description)) - fun description(description: Optional) = description(description.orElse(null)) + fun description(description: Optional) = description(description.getOrNull()) fun description(description: JsonField) = apply { this.description = description @@ -1643,19 +1643,19 @@ private constructor( fun eventId(eventId: String?) = eventId(JsonField.ofNullable(eventId)) - fun eventId(eventId: Optional) = eventId(eventId.orElse(null)) + fun eventId(eventId: Optional) = eventId(eventId.getOrNull()) fun eventId(eventId: JsonField) = apply { this.eventId = eventId } fun invoiceId(invoiceId: String?) = invoiceId(JsonField.ofNullable(invoiceId)) - fun invoiceId(invoiceId: Optional) = invoiceId(invoiceId.orElse(null)) + fun invoiceId(invoiceId: Optional) = invoiceId(invoiceId.getOrNull()) fun invoiceId(invoiceId: JsonField) = apply { this.invoiceId = invoiceId } fun priceId(priceId: String?) = priceId(JsonField.ofNullable(priceId)) - fun priceId(priceId: Optional) = priceId(priceId.orElse(null)) + fun priceId(priceId: Optional) = priceId(priceId.getOrNull()) fun priceId(priceId: JsonField) = apply { this.priceId = priceId } @@ -1793,7 +1793,7 @@ private constructor( expiryDate(JsonField.ofNullable(expiryDate)) fun expiryDate(expiryDate: Optional) = - expiryDate(expiryDate.orElse(null)) + expiryDate(expiryDate.getOrNull()) fun expiryDate(expiryDate: JsonField) = apply { this.expiryDate = expiryDate @@ -1803,7 +1803,7 @@ private constructor( perUnitCostBasis(JsonField.ofNullable(perUnitCostBasis)) fun perUnitCostBasis(perUnitCostBasis: Optional) = - perUnitCostBasis(perUnitCostBasis.orElse(null)) + perUnitCostBasis(perUnitCostBasis.getOrNull()) fun perUnitCostBasis(perUnitCostBasis: JsonField) = apply { this.perUnitCostBasis = perUnitCostBasis @@ -1937,7 +1937,7 @@ private constructor( externalCustomerId(JsonField.ofNullable(externalCustomerId)) fun externalCustomerId(externalCustomerId: Optional) = - externalCustomerId(externalCustomerId.orElse(null)) + externalCustomerId(externalCustomerId.getOrNull()) fun externalCustomerId(externalCustomerId: JsonField) = apply { this.externalCustomerId = externalCustomerId @@ -2555,7 +2555,7 @@ private constructor( fun description(description: String?) = description(JsonField.ofNullable(description)) - fun description(description: Optional) = description(description.orElse(null)) + fun description(description: Optional) = description(description.getOrNull()) fun description(description: JsonField) = apply { this.description = description @@ -2602,7 +2602,7 @@ private constructor( newBlockExpiryDate(JsonField.ofNullable(newBlockExpiryDate)) fun newBlockExpiryDate(newBlockExpiryDate: Optional) = - newBlockExpiryDate(newBlockExpiryDate.orElse(null)) + newBlockExpiryDate(newBlockExpiryDate.getOrNull()) fun newBlockExpiryDate(newBlockExpiryDate: JsonField) = apply { this.newBlockExpiryDate = newBlockExpiryDate @@ -2747,7 +2747,7 @@ private constructor( expiryDate(JsonField.ofNullable(expiryDate)) fun expiryDate(expiryDate: Optional) = - expiryDate(expiryDate.orElse(null)) + expiryDate(expiryDate.getOrNull()) fun expiryDate(expiryDate: JsonField) = apply { this.expiryDate = expiryDate @@ -2757,7 +2757,7 @@ private constructor( perUnitCostBasis(JsonField.ofNullable(perUnitCostBasis)) fun perUnitCostBasis(perUnitCostBasis: Optional) = - perUnitCostBasis(perUnitCostBasis.orElse(null)) + perUnitCostBasis(perUnitCostBasis.getOrNull()) fun perUnitCostBasis(perUnitCostBasis: JsonField) = apply { this.perUnitCostBasis = perUnitCostBasis @@ -2891,7 +2891,7 @@ private constructor( externalCustomerId(JsonField.ofNullable(externalCustomerId)) fun externalCustomerId(externalCustomerId: Optional) = - externalCustomerId(externalCustomerId.orElse(null)) + externalCustomerId(externalCustomerId.getOrNull()) fun externalCustomerId(externalCustomerId: JsonField) = apply { this.externalCustomerId = externalCustomerId @@ -3495,7 +3495,7 @@ private constructor( fun description(description: String?) = description(JsonField.ofNullable(description)) - fun description(description: Optional) = description(description.orElse(null)) + fun description(description: Optional) = description(description.getOrNull()) fun description(description: JsonField) = apply { this.description = description @@ -3676,7 +3676,7 @@ private constructor( expiryDate(JsonField.ofNullable(expiryDate)) fun expiryDate(expiryDate: Optional) = - expiryDate(expiryDate.orElse(null)) + expiryDate(expiryDate.getOrNull()) fun expiryDate(expiryDate: JsonField) = apply { this.expiryDate = expiryDate @@ -3686,7 +3686,7 @@ private constructor( perUnitCostBasis(JsonField.ofNullable(perUnitCostBasis)) fun perUnitCostBasis(perUnitCostBasis: Optional) = - perUnitCostBasis(perUnitCostBasis.orElse(null)) + perUnitCostBasis(perUnitCostBasis.getOrNull()) fun perUnitCostBasis(perUnitCostBasis: JsonField) = apply { this.perUnitCostBasis = perUnitCostBasis @@ -3820,7 +3820,7 @@ private constructor( externalCustomerId(JsonField.ofNullable(externalCustomerId)) fun externalCustomerId(externalCustomerId: Optional) = - externalCustomerId(externalCustomerId.orElse(null)) + externalCustomerId(externalCustomerId.getOrNull()) fun externalCustomerId(externalCustomerId: JsonField) = apply { this.externalCustomerId = externalCustomerId @@ -4449,7 +4449,7 @@ private constructor( fun description(description: String?) = description(JsonField.ofNullable(description)) - fun description(description: Optional) = description(description.orElse(null)) + fun description(description: Optional) = description(description.getOrNull()) fun description(description: JsonField) = apply { this.description = description @@ -4505,7 +4505,7 @@ private constructor( fun voidReason(voidReason: String?) = voidReason(JsonField.ofNullable(voidReason)) - fun voidReason(voidReason: Optional) = voidReason(voidReason.orElse(null)) + fun voidReason(voidReason: Optional) = voidReason(voidReason.getOrNull()) fun voidReason(voidReason: JsonField) = apply { this.voidReason = voidReason } @@ -4642,7 +4642,7 @@ private constructor( expiryDate(JsonField.ofNullable(expiryDate)) fun expiryDate(expiryDate: Optional) = - expiryDate(expiryDate.orElse(null)) + expiryDate(expiryDate.getOrNull()) fun expiryDate(expiryDate: JsonField) = apply { this.expiryDate = expiryDate @@ -4652,7 +4652,7 @@ private constructor( perUnitCostBasis(JsonField.ofNullable(perUnitCostBasis)) fun perUnitCostBasis(perUnitCostBasis: Optional) = - perUnitCostBasis(perUnitCostBasis.orElse(null)) + perUnitCostBasis(perUnitCostBasis.getOrNull()) fun perUnitCostBasis(perUnitCostBasis: JsonField) = apply { this.perUnitCostBasis = perUnitCostBasis @@ -4786,7 +4786,7 @@ private constructor( externalCustomerId(JsonField.ofNullable(externalCustomerId)) fun externalCustomerId(externalCustomerId: Optional) = - externalCustomerId(externalCustomerId.orElse(null)) + externalCustomerId(externalCustomerId.getOrNull()) fun externalCustomerId(externalCustomerId: JsonField) = apply { this.externalCustomerId = externalCustomerId @@ -5429,7 +5429,7 @@ private constructor( fun description(description: String?) = description(JsonField.ofNullable(description)) - fun description(description: Optional) = description(description.orElse(null)) + fun description(description: Optional) = description(description.getOrNull()) fun description(description: JsonField) = apply { this.description = description @@ -5492,7 +5492,7 @@ private constructor( fun voidReason(voidReason: String?) = voidReason(JsonField.ofNullable(voidReason)) - fun voidReason(voidReason: Optional) = voidReason(voidReason.orElse(null)) + fun voidReason(voidReason: Optional) = voidReason(voidReason.getOrNull()) fun voidReason(voidReason: JsonField) = apply { this.voidReason = voidReason } @@ -5630,7 +5630,7 @@ private constructor( expiryDate(JsonField.ofNullable(expiryDate)) fun expiryDate(expiryDate: Optional) = - expiryDate(expiryDate.orElse(null)) + expiryDate(expiryDate.getOrNull()) fun expiryDate(expiryDate: JsonField) = apply { this.expiryDate = expiryDate @@ -5640,7 +5640,7 @@ private constructor( perUnitCostBasis(JsonField.ofNullable(perUnitCostBasis)) fun perUnitCostBasis(perUnitCostBasis: Optional) = - perUnitCostBasis(perUnitCostBasis.orElse(null)) + perUnitCostBasis(perUnitCostBasis.getOrNull()) fun perUnitCostBasis(perUnitCostBasis: JsonField) = apply { this.perUnitCostBasis = perUnitCostBasis @@ -5774,7 +5774,7 @@ private constructor( externalCustomerId(JsonField.ofNullable(externalCustomerId)) fun externalCustomerId(externalCustomerId: Optional) = - externalCustomerId(externalCustomerId.orElse(null)) + externalCustomerId(externalCustomerId.getOrNull()) fun externalCustomerId(externalCustomerId: JsonField) = apply { this.externalCustomerId = externalCustomerId @@ -6376,7 +6376,7 @@ private constructor( fun description(description: String?) = description(JsonField.ofNullable(description)) - fun description(description: Optional) = description(description.orElse(null)) + fun description(description: Optional) = description(description.getOrNull()) fun description(description: JsonField) = apply { this.description = description @@ -6557,7 +6557,7 @@ private constructor( expiryDate(JsonField.ofNullable(expiryDate)) fun expiryDate(expiryDate: Optional) = - expiryDate(expiryDate.orElse(null)) + expiryDate(expiryDate.getOrNull()) fun expiryDate(expiryDate: JsonField) = apply { this.expiryDate = expiryDate @@ -6567,7 +6567,7 @@ private constructor( perUnitCostBasis(JsonField.ofNullable(perUnitCostBasis)) fun perUnitCostBasis(perUnitCostBasis: Optional) = - perUnitCostBasis(perUnitCostBasis.orElse(null)) + perUnitCostBasis(perUnitCostBasis.getOrNull()) fun perUnitCostBasis(perUnitCostBasis: JsonField) = apply { this.perUnitCostBasis = perUnitCostBasis @@ -6701,7 +6701,7 @@ private constructor( externalCustomerId(JsonField.ofNullable(externalCustomerId)) fun externalCustomerId(externalCustomerId: Optional) = - externalCustomerId(externalCustomerId.orElse(null)) + externalCustomerId(externalCustomerId.getOrNull()) fun externalCustomerId(externalCustomerId: JsonField) = apply { this.externalCustomerId = externalCustomerId diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditListByExternalIdPage.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditListByExternalIdPage.kt index 52458265..83acb306 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditListByExternalIdPage.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditListByExternalIdPage.kt @@ -18,6 +18,7 @@ import java.util.Objects import java.util.Optional import java.util.stream.Stream import java.util.stream.StreamSupport +import kotlin.jvm.optionals.getOrNull /** * Returns a paginated list of unexpired, non-zero credit blocks for a customer. @@ -203,7 +204,7 @@ private constructor( while (index < page.data().size) { yield(page.data()[index++]) } - page = page.getNextPage().orElse(null) ?: break + page = page.getNextPage().getOrNull() ?: break index = 0 } } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditListByExternalIdParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditListByExternalIdParams.kt index 005d44d4..bacb8b18 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditListByExternalIdParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditListByExternalIdParams.kt @@ -9,6 +9,7 @@ import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull /** * Returns a paginated list of unexpired, non-zero credit blocks for a customer. @@ -122,7 +123,7 @@ private constructor( fun currency(currency: String?) = apply { this.currency = currency } /** The ledger currency or custom pricing unit to use. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * Cursor for pagination. This can be populated by the `next_cursor` value returned from the @@ -134,7 +135,7 @@ private constructor( * Cursor for pagination. This can be populated by the `next_cursor` value returned from the * initial request. */ - fun cursor(cursor: Optional) = cursor(cursor.orElse(null)) + fun cursor(cursor: Optional) = cursor(cursor.getOrNull()) /** * If set to True, all expired and depleted blocks, as well as active block will be @@ -155,9 +156,8 @@ private constructor( * If set to True, all expired and depleted blocks, as well as active block will be * returned. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun includeAllBlocks(includeAllBlocks: Optional) = - includeAllBlocks(includeAllBlocks.orElse(null) as Boolean?) + includeAllBlocks(includeAllBlocks.getOrNull()) /** The number of items to fetch. Defaults to 20. */ fun limit(limit: Long?) = apply { this.limit = limit } @@ -166,8 +166,7 @@ private constructor( fun limit(limit: Long) = limit(limit as Long?) /** The number of items to fetch. Defaults to 20. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun limit(limit: Optional) = limit(limit.orElse(null) as Long?) + fun limit(limit: Optional) = limit(limit.getOrNull()) fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditListByExternalIdResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditListByExternalIdResponse.kt index a61d5cc0..18bf97d5 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditListByExternalIdResponse.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditListByExternalIdResponse.kt @@ -19,6 +19,7 @@ import com.withorb.api.errors.OrbInvalidDataException import java.time.OffsetDateTime import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull @NoAutoDetect class CustomerCreditListByExternalIdResponse @@ -168,7 +169,7 @@ private constructor( effectiveDate(JsonField.ofNullable(effectiveDate)) fun effectiveDate(effectiveDate: Optional) = - effectiveDate(effectiveDate.orElse(null)) + effectiveDate(effectiveDate.getOrNull()) fun effectiveDate(effectiveDate: JsonField) = apply { this.effectiveDate = effectiveDate @@ -176,7 +177,7 @@ private constructor( fun expiryDate(expiryDate: OffsetDateTime?) = expiryDate(JsonField.ofNullable(expiryDate)) - fun expiryDate(expiryDate: Optional) = expiryDate(expiryDate.orElse(null)) + fun expiryDate(expiryDate: Optional) = expiryDate(expiryDate.getOrNull()) fun expiryDate(expiryDate: JsonField) = apply { this.expiryDate = expiryDate @@ -188,9 +189,8 @@ private constructor( fun maximumInitialBalance(maximumInitialBalance: Double) = maximumInitialBalance(maximumInitialBalance as Double?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun maximumInitialBalance(maximumInitialBalance: Optional) = - maximumInitialBalance(maximumInitialBalance.orElse(null) as Double?) + maximumInitialBalance(maximumInitialBalance.getOrNull()) fun maximumInitialBalance(maximumInitialBalance: JsonField) = apply { this.maximumInitialBalance = maximumInitialBalance @@ -200,7 +200,7 @@ private constructor( perUnitCostBasis(JsonField.ofNullable(perUnitCostBasis)) fun perUnitCostBasis(perUnitCostBasis: Optional) = - perUnitCostBasis(perUnitCostBasis.orElse(null)) + perUnitCostBasis(perUnitCostBasis.getOrNull()) fun perUnitCostBasis(perUnitCostBasis: JsonField) = apply { this.perUnitCostBasis = perUnitCostBasis diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditListPage.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditListPage.kt index 85a5f6f6..5bbfcadd 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditListPage.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditListPage.kt @@ -18,6 +18,7 @@ import java.util.Objects import java.util.Optional import java.util.stream.Stream import java.util.stream.StreamSupport +import kotlin.jvm.optionals.getOrNull /** * Returns a paginated list of unexpired, non-zero credit blocks for a customer. @@ -197,7 +198,7 @@ private constructor( while (index < page.data().size) { yield(page.data()[index++]) } - page = page.getNextPage().orElse(null) ?: break + page = page.getNextPage().getOrNull() ?: break index = 0 } } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditListParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditListParams.kt index 5fdcf4c6..62a87cbc 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditListParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditListParams.kt @@ -9,6 +9,7 @@ import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull /** * Returns a paginated list of unexpired, non-zero credit blocks for a customer. @@ -116,7 +117,7 @@ private constructor( fun currency(currency: String?) = apply { this.currency = currency } /** The ledger currency or custom pricing unit to use. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * Cursor for pagination. This can be populated by the `next_cursor` value returned from the @@ -128,7 +129,7 @@ private constructor( * Cursor for pagination. This can be populated by the `next_cursor` value returned from the * initial request. */ - fun cursor(cursor: Optional) = cursor(cursor.orElse(null)) + fun cursor(cursor: Optional) = cursor(cursor.getOrNull()) /** * If set to True, all expired and depleted blocks, as well as active block will be @@ -149,9 +150,8 @@ private constructor( * If set to True, all expired and depleted blocks, as well as active block will be * returned. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun includeAllBlocks(includeAllBlocks: Optional) = - includeAllBlocks(includeAllBlocks.orElse(null) as Boolean?) + includeAllBlocks(includeAllBlocks.getOrNull()) /** The number of items to fetch. Defaults to 20. */ fun limit(limit: Long?) = apply { this.limit = limit } @@ -160,8 +160,7 @@ private constructor( fun limit(limit: Long) = limit(limit as Long?) /** The number of items to fetch. Defaults to 20. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun limit(limit: Optional) = limit(limit.orElse(null) as Long?) + fun limit(limit: Optional) = limit(limit.getOrNull()) fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditListResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditListResponse.kt index fad8f1cf..be9833ba 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditListResponse.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditListResponse.kt @@ -19,6 +19,7 @@ import com.withorb.api.errors.OrbInvalidDataException import java.time.OffsetDateTime import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull @NoAutoDetect class CustomerCreditListResponse @@ -164,7 +165,7 @@ private constructor( effectiveDate(JsonField.ofNullable(effectiveDate)) fun effectiveDate(effectiveDate: Optional) = - effectiveDate(effectiveDate.orElse(null)) + effectiveDate(effectiveDate.getOrNull()) fun effectiveDate(effectiveDate: JsonField) = apply { this.effectiveDate = effectiveDate @@ -172,7 +173,7 @@ private constructor( fun expiryDate(expiryDate: OffsetDateTime?) = expiryDate(JsonField.ofNullable(expiryDate)) - fun expiryDate(expiryDate: Optional) = expiryDate(expiryDate.orElse(null)) + fun expiryDate(expiryDate: Optional) = expiryDate(expiryDate.getOrNull()) fun expiryDate(expiryDate: JsonField) = apply { this.expiryDate = expiryDate @@ -184,9 +185,8 @@ private constructor( fun maximumInitialBalance(maximumInitialBalance: Double) = maximumInitialBalance(maximumInitialBalance as Double?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun maximumInitialBalance(maximumInitialBalance: Optional) = - maximumInitialBalance(maximumInitialBalance.orElse(null) as Double?) + maximumInitialBalance(maximumInitialBalance.getOrNull()) fun maximumInitialBalance(maximumInitialBalance: JsonField) = apply { this.maximumInitialBalance = maximumInitialBalance @@ -196,7 +196,7 @@ private constructor( perUnitCostBasis(JsonField.ofNullable(perUnitCostBasis)) fun perUnitCostBasis(perUnitCostBasis: Optional) = - perUnitCostBasis(perUnitCostBasis.orElse(null)) + perUnitCostBasis(perUnitCostBasis.getOrNull()) fun perUnitCostBasis(perUnitCostBasis: JsonField) = apply { this.perUnitCostBasis = perUnitCostBasis diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditTopUpCreateByExternalIdParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditTopUpCreateByExternalIdParams.kt index ebaf1de1..847e42dd 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditTopUpCreateByExternalIdParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditTopUpCreateByExternalIdParams.kt @@ -22,6 +22,7 @@ import com.withorb.api.errors.OrbInvalidDataException import java.time.OffsetDateTime import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull /** * This endpoint allows you to create a new top-up for a specified customer's balance. While this @@ -374,7 +375,7 @@ private constructor( * immediately. */ fun activeFrom(activeFrom: Optional) = - activeFrom(activeFrom.orElse(null)) + activeFrom(activeFrom.getOrNull()) /** * The date from which the top-up is active. If unspecified, the top-up is active @@ -400,9 +401,7 @@ private constructor( * The number of days or months after which the top-up expires. If unspecified, it does * not expire. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun expiresAfter(expiresAfter: Optional) = - expiresAfter(expiresAfter.orElse(null) as Long?) + fun expiresAfter(expiresAfter: Optional) = expiresAfter(expiresAfter.getOrNull()) /** * The number of days or months after which the top-up expires. If unspecified, it does @@ -418,7 +417,7 @@ private constructor( /** The unit of expires_after. */ fun expiresAfterUnit(expiresAfterUnit: Optional) = - expiresAfterUnit(expiresAfterUnit.orElse(null)) + expiresAfterUnit(expiresAfterUnit.getOrNull()) /** The unit of expires_after. */ fun expiresAfterUnit(expiresAfterUnit: JsonField) = apply { @@ -582,7 +581,7 @@ private constructor( * The date from which the top-up is active. If unspecified, the top-up is active * immediately. */ - fun activeFrom(activeFrom: Optional) = activeFrom(activeFrom.orElse(null)) + fun activeFrom(activeFrom: Optional) = activeFrom(activeFrom.getOrNull()) /** * The date from which the top-up is active. If unspecified, the top-up is active @@ -608,9 +607,7 @@ private constructor( * The number of days or months after which the top-up expires. If unspecified, it does not * expire. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun expiresAfter(expiresAfter: Optional) = - expiresAfter(expiresAfter.orElse(null) as Long?) + fun expiresAfter(expiresAfter: Optional) = expiresAfter(expiresAfter.getOrNull()) /** * The number of days or months after which the top-up expires. If unspecified, it does not @@ -625,7 +622,7 @@ private constructor( /** The unit of expires_after. */ fun expiresAfterUnit(expiresAfterUnit: Optional) = - expiresAfterUnit(expiresAfterUnit.orElse(null)) + expiresAfterUnit(expiresAfterUnit.getOrNull()) /** The unit of expires_after. */ fun expiresAfterUnit(expiresAfterUnit: JsonField) = apply { @@ -909,7 +906,7 @@ private constructor( fun memo(memo: String?) = memo(JsonField.ofNullable(memo)) /** An optional memo to display on the invoice. */ - fun memo(memo: Optional) = memo(memo.orElse(null)) + fun memo(memo: Optional) = memo(memo.getOrNull()) /** An optional memo to display on the invoice. */ fun memo(memo: JsonField) = apply { this.memo = memo } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditTopUpCreateByExternalIdResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditTopUpCreateByExternalIdResponse.kt index e3338e1d..02278748 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditTopUpCreateByExternalIdResponse.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditTopUpCreateByExternalIdResponse.kt @@ -18,6 +18,7 @@ import com.withorb.api.core.toImmutable import com.withorb.api.errors.OrbInvalidDataException import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull @NoAutoDetect class CustomerCreditTopUpCreateByExternalIdResponse @@ -263,9 +264,7 @@ private constructor( * The number of days or months after which the top-up expires. If unspecified, it does not * expire. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun expiresAfter(expiresAfter: Optional) = - expiresAfter(expiresAfter.orElse(null) as Long?) + fun expiresAfter(expiresAfter: Optional) = expiresAfter(expiresAfter.getOrNull()) /** * The number of days or months after which the top-up expires. If unspecified, it does not @@ -279,7 +278,7 @@ private constructor( /** The unit of expires_after. */ fun expiresAfterUnit(expiresAfterUnit: Optional) = - expiresAfterUnit(expiresAfterUnit.orElse(null)) + expiresAfterUnit(expiresAfterUnit.getOrNull()) /** The unit of expires_after. */ fun expiresAfterUnit(expiresAfterUnit: JsonField) = apply { @@ -470,7 +469,7 @@ private constructor( fun memo(memo: String?) = memo(JsonField.ofNullable(memo)) /** An optional memo to display on the invoice. */ - fun memo(memo: Optional) = memo(memo.orElse(null)) + fun memo(memo: Optional) = memo(memo.getOrNull()) /** An optional memo to display on the invoice. */ fun memo(memo: JsonField) = apply { this.memo = memo } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditTopUpCreateParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditTopUpCreateParams.kt index 70a0445a..520a074c 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditTopUpCreateParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditTopUpCreateParams.kt @@ -22,6 +22,7 @@ import com.withorb.api.errors.OrbInvalidDataException import java.time.OffsetDateTime import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull /** * This endpoint allows you to create a new top-up for a specified customer's balance. While this @@ -374,7 +375,7 @@ private constructor( * immediately. */ fun activeFrom(activeFrom: Optional) = - activeFrom(activeFrom.orElse(null)) + activeFrom(activeFrom.getOrNull()) /** * The date from which the top-up is active. If unspecified, the top-up is active @@ -400,9 +401,7 @@ private constructor( * The number of days or months after which the top-up expires. If unspecified, it does * not expire. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun expiresAfter(expiresAfter: Optional) = - expiresAfter(expiresAfter.orElse(null) as Long?) + fun expiresAfter(expiresAfter: Optional) = expiresAfter(expiresAfter.getOrNull()) /** * The number of days or months after which the top-up expires. If unspecified, it does @@ -418,7 +417,7 @@ private constructor( /** The unit of expires_after. */ fun expiresAfterUnit(expiresAfterUnit: Optional) = - expiresAfterUnit(expiresAfterUnit.orElse(null)) + expiresAfterUnit(expiresAfterUnit.getOrNull()) /** The unit of expires_after. */ fun expiresAfterUnit(expiresAfterUnit: JsonField) = apply { @@ -578,7 +577,7 @@ private constructor( * The date from which the top-up is active. If unspecified, the top-up is active * immediately. */ - fun activeFrom(activeFrom: Optional) = activeFrom(activeFrom.orElse(null)) + fun activeFrom(activeFrom: Optional) = activeFrom(activeFrom.getOrNull()) /** * The date from which the top-up is active. If unspecified, the top-up is active @@ -604,9 +603,7 @@ private constructor( * The number of days or months after which the top-up expires. If unspecified, it does not * expire. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun expiresAfter(expiresAfter: Optional) = - expiresAfter(expiresAfter.orElse(null) as Long?) + fun expiresAfter(expiresAfter: Optional) = expiresAfter(expiresAfter.getOrNull()) /** * The number of days or months after which the top-up expires. If unspecified, it does not @@ -621,7 +618,7 @@ private constructor( /** The unit of expires_after. */ fun expiresAfterUnit(expiresAfterUnit: Optional) = - expiresAfterUnit(expiresAfterUnit.orElse(null)) + expiresAfterUnit(expiresAfterUnit.getOrNull()) /** The unit of expires_after. */ fun expiresAfterUnit(expiresAfterUnit: JsonField) = apply { @@ -905,7 +902,7 @@ private constructor( fun memo(memo: String?) = memo(JsonField.ofNullable(memo)) /** An optional memo to display on the invoice. */ - fun memo(memo: Optional) = memo(memo.orElse(null)) + fun memo(memo: Optional) = memo(memo.getOrNull()) /** An optional memo to display on the invoice. */ fun memo(memo: JsonField) = apply { this.memo = memo } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditTopUpCreateResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditTopUpCreateResponse.kt index cdb83ca4..160a10d4 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditTopUpCreateResponse.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditTopUpCreateResponse.kt @@ -18,6 +18,7 @@ import com.withorb.api.core.toImmutable import com.withorb.api.errors.OrbInvalidDataException import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull @NoAutoDetect class CustomerCreditTopUpCreateResponse @@ -261,9 +262,7 @@ private constructor( * The number of days or months after which the top-up expires. If unspecified, it does not * expire. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun expiresAfter(expiresAfter: Optional) = - expiresAfter(expiresAfter.orElse(null) as Long?) + fun expiresAfter(expiresAfter: Optional) = expiresAfter(expiresAfter.getOrNull()) /** * The number of days or months after which the top-up expires. If unspecified, it does not @@ -277,7 +276,7 @@ private constructor( /** The unit of expires_after. */ fun expiresAfterUnit(expiresAfterUnit: Optional) = - expiresAfterUnit(expiresAfterUnit.orElse(null)) + expiresAfterUnit(expiresAfterUnit.getOrNull()) /** The unit of expires_after. */ fun expiresAfterUnit(expiresAfterUnit: JsonField) = apply { @@ -468,7 +467,7 @@ private constructor( fun memo(memo: String?) = memo(JsonField.ofNullable(memo)) /** An optional memo to display on the invoice. */ - fun memo(memo: Optional) = memo(memo.orElse(null)) + fun memo(memo: Optional) = memo(memo.getOrNull()) /** An optional memo to display on the invoice. */ fun memo(memo: JsonField) = apply { this.memo = memo } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditTopUpListByExternalIdPage.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditTopUpListByExternalIdPage.kt index 00e683b0..e8b29560 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditTopUpListByExternalIdPage.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditTopUpListByExternalIdPage.kt @@ -18,6 +18,7 @@ import java.util.Objects import java.util.Optional import java.util.stream.Stream import java.util.stream.StreamSupport +import kotlin.jvm.optionals.getOrNull /** List top-ups by external ID */ class CustomerCreditTopUpListByExternalIdPage @@ -196,7 +197,7 @@ private constructor( while (index < page.data().size) { yield(page.data()[index++]) } - page = page.getNextPage().orElse(null) ?: break + page = page.getNextPage().getOrNull() ?: break index = 0 } } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditTopUpListByExternalIdParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditTopUpListByExternalIdParams.kt index 0720aa51..042c98d2 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditTopUpListByExternalIdParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditTopUpListByExternalIdParams.kt @@ -9,6 +9,7 @@ import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull /** List top-ups by external ID */ class CustomerCreditTopUpListByExternalIdParams @@ -105,7 +106,7 @@ private constructor( * Cursor for pagination. This can be populated by the `next_cursor` value returned from the * initial request. */ - fun cursor(cursor: Optional) = cursor(cursor.orElse(null)) + fun cursor(cursor: Optional) = cursor(cursor.getOrNull()) /** The number of items to fetch. Defaults to 20. */ fun limit(limit: Long?) = apply { this.limit = limit } @@ -114,8 +115,7 @@ private constructor( fun limit(limit: Long) = limit(limit as Long?) /** The number of items to fetch. Defaults to 20. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun limit(limit: Optional) = limit(limit.orElse(null) as Long?) + fun limit(limit: Optional) = limit(limit.getOrNull()) fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditTopUpListByExternalIdResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditTopUpListByExternalIdResponse.kt index 60227c88..32ec485d 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditTopUpListByExternalIdResponse.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditTopUpListByExternalIdResponse.kt @@ -18,6 +18,7 @@ import com.withorb.api.core.toImmutable import com.withorb.api.errors.OrbInvalidDataException import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull @NoAutoDetect class CustomerCreditTopUpListByExternalIdResponse @@ -262,9 +263,7 @@ private constructor( * The number of days or months after which the top-up expires. If unspecified, it does not * expire. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun expiresAfter(expiresAfter: Optional) = - expiresAfter(expiresAfter.orElse(null) as Long?) + fun expiresAfter(expiresAfter: Optional) = expiresAfter(expiresAfter.getOrNull()) /** * The number of days or months after which the top-up expires. If unspecified, it does not @@ -278,7 +277,7 @@ private constructor( /** The unit of expires_after. */ fun expiresAfterUnit(expiresAfterUnit: Optional) = - expiresAfterUnit(expiresAfterUnit.orElse(null)) + expiresAfterUnit(expiresAfterUnit.getOrNull()) /** The unit of expires_after. */ fun expiresAfterUnit(expiresAfterUnit: JsonField) = apply { @@ -469,7 +468,7 @@ private constructor( fun memo(memo: String?) = memo(JsonField.ofNullable(memo)) /** An optional memo to display on the invoice. */ - fun memo(memo: Optional) = memo(memo.orElse(null)) + fun memo(memo: Optional) = memo(memo.getOrNull()) /** An optional memo to display on the invoice. */ fun memo(memo: JsonField) = apply { this.memo = memo } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditTopUpListPage.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditTopUpListPage.kt index 70d93307..6283dc73 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditTopUpListPage.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditTopUpListPage.kt @@ -18,6 +18,7 @@ import java.util.Objects import java.util.Optional import java.util.stream.Stream import java.util.stream.StreamSupport +import kotlin.jvm.optionals.getOrNull /** List top-ups */ class CustomerCreditTopUpListPage @@ -192,7 +193,7 @@ private constructor( while (index < page.data().size) { yield(page.data()[index++]) } - page = page.getNextPage().orElse(null) ?: break + page = page.getNextPage().getOrNull() ?: break index = 0 } } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditTopUpListParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditTopUpListParams.kt index a5eeba03..5b082e60 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditTopUpListParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditTopUpListParams.kt @@ -9,6 +9,7 @@ import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull /** List top-ups */ class CustomerCreditTopUpListParams @@ -99,7 +100,7 @@ private constructor( * Cursor for pagination. This can be populated by the `next_cursor` value returned from the * initial request. */ - fun cursor(cursor: Optional) = cursor(cursor.orElse(null)) + fun cursor(cursor: Optional) = cursor(cursor.getOrNull()) /** The number of items to fetch. Defaults to 20. */ fun limit(limit: Long?) = apply { this.limit = limit } @@ -108,8 +109,7 @@ private constructor( fun limit(limit: Long) = limit(limit as Long?) /** The number of items to fetch. Defaults to 20. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun limit(limit: Optional) = limit(limit.orElse(null) as Long?) + fun limit(limit: Optional) = limit(limit.getOrNull()) fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditTopUpListResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditTopUpListResponse.kt index 7222b1ac..87187d24 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditTopUpListResponse.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditTopUpListResponse.kt @@ -18,6 +18,7 @@ import com.withorb.api.core.toImmutable import com.withorb.api.errors.OrbInvalidDataException import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull @NoAutoDetect class CustomerCreditTopUpListResponse @@ -261,9 +262,7 @@ private constructor( * The number of days or months after which the top-up expires. If unspecified, it does not * expire. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun expiresAfter(expiresAfter: Optional) = - expiresAfter(expiresAfter.orElse(null) as Long?) + fun expiresAfter(expiresAfter: Optional) = expiresAfter(expiresAfter.getOrNull()) /** * The number of days or months after which the top-up expires. If unspecified, it does not @@ -277,7 +276,7 @@ private constructor( /** The unit of expires_after. */ fun expiresAfterUnit(expiresAfterUnit: Optional) = - expiresAfterUnit(expiresAfterUnit.orElse(null)) + expiresAfterUnit(expiresAfterUnit.getOrNull()) /** The unit of expires_after. */ fun expiresAfterUnit(expiresAfterUnit: JsonField) = apply { @@ -468,7 +467,7 @@ private constructor( fun memo(memo: String?) = memo(JsonField.ofNullable(memo)) /** An optional memo to display on the invoice. */ - fun memo(memo: Optional) = memo(memo.orElse(null)) + fun memo(memo: Optional) = memo(memo.getOrNull()) /** An optional memo to display on the invoice. */ fun memo(memo: JsonField) = apply { this.memo = memo } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerListPage.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerListPage.kt index f691e1cc..45174e1b 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerListPage.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerListPage.kt @@ -18,6 +18,7 @@ import java.util.Objects import java.util.Optional import java.util.stream.Stream import java.util.stream.StreamSupport +import kotlin.jvm.optionals.getOrNull /** * This endpoint returns a list of all customers for an account. The list of customers is ordered @@ -187,7 +188,7 @@ private constructor( while (index < page.data().size) { yield(page.data()[index++]) } - page = page.getNextPage().orElse(null) ?: break + page = page.getNextPage().getOrNull() ?: break index = 0 } } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerListParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerListParams.kt index a0982c7b..31b85075 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerListParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerListParams.kt @@ -10,6 +10,7 @@ import java.time.OffsetDateTime import java.time.format.DateTimeFormatter import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull /** * This endpoint returns a list of all customers for an account. The list of customers is ordered @@ -123,22 +124,22 @@ private constructor( fun createdAtGt(createdAtGt: OffsetDateTime?) = apply { this.createdAtGt = createdAtGt } fun createdAtGt(createdAtGt: Optional) = - createdAtGt(createdAtGt.orElse(null)) + createdAtGt(createdAtGt.getOrNull()) fun createdAtGte(createdAtGte: OffsetDateTime?) = apply { this.createdAtGte = createdAtGte } fun createdAtGte(createdAtGte: Optional) = - createdAtGte(createdAtGte.orElse(null)) + createdAtGte(createdAtGte.getOrNull()) fun createdAtLt(createdAtLt: OffsetDateTime?) = apply { this.createdAtLt = createdAtLt } fun createdAtLt(createdAtLt: Optional) = - createdAtLt(createdAtLt.orElse(null)) + createdAtLt(createdAtLt.getOrNull()) fun createdAtLte(createdAtLte: OffsetDateTime?) = apply { this.createdAtLte = createdAtLte } fun createdAtLte(createdAtLte: Optional) = - createdAtLte(createdAtLte.orElse(null)) + createdAtLte(createdAtLte.getOrNull()) /** * Cursor for pagination. This can be populated by the `next_cursor` value returned from the @@ -150,7 +151,7 @@ private constructor( * Cursor for pagination. This can be populated by the `next_cursor` value returned from the * initial request. */ - fun cursor(cursor: Optional) = cursor(cursor.orElse(null)) + fun cursor(cursor: Optional) = cursor(cursor.getOrNull()) /** The number of items to fetch. Defaults to 20. */ fun limit(limit: Long?) = apply { this.limit = limit } @@ -159,8 +160,7 @@ private constructor( fun limit(limit: Long) = limit(limit as Long?) /** The number of items to fetch. Defaults to 20. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun limit(limit: Optional) = limit(limit.orElse(null) as Long?) + fun limit(limit: Optional) = limit(limit.getOrNull()) fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerUpdateByExternalIdParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerUpdateByExternalIdParams.kt index f2a0b4eb..606729cd 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerUpdateByExternalIdParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerUpdateByExternalIdParams.kt @@ -964,7 +964,7 @@ private constructor( fun accountingSyncConfiguration( accountingSyncConfiguration: Optional - ) = accountingSyncConfiguration(accountingSyncConfiguration.orElse(null)) + ) = accountingSyncConfiguration(accountingSyncConfiguration.getOrNull()) fun accountingSyncConfiguration( accountingSyncConfiguration: JsonField @@ -982,7 +982,7 @@ private constructor( * will be CC'd for customer communications. */ fun additionalEmails(additionalEmails: Optional>) = - additionalEmails(additionalEmails.orElse(null)) + additionalEmails(additionalEmails.getOrNull()) /** * Additional email addresses for this customer. If populated, these email addresses @@ -1023,9 +1023,8 @@ private constructor( * a saved payment method, if available. This parameter defaults to `True` when a * payment provider is provided on customer creation. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun autoCollection(autoCollection: Optional) = - autoCollection(autoCollection.orElse(null) as Boolean?) + autoCollection(autoCollection.getOrNull()) /** * Used to determine if invoices for this customer will automatically attempt to charge @@ -1040,7 +1039,7 @@ private constructor( billingAddress(JsonField.ofNullable(billingAddress)) fun billingAddress(billingAddress: Optional) = - billingAddress(billingAddress.orElse(null)) + billingAddress(billingAddress.getOrNull()) fun billingAddress(billingAddress: JsonField) = apply { this.billingAddress = billingAddress @@ -1056,7 +1055,7 @@ private constructor( * An ISO 4217 currency string used for the customer's invoices and balance. If not set * at creation time, will be set at subscription creation time. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string used for the customer's invoices and balance. If not set @@ -1068,7 +1067,7 @@ private constructor( fun email(email: String?) = email(JsonField.ofNullable(email)) /** A valid customer email, to be used for invoicing and notifications. */ - fun email(email: Optional) = email(email.orElse(null)) + fun email(email: Optional) = email(email.getOrNull()) /** A valid customer email, to be used for invoicing and notifications. */ fun email(email: JsonField) = apply { this.email = email } @@ -1078,9 +1077,8 @@ private constructor( fun emailDelivery(emailDelivery: Boolean) = emailDelivery(emailDelivery as Boolean?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun emailDelivery(emailDelivery: Optional) = - emailDelivery(emailDelivery.orElse(null) as Boolean?) + emailDelivery(emailDelivery.getOrNull()) fun emailDelivery(emailDelivery: JsonField) = apply { this.emailDelivery = emailDelivery @@ -1098,7 +1096,7 @@ private constructor( * or current subscriptions. */ fun externalCustomerId(externalCustomerId: Optional) = - externalCustomerId(externalCustomerId.orElse(null)) + externalCustomerId(externalCustomerId.getOrNull()) /** * The external customer ID. This can only be set if empty and the customer has no past @@ -1112,7 +1110,7 @@ private constructor( fun hierarchy(hierarchy: Hierarchy?) = hierarchy(JsonField.ofNullable(hierarchy)) /** The hierarchical relationships for this customer. */ - fun hierarchy(hierarchy: Optional) = hierarchy(hierarchy.orElse(null)) + fun hierarchy(hierarchy: Optional) = hierarchy(hierarchy.getOrNull()) /** The hierarchical relationships for this customer. */ fun hierarchy(hierarchy: JsonField) = apply { this.hierarchy = hierarchy } @@ -1129,7 +1127,7 @@ private constructor( * setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed by @@ -1142,7 +1140,7 @@ private constructor( fun name(name: String?) = name(JsonField.ofNullable(name)) /** The full name of the customer */ - fun name(name: Optional) = name(name.orElse(null)) + fun name(name: Optional) = name(name.getOrNull()) /** The full name of the customer */ fun name(name: JsonField) = apply { this.name = name } @@ -1167,7 +1165,7 @@ private constructor( * team. */ fun paymentProvider(paymentProvider: Optional) = - paymentProvider(paymentProvider.orElse(null)) + paymentProvider(paymentProvider.getOrNull()) /** * This is used for creating charges or invoices in an external system via Orb. When not @@ -1193,7 +1191,7 @@ private constructor( * used for creating charges or invoices in the external system via Orb. */ fun paymentProviderId(paymentProviderId: Optional) = - paymentProviderId(paymentProviderId.orElse(null)) + paymentProviderId(paymentProviderId.getOrNull()) /** * The ID of this customer in an external payments solution, such as Stripe. This is @@ -1207,7 +1205,7 @@ private constructor( reportingConfiguration(JsonField.ofNullable(reportingConfiguration)) fun reportingConfiguration(reportingConfiguration: Optional) = - reportingConfiguration(reportingConfiguration.orElse(null)) + reportingConfiguration(reportingConfiguration.getOrNull()) fun reportingConfiguration(reportingConfiguration: JsonField) = apply { @@ -1218,7 +1216,7 @@ private constructor( shippingAddress(JsonField.ofNullable(shippingAddress)) fun shippingAddress(shippingAddress: Optional) = - shippingAddress(shippingAddress.orElse(null)) + shippingAddress(shippingAddress.getOrNull()) fun shippingAddress(shippingAddress: JsonField) = apply { this.shippingAddress = shippingAddress @@ -1228,7 +1226,7 @@ private constructor( taxConfiguration(JsonField.ofNullable(taxConfiguration)) fun taxConfiguration(taxConfiguration: Optional) = - taxConfiguration(taxConfiguration.orElse(null)) + taxConfiguration(taxConfiguration.getOrNull()) fun taxConfiguration(taxConfiguration: JsonField) = apply { this.taxConfiguration = taxConfiguration @@ -1479,7 +1477,7 @@ private constructor( * |Venezuela |`ve_rif` |Venezuelan RIF Number | * |Vietnam |`vn_tin` |Vietnamese Tax ID Number | */ - fun taxId(taxId: Optional) = taxId(taxId.orElse(null)) + fun taxId(taxId: Optional) = taxId(taxId.getOrNull()) /** * Tax IDs are commonly required to be displayed on customer invoices, which are added @@ -1693,7 +1691,7 @@ private constructor( fun accountingSyncConfiguration( accountingSyncConfiguration: Optional - ) = accountingSyncConfiguration(accountingSyncConfiguration.orElse(null)) + ) = accountingSyncConfiguration(accountingSyncConfiguration.getOrNull()) fun accountingSyncConfiguration( accountingSyncConfiguration: JsonField @@ -1712,7 +1710,7 @@ private constructor( * CC'd for customer communications. */ fun additionalEmails(additionalEmails: Optional>) = - additionalEmails(additionalEmails.orElse(null)) + additionalEmails(additionalEmails.getOrNull()) /** * Additional email addresses for this customer. If populated, these email addresses will be @@ -1749,9 +1747,8 @@ private constructor( * saved payment method, if available. This parameter defaults to `True` when a payment * provider is provided on customer creation. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun autoCollection(autoCollection: Optional) = - autoCollection(autoCollection.orElse(null) as Boolean?) + autoCollection(autoCollection.getOrNull()) /** * Used to determine if invoices for this customer will automatically attempt to charge a @@ -1767,7 +1764,7 @@ private constructor( } fun billingAddress(billingAddress: Optional) = - billingAddress(billingAddress.orElse(null)) + billingAddress(billingAddress.getOrNull()) fun billingAddress(billingAddress: JsonField) = apply { body.billingAddress(billingAddress) @@ -1783,7 +1780,7 @@ private constructor( * An ISO 4217 currency string used for the customer's invoices and balance. If not set at * creation time, will be set at subscription creation time. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string used for the customer's invoices and balance. If not set at @@ -1795,7 +1792,7 @@ private constructor( fun email(email: String?) = apply { body.email(email) } /** A valid customer email, to be used for invoicing and notifications. */ - fun email(email: Optional) = email(email.orElse(null)) + fun email(email: Optional) = email(email.getOrNull()) /** A valid customer email, to be used for invoicing and notifications. */ fun email(email: JsonField) = apply { body.email(email) } @@ -1804,9 +1801,8 @@ private constructor( fun emailDelivery(emailDelivery: Boolean) = emailDelivery(emailDelivery as Boolean?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun emailDelivery(emailDelivery: Optional) = - emailDelivery(emailDelivery.orElse(null) as Boolean?) + emailDelivery(emailDelivery.getOrNull()) fun emailDelivery(emailDelivery: JsonField) = apply { body.emailDelivery(emailDelivery) @@ -1825,7 +1821,7 @@ private constructor( * current subscriptions. */ fun externalCustomerId(externalCustomerId: Optional) = - externalCustomerId(externalCustomerId.orElse(null)) + externalCustomerId(externalCustomerId.getOrNull()) /** * The external customer ID. This can only be set if empty and the customer has no past or @@ -1839,7 +1835,7 @@ private constructor( fun hierarchy(hierarchy: Hierarchy?) = apply { body.hierarchy(hierarchy) } /** The hierarchical relationships for this customer. */ - fun hierarchy(hierarchy: Optional) = hierarchy(hierarchy.orElse(null)) + fun hierarchy(hierarchy: Optional) = hierarchy(hierarchy.getOrNull()) /** The hierarchical relationships for this customer. */ fun hierarchy(hierarchy: JsonField) = apply { body.hierarchy(hierarchy) } @@ -1856,7 +1852,7 @@ private constructor( * setting the value to `null`, and the entire metadata mapping can be cleared by setting * `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed by @@ -1869,7 +1865,7 @@ private constructor( fun name(name: String?) = apply { body.name(name) } /** The full name of the customer */ - fun name(name: Optional) = name(name.orElse(null)) + fun name(name: Optional) = name(name.getOrNull()) /** The full name of the customer */ fun name(name: JsonField) = apply { body.name(name) } @@ -1893,7 +1889,7 @@ private constructor( * `netsuite`), any product mappings must first be configured with the Orb team. */ fun paymentProvider(paymentProvider: Optional) = - paymentProvider(paymentProvider.orElse(null)) + paymentProvider(paymentProvider.getOrNull()) /** * This is used for creating charges or invoices in an external system via Orb. When not in @@ -1919,7 +1915,7 @@ private constructor( * for creating charges or invoices in the external system via Orb. */ fun paymentProviderId(paymentProviderId: Optional) = - paymentProviderId(paymentProviderId.orElse(null)) + paymentProviderId(paymentProviderId.getOrNull()) /** * The ID of this customer in an external payments solution, such as Stripe. This is used @@ -1934,7 +1930,7 @@ private constructor( } fun reportingConfiguration(reportingConfiguration: Optional) = - reportingConfiguration(reportingConfiguration.orElse(null)) + reportingConfiguration(reportingConfiguration.getOrNull()) fun reportingConfiguration(reportingConfiguration: JsonField) = apply { @@ -1946,7 +1942,7 @@ private constructor( } fun shippingAddress(shippingAddress: Optional) = - shippingAddress(shippingAddress.orElse(null)) + shippingAddress(shippingAddress.getOrNull()) fun shippingAddress(shippingAddress: JsonField) = apply { body.shippingAddress(shippingAddress) @@ -1957,7 +1953,7 @@ private constructor( } fun taxConfiguration(taxConfiguration: Optional) = - taxConfiguration(taxConfiguration.orElse(null)) + taxConfiguration(taxConfiguration.getOrNull()) fun taxConfiguration(taxConfiguration: JsonField) = apply { body.taxConfiguration(taxConfiguration) @@ -2193,7 +2189,7 @@ private constructor( * |Venezuela |`ve_rif` |Venezuelan RIF Number | * |Vietnam |`vn_tin` |Vietnamese Tax ID Number | */ - fun taxId(taxId: Optional) = taxId(taxId.orElse(null)) + fun taxId(taxId: Optional) = taxId(taxId.getOrNull()) /** * Tax IDs are commonly required to be displayed on customer invoices, which are added to @@ -2501,7 +2497,7 @@ private constructor( accountingProviders(JsonField.ofNullable(accountingProviders)) fun accountingProviders(accountingProviders: Optional>) = - accountingProviders(accountingProviders.orElse(null)) + accountingProviders(accountingProviders.getOrNull()) fun accountingProviders(accountingProviders: JsonField>) = apply { @@ -2519,8 +2515,7 @@ private constructor( fun excluded(excluded: Boolean) = excluded(excluded as Boolean?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun excluded(excluded: Optional) = excluded(excluded.orElse(null) as Boolean?) + fun excluded(excluded: Optional) = excluded(excluded.getOrNull()) fun excluded(excluded: JsonField) = apply { this.excluded = excluded } @@ -2808,37 +2803,37 @@ private constructor( fun city(city: String?) = city(JsonField.ofNullable(city)) - fun city(city: Optional) = city(city.orElse(null)) + fun city(city: Optional) = city(city.getOrNull()) fun city(city: JsonField) = apply { this.city = city } fun country(country: String?) = country(JsonField.ofNullable(country)) - fun country(country: Optional) = country(country.orElse(null)) + fun country(country: Optional) = country(country.getOrNull()) fun country(country: JsonField) = apply { this.country = country } fun line1(line1: String?) = line1(JsonField.ofNullable(line1)) - fun line1(line1: Optional) = line1(line1.orElse(null)) + fun line1(line1: Optional) = line1(line1.getOrNull()) fun line1(line1: JsonField) = apply { this.line1 = line1 } fun line2(line2: String?) = line2(JsonField.ofNullable(line2)) - fun line2(line2: Optional) = line2(line2.orElse(null)) + fun line2(line2: Optional) = line2(line2.getOrNull()) fun line2(line2: JsonField) = apply { this.line2 = line2 } fun postalCode(postalCode: String?) = postalCode(JsonField.ofNullable(postalCode)) - fun postalCode(postalCode: Optional) = postalCode(postalCode.orElse(null)) + fun postalCode(postalCode: Optional) = postalCode(postalCode.getOrNull()) fun postalCode(postalCode: JsonField) = apply { this.postalCode = postalCode } fun state(state: String?) = state(JsonField.ofNullable(state)) - fun state(state: Optional) = state(state.orElse(null)) + fun state(state: Optional) = state(state.getOrNull()) fun state(state: JsonField) = apply { this.state = state } @@ -3012,7 +3007,7 @@ private constructor( * be a child of another customer. */ fun parentCustomerId(parentCustomerId: Optional) = - parentCustomerId(parentCustomerId.orElse(null)) + parentCustomerId(parentCustomerId.getOrNull()) /** * The ID of the parent customer in the hierarchy. The desired parent customer must not @@ -3487,37 +3482,37 @@ private constructor( fun city(city: String?) = city(JsonField.ofNullable(city)) - fun city(city: Optional) = city(city.orElse(null)) + fun city(city: Optional) = city(city.getOrNull()) fun city(city: JsonField) = apply { this.city = city } fun country(country: String?) = country(JsonField.ofNullable(country)) - fun country(country: Optional) = country(country.orElse(null)) + fun country(country: Optional) = country(country.getOrNull()) fun country(country: JsonField) = apply { this.country = country } fun line1(line1: String?) = line1(JsonField.ofNullable(line1)) - fun line1(line1: Optional) = line1(line1.orElse(null)) + fun line1(line1: Optional) = line1(line1.getOrNull()) fun line1(line1: JsonField) = apply { this.line1 = line1 } fun line2(line2: String?) = line2(JsonField.ofNullable(line2)) - fun line2(line2: Optional) = line2(line2.orElse(null)) + fun line2(line2: Optional) = line2(line2.getOrNull()) fun line2(line2: JsonField) = apply { this.line2 = line2 } fun postalCode(postalCode: String?) = postalCode(JsonField.ofNullable(postalCode)) - fun postalCode(postalCode: Optional) = postalCode(postalCode.orElse(null)) + fun postalCode(postalCode: Optional) = postalCode(postalCode.getOrNull()) fun postalCode(postalCode: JsonField) = apply { this.postalCode = postalCode } fun state(state: String?) = state(JsonField.ofNullable(state)) - fun state(state: Optional) = state(state.orElse(null)) + fun state(state: Optional) = state(state.getOrNull()) fun state(state: JsonField) = apply { this.state = state } @@ -3823,7 +3818,7 @@ private constructor( taxExemptionCode(JsonField.ofNullable(taxExemptionCode)) fun taxExemptionCode(taxExemptionCode: Optional) = - taxExemptionCode(taxExemptionCode.orElse(null)) + taxExemptionCode(taxExemptionCode.getOrNull()) fun taxExemptionCode(taxExemptionCode: JsonField) = apply { this.taxExemptionCode = taxExemptionCode diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerUpdateParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerUpdateParams.kt index 74558781..9d4dc0b8 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerUpdateParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerUpdateParams.kt @@ -965,7 +965,7 @@ private constructor( fun accountingSyncConfiguration( accountingSyncConfiguration: Optional - ) = accountingSyncConfiguration(accountingSyncConfiguration.orElse(null)) + ) = accountingSyncConfiguration(accountingSyncConfiguration.getOrNull()) fun accountingSyncConfiguration( accountingSyncConfiguration: JsonField @@ -983,7 +983,7 @@ private constructor( * will be CC'd for customer communications. */ fun additionalEmails(additionalEmails: Optional>) = - additionalEmails(additionalEmails.orElse(null)) + additionalEmails(additionalEmails.getOrNull()) /** * Additional email addresses for this customer. If populated, these email addresses @@ -1024,9 +1024,8 @@ private constructor( * a saved payment method, if available. This parameter defaults to `True` when a * payment provider is provided on customer creation. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun autoCollection(autoCollection: Optional) = - autoCollection(autoCollection.orElse(null) as Boolean?) + autoCollection(autoCollection.getOrNull()) /** * Used to determine if invoices for this customer will automatically attempt to charge @@ -1041,7 +1040,7 @@ private constructor( billingAddress(JsonField.ofNullable(billingAddress)) fun billingAddress(billingAddress: Optional) = - billingAddress(billingAddress.orElse(null)) + billingAddress(billingAddress.getOrNull()) fun billingAddress(billingAddress: JsonField) = apply { this.billingAddress = billingAddress @@ -1057,7 +1056,7 @@ private constructor( * An ISO 4217 currency string used for the customer's invoices and balance. If not set * at creation time, will be set at subscription creation time. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string used for the customer's invoices and balance. If not set @@ -1069,7 +1068,7 @@ private constructor( fun email(email: String?) = email(JsonField.ofNullable(email)) /** A valid customer email, to be used for invoicing and notifications. */ - fun email(email: Optional) = email(email.orElse(null)) + fun email(email: Optional) = email(email.getOrNull()) /** A valid customer email, to be used for invoicing and notifications. */ fun email(email: JsonField) = apply { this.email = email } @@ -1079,9 +1078,8 @@ private constructor( fun emailDelivery(emailDelivery: Boolean) = emailDelivery(emailDelivery as Boolean?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun emailDelivery(emailDelivery: Optional) = - emailDelivery(emailDelivery.orElse(null) as Boolean?) + emailDelivery(emailDelivery.getOrNull()) fun emailDelivery(emailDelivery: JsonField) = apply { this.emailDelivery = emailDelivery @@ -1099,7 +1097,7 @@ private constructor( * or current subscriptions. */ fun externalCustomerId(externalCustomerId: Optional) = - externalCustomerId(externalCustomerId.orElse(null)) + externalCustomerId(externalCustomerId.getOrNull()) /** * The external customer ID. This can only be set if empty and the customer has no past @@ -1113,7 +1111,7 @@ private constructor( fun hierarchy(hierarchy: Hierarchy?) = hierarchy(JsonField.ofNullable(hierarchy)) /** The hierarchical relationships for this customer. */ - fun hierarchy(hierarchy: Optional) = hierarchy(hierarchy.orElse(null)) + fun hierarchy(hierarchy: Optional) = hierarchy(hierarchy.getOrNull()) /** The hierarchical relationships for this customer. */ fun hierarchy(hierarchy: JsonField) = apply { this.hierarchy = hierarchy } @@ -1130,7 +1128,7 @@ private constructor( * setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed by @@ -1143,7 +1141,7 @@ private constructor( fun name(name: String?) = name(JsonField.ofNullable(name)) /** The full name of the customer */ - fun name(name: Optional) = name(name.orElse(null)) + fun name(name: Optional) = name(name.getOrNull()) /** The full name of the customer */ fun name(name: JsonField) = apply { this.name = name } @@ -1168,7 +1166,7 @@ private constructor( * team. */ fun paymentProvider(paymentProvider: Optional) = - paymentProvider(paymentProvider.orElse(null)) + paymentProvider(paymentProvider.getOrNull()) /** * This is used for creating charges or invoices in an external system via Orb. When not @@ -1194,7 +1192,7 @@ private constructor( * used for creating charges or invoices in the external system via Orb. */ fun paymentProviderId(paymentProviderId: Optional) = - paymentProviderId(paymentProviderId.orElse(null)) + paymentProviderId(paymentProviderId.getOrNull()) /** * The ID of this customer in an external payments solution, such as Stripe. This is @@ -1208,7 +1206,7 @@ private constructor( reportingConfiguration(JsonField.ofNullable(reportingConfiguration)) fun reportingConfiguration(reportingConfiguration: Optional) = - reportingConfiguration(reportingConfiguration.orElse(null)) + reportingConfiguration(reportingConfiguration.getOrNull()) fun reportingConfiguration(reportingConfiguration: JsonField) = apply { @@ -1219,7 +1217,7 @@ private constructor( shippingAddress(JsonField.ofNullable(shippingAddress)) fun shippingAddress(shippingAddress: Optional) = - shippingAddress(shippingAddress.orElse(null)) + shippingAddress(shippingAddress.getOrNull()) fun shippingAddress(shippingAddress: JsonField) = apply { this.shippingAddress = shippingAddress @@ -1229,7 +1227,7 @@ private constructor( taxConfiguration(JsonField.ofNullable(taxConfiguration)) fun taxConfiguration(taxConfiguration: Optional) = - taxConfiguration(taxConfiguration.orElse(null)) + taxConfiguration(taxConfiguration.getOrNull()) fun taxConfiguration(taxConfiguration: JsonField) = apply { this.taxConfiguration = taxConfiguration @@ -1478,7 +1476,7 @@ private constructor( * |Venezuela |`ve_rif` |Venezuelan RIF Number | * |Vietnam |`vn_tin` |Vietnamese Tax ID Number | */ - fun taxId(taxId: Optional) = taxId(taxId.orElse(null)) + fun taxId(taxId: Optional) = taxId(taxId.getOrNull()) /** * Tax IDs are commonly required to be displayed on customer invoices, which are added @@ -1689,7 +1687,7 @@ private constructor( fun accountingSyncConfiguration( accountingSyncConfiguration: Optional - ) = accountingSyncConfiguration(accountingSyncConfiguration.orElse(null)) + ) = accountingSyncConfiguration(accountingSyncConfiguration.getOrNull()) fun accountingSyncConfiguration( accountingSyncConfiguration: JsonField @@ -1708,7 +1706,7 @@ private constructor( * CC'd for customer communications. */ fun additionalEmails(additionalEmails: Optional>) = - additionalEmails(additionalEmails.orElse(null)) + additionalEmails(additionalEmails.getOrNull()) /** * Additional email addresses for this customer. If populated, these email addresses will be @@ -1745,9 +1743,8 @@ private constructor( * saved payment method, if available. This parameter defaults to `True` when a payment * provider is provided on customer creation. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun autoCollection(autoCollection: Optional) = - autoCollection(autoCollection.orElse(null) as Boolean?) + autoCollection(autoCollection.getOrNull()) /** * Used to determine if invoices for this customer will automatically attempt to charge a @@ -1763,7 +1760,7 @@ private constructor( } fun billingAddress(billingAddress: Optional) = - billingAddress(billingAddress.orElse(null)) + billingAddress(billingAddress.getOrNull()) fun billingAddress(billingAddress: JsonField) = apply { body.billingAddress(billingAddress) @@ -1779,7 +1776,7 @@ private constructor( * An ISO 4217 currency string used for the customer's invoices and balance. If not set at * creation time, will be set at subscription creation time. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string used for the customer's invoices and balance. If not set at @@ -1791,7 +1788,7 @@ private constructor( fun email(email: String?) = apply { body.email(email) } /** A valid customer email, to be used for invoicing and notifications. */ - fun email(email: Optional) = email(email.orElse(null)) + fun email(email: Optional) = email(email.getOrNull()) /** A valid customer email, to be used for invoicing and notifications. */ fun email(email: JsonField) = apply { body.email(email) } @@ -1800,9 +1797,8 @@ private constructor( fun emailDelivery(emailDelivery: Boolean) = emailDelivery(emailDelivery as Boolean?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun emailDelivery(emailDelivery: Optional) = - emailDelivery(emailDelivery.orElse(null) as Boolean?) + emailDelivery(emailDelivery.getOrNull()) fun emailDelivery(emailDelivery: JsonField) = apply { body.emailDelivery(emailDelivery) @@ -1821,7 +1817,7 @@ private constructor( * current subscriptions. */ fun externalCustomerId(externalCustomerId: Optional) = - externalCustomerId(externalCustomerId.orElse(null)) + externalCustomerId(externalCustomerId.getOrNull()) /** * The external customer ID. This can only be set if empty and the customer has no past or @@ -1835,7 +1831,7 @@ private constructor( fun hierarchy(hierarchy: Hierarchy?) = apply { body.hierarchy(hierarchy) } /** The hierarchical relationships for this customer. */ - fun hierarchy(hierarchy: Optional) = hierarchy(hierarchy.orElse(null)) + fun hierarchy(hierarchy: Optional) = hierarchy(hierarchy.getOrNull()) /** The hierarchical relationships for this customer. */ fun hierarchy(hierarchy: JsonField) = apply { body.hierarchy(hierarchy) } @@ -1852,7 +1848,7 @@ private constructor( * setting the value to `null`, and the entire metadata mapping can be cleared by setting * `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed by @@ -1865,7 +1861,7 @@ private constructor( fun name(name: String?) = apply { body.name(name) } /** The full name of the customer */ - fun name(name: Optional) = name(name.orElse(null)) + fun name(name: Optional) = name(name.getOrNull()) /** The full name of the customer */ fun name(name: JsonField) = apply { body.name(name) } @@ -1889,7 +1885,7 @@ private constructor( * `netsuite`), any product mappings must first be configured with the Orb team. */ fun paymentProvider(paymentProvider: Optional) = - paymentProvider(paymentProvider.orElse(null)) + paymentProvider(paymentProvider.getOrNull()) /** * This is used for creating charges or invoices in an external system via Orb. When not in @@ -1915,7 +1911,7 @@ private constructor( * for creating charges or invoices in the external system via Orb. */ fun paymentProviderId(paymentProviderId: Optional) = - paymentProviderId(paymentProviderId.orElse(null)) + paymentProviderId(paymentProviderId.getOrNull()) /** * The ID of this customer in an external payments solution, such as Stripe. This is used @@ -1930,7 +1926,7 @@ private constructor( } fun reportingConfiguration(reportingConfiguration: Optional) = - reportingConfiguration(reportingConfiguration.orElse(null)) + reportingConfiguration(reportingConfiguration.getOrNull()) fun reportingConfiguration(reportingConfiguration: JsonField) = apply { @@ -1942,7 +1938,7 @@ private constructor( } fun shippingAddress(shippingAddress: Optional) = - shippingAddress(shippingAddress.orElse(null)) + shippingAddress(shippingAddress.getOrNull()) fun shippingAddress(shippingAddress: JsonField) = apply { body.shippingAddress(shippingAddress) @@ -1953,7 +1949,7 @@ private constructor( } fun taxConfiguration(taxConfiguration: Optional) = - taxConfiguration(taxConfiguration.orElse(null)) + taxConfiguration(taxConfiguration.getOrNull()) fun taxConfiguration(taxConfiguration: JsonField) = apply { body.taxConfiguration(taxConfiguration) @@ -2189,7 +2185,7 @@ private constructor( * |Venezuela |`ve_rif` |Venezuelan RIF Number | * |Vietnam |`vn_tin` |Vietnamese Tax ID Number | */ - fun taxId(taxId: Optional) = taxId(taxId.orElse(null)) + fun taxId(taxId: Optional) = taxId(taxId.getOrNull()) /** * Tax IDs are commonly required to be displayed on customer invoices, which are added to @@ -2497,7 +2493,7 @@ private constructor( accountingProviders(JsonField.ofNullable(accountingProviders)) fun accountingProviders(accountingProviders: Optional>) = - accountingProviders(accountingProviders.orElse(null)) + accountingProviders(accountingProviders.getOrNull()) fun accountingProviders(accountingProviders: JsonField>) = apply { @@ -2515,8 +2511,7 @@ private constructor( fun excluded(excluded: Boolean) = excluded(excluded as Boolean?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun excluded(excluded: Optional) = excluded(excluded.orElse(null) as Boolean?) + fun excluded(excluded: Optional) = excluded(excluded.getOrNull()) fun excluded(excluded: JsonField) = apply { this.excluded = excluded } @@ -2804,37 +2799,37 @@ private constructor( fun city(city: String?) = city(JsonField.ofNullable(city)) - fun city(city: Optional) = city(city.orElse(null)) + fun city(city: Optional) = city(city.getOrNull()) fun city(city: JsonField) = apply { this.city = city } fun country(country: String?) = country(JsonField.ofNullable(country)) - fun country(country: Optional) = country(country.orElse(null)) + fun country(country: Optional) = country(country.getOrNull()) fun country(country: JsonField) = apply { this.country = country } fun line1(line1: String?) = line1(JsonField.ofNullable(line1)) - fun line1(line1: Optional) = line1(line1.orElse(null)) + fun line1(line1: Optional) = line1(line1.getOrNull()) fun line1(line1: JsonField) = apply { this.line1 = line1 } fun line2(line2: String?) = line2(JsonField.ofNullable(line2)) - fun line2(line2: Optional) = line2(line2.orElse(null)) + fun line2(line2: Optional) = line2(line2.getOrNull()) fun line2(line2: JsonField) = apply { this.line2 = line2 } fun postalCode(postalCode: String?) = postalCode(JsonField.ofNullable(postalCode)) - fun postalCode(postalCode: Optional) = postalCode(postalCode.orElse(null)) + fun postalCode(postalCode: Optional) = postalCode(postalCode.getOrNull()) fun postalCode(postalCode: JsonField) = apply { this.postalCode = postalCode } fun state(state: String?) = state(JsonField.ofNullable(state)) - fun state(state: Optional) = state(state.orElse(null)) + fun state(state: Optional) = state(state.getOrNull()) fun state(state: JsonField) = apply { this.state = state } @@ -3008,7 +3003,7 @@ private constructor( * be a child of another customer. */ fun parentCustomerId(parentCustomerId: Optional) = - parentCustomerId(parentCustomerId.orElse(null)) + parentCustomerId(parentCustomerId.getOrNull()) /** * The ID of the parent customer in the hierarchy. The desired parent customer must not @@ -3483,37 +3478,37 @@ private constructor( fun city(city: String?) = city(JsonField.ofNullable(city)) - fun city(city: Optional) = city(city.orElse(null)) + fun city(city: Optional) = city(city.getOrNull()) fun city(city: JsonField) = apply { this.city = city } fun country(country: String?) = country(JsonField.ofNullable(country)) - fun country(country: Optional) = country(country.orElse(null)) + fun country(country: Optional) = country(country.getOrNull()) fun country(country: JsonField) = apply { this.country = country } fun line1(line1: String?) = line1(JsonField.ofNullable(line1)) - fun line1(line1: Optional) = line1(line1.orElse(null)) + fun line1(line1: Optional) = line1(line1.getOrNull()) fun line1(line1: JsonField) = apply { this.line1 = line1 } fun line2(line2: String?) = line2(JsonField.ofNullable(line2)) - fun line2(line2: Optional) = line2(line2.orElse(null)) + fun line2(line2: Optional) = line2(line2.getOrNull()) fun line2(line2: JsonField) = apply { this.line2 = line2 } fun postalCode(postalCode: String?) = postalCode(JsonField.ofNullable(postalCode)) - fun postalCode(postalCode: Optional) = postalCode(postalCode.orElse(null)) + fun postalCode(postalCode: Optional) = postalCode(postalCode.getOrNull()) fun postalCode(postalCode: JsonField) = apply { this.postalCode = postalCode } fun state(state: String?) = state(JsonField.ofNullable(state)) - fun state(state: Optional) = state(state.orElse(null)) + fun state(state: Optional) = state(state.getOrNull()) fun state(state: JsonField) = apply { this.state = state } @@ -3819,7 +3814,7 @@ private constructor( taxExemptionCode(JsonField.ofNullable(taxExemptionCode)) fun taxExemptionCode(taxExemptionCode: Optional) = - taxExemptionCode(taxExemptionCode.orElse(null)) + taxExemptionCode(taxExemptionCode.getOrNull()) fun taxExemptionCode(taxExemptionCode: JsonField) = apply { this.taxExemptionCode = taxExemptionCode diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/DimensionalPriceGroup.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/DimensionalPriceGroup.kt index c74a2ec6..6a4d1502 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/DimensionalPriceGroup.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/DimensionalPriceGroup.kt @@ -17,6 +17,7 @@ import com.withorb.api.core.immutableEmptyMap import com.withorb.api.core.toImmutable import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull /** * A dimensional price group is used to partition the result of a billable metric by a set of @@ -203,7 +204,7 @@ private constructor( /** An alias for the dimensional price group */ fun externalDimensionalPriceGroupId(externalDimensionalPriceGroupId: Optional) = - externalDimensionalPriceGroupId(externalDimensionalPriceGroupId.orElse(null)) + externalDimensionalPriceGroupId(externalDimensionalPriceGroupId.getOrNull()) /** An alias for the dimensional price group */ fun externalDimensionalPriceGroupId(externalDimensionalPriceGroupId: JsonField) = diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/DimensionalPriceGroupCreateParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/DimensionalPriceGroupCreateParams.kt index d148698d..96c4cafb 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/DimensionalPriceGroupCreateParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/DimensionalPriceGroupCreateParams.kt @@ -20,6 +20,7 @@ import com.withorb.api.core.immutableEmptyMap import com.withorb.api.core.toImmutable import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull /** * A dimensional price group is used to partition the result of a billable metric by a set of @@ -235,7 +236,7 @@ private constructor( ) fun externalDimensionalPriceGroupId(externalDimensionalPriceGroupId: Optional) = - externalDimensionalPriceGroupId(externalDimensionalPriceGroupId.orElse(null)) + externalDimensionalPriceGroupId(externalDimensionalPriceGroupId.getOrNull()) fun externalDimensionalPriceGroupId( externalDimensionalPriceGroupId: JsonField @@ -253,7 +254,7 @@ private constructor( * setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed by @@ -371,7 +372,7 @@ private constructor( } fun externalDimensionalPriceGroupId(externalDimensionalPriceGroupId: Optional) = - externalDimensionalPriceGroupId(externalDimensionalPriceGroupId.orElse(null)) + externalDimensionalPriceGroupId(externalDimensionalPriceGroupId.getOrNull()) fun externalDimensionalPriceGroupId(externalDimensionalPriceGroupId: JsonField) = apply { @@ -390,7 +391,7 @@ private constructor( * setting the value to `null`, and the entire metadata mapping can be cleared by setting * `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed by diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/DimensionalPriceGroupListPage.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/DimensionalPriceGroupListPage.kt index d8df0398..92526021 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/DimensionalPriceGroupListPage.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/DimensionalPriceGroupListPage.kt @@ -18,6 +18,7 @@ import java.util.Objects import java.util.Optional import java.util.stream.Stream import java.util.stream.StreamSupport +import kotlin.jvm.optionals.getOrNull /** List dimensional price groups */ class DimensionalPriceGroupListPage @@ -189,7 +190,7 @@ private constructor( while (index < page.data().size) { yield(page.data()[index++]) } - page = page.getNextPage().orElse(null) ?: break + page = page.getNextPage().getOrNull() ?: break index = 0 } } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/DimensionalPriceGroupListParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/DimensionalPriceGroupListParams.kt index 61e92df7..2bfa986d 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/DimensionalPriceGroupListParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/DimensionalPriceGroupListParams.kt @@ -8,6 +8,7 @@ import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull /** List dimensional price groups */ class DimensionalPriceGroupListParams @@ -83,7 +84,7 @@ private constructor( * Cursor for pagination. This can be populated by the `next_cursor` value returned from the * initial request. */ - fun cursor(cursor: Optional) = cursor(cursor.orElse(null)) + fun cursor(cursor: Optional) = cursor(cursor.getOrNull()) /** The number of items to fetch. Defaults to 20. */ fun limit(limit: Long?) = apply { this.limit = limit } @@ -92,8 +93,7 @@ private constructor( fun limit(limit: Long) = limit(limit as Long?) /** The number of items to fetch. Defaults to 20. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun limit(limit: Optional) = limit(limit.orElse(null) as Long?) + fun limit(limit: Optional) = limit(limit.getOrNull()) fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/EventBackfillCloseResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/EventBackfillCloseResponse.kt index a7b263a4..b50cb6c1 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/EventBackfillCloseResponse.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/EventBackfillCloseResponse.kt @@ -19,6 +19,7 @@ import com.withorb.api.errors.OrbInvalidDataException import java.time.OffsetDateTime import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull /** * A backfill represents an update to historical usage data, adding or replacing events in a @@ -261,7 +262,7 @@ private constructor( * If in the future, the time at which the backfill will automatically close. If in the * past, the time at which the backfill was closed. */ - fun closeTime(closeTime: Optional) = closeTime(closeTime.orElse(null)) + fun closeTime(closeTime: Optional) = closeTime(closeTime.getOrNull()) /** * If in the future, the time at which the backfill will automatically close. If in the @@ -283,7 +284,7 @@ private constructor( * The Orb-generated ID of the customer to which this backfill is scoped. If `null`, this * backfill is scoped to all customers. */ - fun customerId(customerId: Optional) = customerId(customerId.orElse(null)) + fun customerId(customerId: Optional) = customerId(customerId.getOrNull()) /** * The Orb-generated ID of the customer to which this backfill is scoped. If `null`, this @@ -320,7 +321,7 @@ private constructor( fun revertedAt(revertedAt: OffsetDateTime?) = revertedAt(JsonField.ofNullable(revertedAt)) /** The time at which this backfill was reverted. */ - fun revertedAt(revertedAt: Optional) = revertedAt(revertedAt.orElse(null)) + fun revertedAt(revertedAt: Optional) = revertedAt(revertedAt.getOrNull()) /** The time at which this backfill was reverted. */ fun revertedAt(revertedAt: JsonField) = apply { @@ -358,7 +359,7 @@ private constructor( * to filter the set of events to deprecate */ fun deprecationFilter(deprecationFilter: Optional) = - deprecationFilter(deprecationFilter.orElse(null)) + deprecationFilter(deprecationFilter.getOrNull()) /** * A boolean [computed property](/extensibility/advanced-metrics#computed-properties) used diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/EventBackfillCreateParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/EventBackfillCreateParams.kt index d0a7f860..da7cb5b5 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/EventBackfillCreateParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/EventBackfillCreateParams.kt @@ -20,6 +20,7 @@ import com.withorb.api.core.toImmutable import java.time.OffsetDateTime import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull /** * Creating the backfill enables adding or replacing past events, even those that are older than the @@ -357,7 +358,7 @@ private constructor( * will automatically begin reflecting throughout Orb at the close time. If not * specified, it will default to 1 day after the creation of the backfill. */ - fun closeTime(closeTime: Optional) = closeTime(closeTime.orElse(null)) + fun closeTime(closeTime: Optional) = closeTime(closeTime.getOrNull()) /** * The time at which no more events will be accepted for this backfill. The backfill @@ -378,7 +379,7 @@ private constructor( * The Orb-generated ID of the customer to which this backfill is scoped. Omitting this * field will scope the backfill to all customers. */ - fun customerId(customerId: Optional) = customerId(customerId.orElse(null)) + fun customerId(customerId: Optional) = customerId(customerId.getOrNull()) /** * The Orb-generated ID of the customer to which this backfill is scoped. Omitting this @@ -398,7 +399,7 @@ private constructor( * used to filter the set of events to deprecate */ fun deprecationFilter(deprecationFilter: Optional) = - deprecationFilter(deprecationFilter.orElse(null)) + deprecationFilter(deprecationFilter.getOrNull()) /** * A boolean [computed property](/extensibility/advanced-metrics#computed-properties) @@ -420,7 +421,7 @@ private constructor( * this field will scope the backfill to all customers. */ fun externalCustomerId(externalCustomerId: Optional) = - externalCustomerId(externalCustomerId.orElse(null)) + externalCustomerId(externalCustomerId.getOrNull()) /** * The external customer ID of the customer to which this backfill is scoped. Omitting @@ -556,7 +557,7 @@ private constructor( * automatically begin reflecting throughout Orb at the close time. If not specified, it * will default to 1 day after the creation of the backfill. */ - fun closeTime(closeTime: Optional) = closeTime(closeTime.orElse(null)) + fun closeTime(closeTime: Optional) = closeTime(closeTime.getOrNull()) /** * The time at which no more events will be accepted for this backfill. The backfill will @@ -575,7 +576,7 @@ private constructor( * The Orb-generated ID of the customer to which this backfill is scoped. Omitting this * field will scope the backfill to all customers. */ - fun customerId(customerId: Optional) = customerId(customerId.orElse(null)) + fun customerId(customerId: Optional) = customerId(customerId.getOrNull()) /** * The Orb-generated ID of the customer to which this backfill is scoped. Omitting this @@ -596,7 +597,7 @@ private constructor( * to filter the set of events to deprecate */ fun deprecationFilter(deprecationFilter: Optional) = - deprecationFilter(deprecationFilter.orElse(null)) + deprecationFilter(deprecationFilter.getOrNull()) /** * A boolean [computed property](/extensibility/advanced-metrics#computed-properties) used @@ -619,7 +620,7 @@ private constructor( * field will scope the backfill to all customers. */ fun externalCustomerId(externalCustomerId: Optional) = - externalCustomerId(externalCustomerId.orElse(null)) + externalCustomerId(externalCustomerId.getOrNull()) /** * The external customer ID of the customer to which this backfill is scoped. Omitting this diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/EventBackfillCreateResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/EventBackfillCreateResponse.kt index 78f2d298..be4f9d50 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/EventBackfillCreateResponse.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/EventBackfillCreateResponse.kt @@ -19,6 +19,7 @@ import com.withorb.api.errors.OrbInvalidDataException import java.time.OffsetDateTime import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull /** * A backfill represents an update to historical usage data, adding or replacing events in a @@ -261,7 +262,7 @@ private constructor( * If in the future, the time at which the backfill will automatically close. If in the * past, the time at which the backfill was closed. */ - fun closeTime(closeTime: Optional) = closeTime(closeTime.orElse(null)) + fun closeTime(closeTime: Optional) = closeTime(closeTime.getOrNull()) /** * If in the future, the time at which the backfill will automatically close. If in the @@ -283,7 +284,7 @@ private constructor( * The Orb-generated ID of the customer to which this backfill is scoped. If `null`, this * backfill is scoped to all customers. */ - fun customerId(customerId: Optional) = customerId(customerId.orElse(null)) + fun customerId(customerId: Optional) = customerId(customerId.getOrNull()) /** * The Orb-generated ID of the customer to which this backfill is scoped. If `null`, this @@ -320,7 +321,7 @@ private constructor( fun revertedAt(revertedAt: OffsetDateTime?) = revertedAt(JsonField.ofNullable(revertedAt)) /** The time at which this backfill was reverted. */ - fun revertedAt(revertedAt: Optional) = revertedAt(revertedAt.orElse(null)) + fun revertedAt(revertedAt: Optional) = revertedAt(revertedAt.getOrNull()) /** The time at which this backfill was reverted. */ fun revertedAt(revertedAt: JsonField) = apply { @@ -358,7 +359,7 @@ private constructor( * to filter the set of events to deprecate */ fun deprecationFilter(deprecationFilter: Optional) = - deprecationFilter(deprecationFilter.orElse(null)) + deprecationFilter(deprecationFilter.getOrNull()) /** * A boolean [computed property](/extensibility/advanced-metrics#computed-properties) used diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/EventBackfillFetchResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/EventBackfillFetchResponse.kt index 2c128c6e..b1baf422 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/EventBackfillFetchResponse.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/EventBackfillFetchResponse.kt @@ -19,6 +19,7 @@ import com.withorb.api.errors.OrbInvalidDataException import java.time.OffsetDateTime import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull /** * A backfill represents an update to historical usage data, adding or replacing events in a @@ -261,7 +262,7 @@ private constructor( * If in the future, the time at which the backfill will automatically close. If in the * past, the time at which the backfill was closed. */ - fun closeTime(closeTime: Optional) = closeTime(closeTime.orElse(null)) + fun closeTime(closeTime: Optional) = closeTime(closeTime.getOrNull()) /** * If in the future, the time at which the backfill will automatically close. If in the @@ -283,7 +284,7 @@ private constructor( * The Orb-generated ID of the customer to which this backfill is scoped. If `null`, this * backfill is scoped to all customers. */ - fun customerId(customerId: Optional) = customerId(customerId.orElse(null)) + fun customerId(customerId: Optional) = customerId(customerId.getOrNull()) /** * The Orb-generated ID of the customer to which this backfill is scoped. If `null`, this @@ -320,7 +321,7 @@ private constructor( fun revertedAt(revertedAt: OffsetDateTime?) = revertedAt(JsonField.ofNullable(revertedAt)) /** The time at which this backfill was reverted. */ - fun revertedAt(revertedAt: Optional) = revertedAt(revertedAt.orElse(null)) + fun revertedAt(revertedAt: Optional) = revertedAt(revertedAt.getOrNull()) /** The time at which this backfill was reverted. */ fun revertedAt(revertedAt: JsonField) = apply { @@ -358,7 +359,7 @@ private constructor( * to filter the set of events to deprecate */ fun deprecationFilter(deprecationFilter: Optional) = - deprecationFilter(deprecationFilter.orElse(null)) + deprecationFilter(deprecationFilter.getOrNull()) /** * A boolean [computed property](/extensibility/advanced-metrics#computed-properties) used diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/EventBackfillListPage.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/EventBackfillListPage.kt index d61f58b0..cfecffc7 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/EventBackfillListPage.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/EventBackfillListPage.kt @@ -18,6 +18,7 @@ import java.util.Objects import java.util.Optional import java.util.stream.Stream import java.util.stream.StreamSupport +import kotlin.jvm.optionals.getOrNull /** * This endpoint returns a list of all backfills in a list format. @@ -196,7 +197,7 @@ private constructor( while (index < page.data().size) { yield(page.data()[index++]) } - page = page.getNextPage().orElse(null) ?: break + page = page.getNextPage().getOrNull() ?: break index = 0 } } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/EventBackfillListParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/EventBackfillListParams.kt index 9f0476cd..912fae53 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/EventBackfillListParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/EventBackfillListParams.kt @@ -8,6 +8,7 @@ import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull /** * This endpoint returns a list of all backfills in a list format. @@ -85,7 +86,7 @@ private constructor( * Cursor for pagination. This can be populated by the `next_cursor` value returned from the * initial request. */ - fun cursor(cursor: Optional) = cursor(cursor.orElse(null)) + fun cursor(cursor: Optional) = cursor(cursor.getOrNull()) /** The number of items to fetch. Defaults to 20. */ fun limit(limit: Long?) = apply { this.limit = limit } @@ -94,8 +95,7 @@ private constructor( fun limit(limit: Long) = limit(limit as Long?) /** The number of items to fetch. Defaults to 20. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun limit(limit: Optional) = limit(limit.orElse(null) as Long?) + fun limit(limit: Optional) = limit(limit.getOrNull()) fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/EventBackfillListResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/EventBackfillListResponse.kt index eca6483a..9ec4d1ec 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/EventBackfillListResponse.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/EventBackfillListResponse.kt @@ -19,6 +19,7 @@ import com.withorb.api.errors.OrbInvalidDataException import java.time.OffsetDateTime import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull /** * A backfill represents an update to historical usage data, adding or replacing events in a @@ -261,7 +262,7 @@ private constructor( * If in the future, the time at which the backfill will automatically close. If in the * past, the time at which the backfill was closed. */ - fun closeTime(closeTime: Optional) = closeTime(closeTime.orElse(null)) + fun closeTime(closeTime: Optional) = closeTime(closeTime.getOrNull()) /** * If in the future, the time at which the backfill will automatically close. If in the @@ -283,7 +284,7 @@ private constructor( * The Orb-generated ID of the customer to which this backfill is scoped. If `null`, this * backfill is scoped to all customers. */ - fun customerId(customerId: Optional) = customerId(customerId.orElse(null)) + fun customerId(customerId: Optional) = customerId(customerId.getOrNull()) /** * The Orb-generated ID of the customer to which this backfill is scoped. If `null`, this @@ -320,7 +321,7 @@ private constructor( fun revertedAt(revertedAt: OffsetDateTime?) = revertedAt(JsonField.ofNullable(revertedAt)) /** The time at which this backfill was reverted. */ - fun revertedAt(revertedAt: Optional) = revertedAt(revertedAt.orElse(null)) + fun revertedAt(revertedAt: Optional) = revertedAt(revertedAt.getOrNull()) /** The time at which this backfill was reverted. */ fun revertedAt(revertedAt: JsonField) = apply { @@ -358,7 +359,7 @@ private constructor( * to filter the set of events to deprecate */ fun deprecationFilter(deprecationFilter: Optional) = - deprecationFilter(deprecationFilter.orElse(null)) + deprecationFilter(deprecationFilter.getOrNull()) /** * A boolean [computed property](/extensibility/advanced-metrics#computed-properties) used diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/EventBackfillRevertResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/EventBackfillRevertResponse.kt index 67436c0e..dfd4913b 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/EventBackfillRevertResponse.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/EventBackfillRevertResponse.kt @@ -19,6 +19,7 @@ import com.withorb.api.errors.OrbInvalidDataException import java.time.OffsetDateTime import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull /** * A backfill represents an update to historical usage data, adding or replacing events in a @@ -261,7 +262,7 @@ private constructor( * If in the future, the time at which the backfill will automatically close. If in the * past, the time at which the backfill was closed. */ - fun closeTime(closeTime: Optional) = closeTime(closeTime.orElse(null)) + fun closeTime(closeTime: Optional) = closeTime(closeTime.getOrNull()) /** * If in the future, the time at which the backfill will automatically close. If in the @@ -283,7 +284,7 @@ private constructor( * The Orb-generated ID of the customer to which this backfill is scoped. If `null`, this * backfill is scoped to all customers. */ - fun customerId(customerId: Optional) = customerId(customerId.orElse(null)) + fun customerId(customerId: Optional) = customerId(customerId.getOrNull()) /** * The Orb-generated ID of the customer to which this backfill is scoped. If `null`, this @@ -320,7 +321,7 @@ private constructor( fun revertedAt(revertedAt: OffsetDateTime?) = revertedAt(JsonField.ofNullable(revertedAt)) /** The time at which this backfill was reverted. */ - fun revertedAt(revertedAt: Optional) = revertedAt(revertedAt.orElse(null)) + fun revertedAt(revertedAt: Optional) = revertedAt(revertedAt.getOrNull()) /** The time at which this backfill was reverted. */ fun revertedAt(revertedAt: JsonField) = apply { @@ -358,7 +359,7 @@ private constructor( * to filter the set of events to deprecate */ fun deprecationFilter(deprecationFilter: Optional) = - deprecationFilter(deprecationFilter.orElse(null)) + deprecationFilter(deprecationFilter.getOrNull()) /** * A boolean [computed property](/extensibility/advanced-metrics#computed-properties) used diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/EventIngestParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/EventIngestParams.kt index f6761b9f..9179aba5 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/EventIngestParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/EventIngestParams.kt @@ -21,6 +21,7 @@ import com.withorb.api.core.toImmutable import java.time.OffsetDateTime import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull /** * Orb's event ingestion model and API is designed around two core principles: @@ -407,7 +408,7 @@ private constructor( * If this ingestion request is part of a backfill, this parameter ties the ingested events * to the backfill */ - fun backfillId(backfillId: Optional) = backfillId(backfillId.orElse(null)) + fun backfillId(backfillId: Optional) = backfillId(backfillId.getOrNull()) /** Flag to enable additional debug information in the endpoint response */ fun debug(debug: Boolean?) = apply { this.debug = debug } @@ -416,8 +417,7 @@ private constructor( fun debug(debug: Boolean) = debug(debug as Boolean?) /** Flag to enable additional debug information in the endpoint response */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun debug(debug: Optional) = debug(debug.orElse(null) as Boolean?) + fun debug(debug: Optional) = debug(debug.getOrNull()) fun events(events: List) = apply { body.events(events) } @@ -748,7 +748,7 @@ private constructor( fun customerId(customerId: String?) = customerId(JsonField.ofNullable(customerId)) /** The Orb Customer identifier */ - fun customerId(customerId: Optional) = customerId(customerId.orElse(null)) + fun customerId(customerId: Optional) = customerId(customerId.getOrNull()) /** The Orb Customer identifier */ fun customerId(customerId: JsonField) = apply { this.customerId = customerId } @@ -763,7 +763,7 @@ private constructor( * An alias for the Orb customer, whose mapping is specified when creating the customer */ fun externalCustomerId(externalCustomerId: Optional) = - externalCustomerId(externalCustomerId.orElse(null)) + externalCustomerId(externalCustomerId.getOrNull()) /** * An alias for the Orb customer, whose mapping is specified when creating the customer diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/EventIngestResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/EventIngestResponse.kt index 5e0a0288..d0056683 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/EventIngestResponse.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/EventIngestResponse.kt @@ -17,6 +17,7 @@ import com.withorb.api.core.immutableEmptyMap import com.withorb.api.core.toImmutable import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull @NoAutoDetect class EventIngestResponse @@ -137,7 +138,7 @@ private constructor( * Optional debug information (only present when debug=true is passed to the endpoint). * Contains ingested and duplicate event idempotency keys. */ - fun debug(debug: Optional) = debug(debug.orElse(null)) + fun debug(debug: Optional) = debug(debug.getOrNull()) /** * Optional debug information (only present when debug=true is passed to the endpoint). diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/EventSearchParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/EventSearchParams.kt index 561d8acb..a882be51 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/EventSearchParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/EventSearchParams.kt @@ -21,6 +21,7 @@ import com.withorb.api.core.toImmutable import java.time.OffsetDateTime import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull /** * This endpoint returns a filtered set of events for an account in a @@ -244,7 +245,7 @@ private constructor( * current time is used. */ fun timeframeEnd(timeframeEnd: Optional) = - timeframeEnd(timeframeEnd.orElse(null)) + timeframeEnd(timeframeEnd.getOrNull()) /** * The end of the timeframe, exclusive, in which to search events. If not specified, the @@ -266,7 +267,7 @@ private constructor( * the one week ago is used. */ fun timeframeStart(timeframeStart: Optional) = - timeframeStart(timeframeStart.orElse(null)) + timeframeStart(timeframeStart.getOrNull()) /** * The start of the timeframe, inclusive, in which to search events. If not specified, @@ -384,7 +385,7 @@ private constructor( * current time is used. */ fun timeframeEnd(timeframeEnd: Optional) = - timeframeEnd(timeframeEnd.orElse(null)) + timeframeEnd(timeframeEnd.getOrNull()) /** * The end of the timeframe, exclusive, in which to search events. If not specified, the @@ -407,7 +408,7 @@ private constructor( * one week ago is used. */ fun timeframeStart(timeframeStart: Optional) = - timeframeStart(timeframeStart.orElse(null)) + timeframeStart(timeframeStart.getOrNull()) /** * The start of the timeframe, inclusive, in which to search events. If not specified, the diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/EventSearchResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/EventSearchResponse.kt index 7fa8aa81..4fcee70c 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/EventSearchResponse.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/EventSearchResponse.kt @@ -18,6 +18,7 @@ import com.withorb.api.core.toImmutable import java.time.OffsetDateTime import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull @NoAutoDetect class EventSearchResponse @@ -297,7 +298,7 @@ private constructor( fun customerId(customerId: String?) = customerId(JsonField.ofNullable(customerId)) /** The Orb Customer identifier */ - fun customerId(customerId: Optional) = customerId(customerId.orElse(null)) + fun customerId(customerId: Optional) = customerId(customerId.getOrNull()) /** The Orb Customer identifier */ fun customerId(customerId: JsonField) = apply { this.customerId = customerId } @@ -324,7 +325,7 @@ private constructor( * An alias for the Orb customer, whose mapping is specified when creating the customer */ fun externalCustomerId(externalCustomerId: Optional) = - externalCustomerId(externalCustomerId.orElse(null)) + externalCustomerId(externalCustomerId.getOrNull()) /** * An alias for the Orb customer, whose mapping is specified when creating the customer diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/EventUpdateParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/EventUpdateParams.kt index 549a2fcc..57c9dcfc 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/EventUpdateParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/EventUpdateParams.kt @@ -20,6 +20,7 @@ import com.withorb.api.core.toImmutable import java.time.OffsetDateTime import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull /** * This endpoint is used to amend a single usage event with a given `event_id`. `event_id` refers to @@ -283,7 +284,7 @@ private constructor( fun customerId(customerId: String?) = customerId(JsonField.ofNullable(customerId)) /** The Orb Customer identifier */ - fun customerId(customerId: Optional) = customerId(customerId.orElse(null)) + fun customerId(customerId: Optional) = customerId(customerId.getOrNull()) /** The Orb Customer identifier */ fun customerId(customerId: JsonField) = apply { this.customerId = customerId } @@ -298,7 +299,7 @@ private constructor( * An alias for the Orb customer, whose mapping is specified when creating the customer */ fun externalCustomerId(externalCustomerId: Optional) = - externalCustomerId(externalCustomerId.orElse(null)) + externalCustomerId(externalCustomerId.getOrNull()) /** * An alias for the Orb customer, whose mapping is specified when creating the customer @@ -422,7 +423,7 @@ private constructor( fun customerId(customerId: String?) = apply { body.customerId(customerId) } /** The Orb Customer identifier */ - fun customerId(customerId: Optional) = customerId(customerId.orElse(null)) + fun customerId(customerId: Optional) = customerId(customerId.getOrNull()) /** The Orb Customer identifier */ fun customerId(customerId: JsonField) = apply { body.customerId(customerId) } @@ -434,7 +435,7 @@ private constructor( /** An alias for the Orb customer, whose mapping is specified when creating the customer */ fun externalCustomerId(externalCustomerId: Optional) = - externalCustomerId(externalCustomerId.orElse(null)) + externalCustomerId(externalCustomerId.getOrNull()) /** An alias for the Orb customer, whose mapping is specified when creating the customer */ fun externalCustomerId(externalCustomerId: JsonField) = apply { diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/EventVolumeListParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/EventVolumeListParams.kt index 7197ada7..4ff0d942 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/EventVolumeListParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/EventVolumeListParams.kt @@ -11,6 +11,7 @@ import java.time.OffsetDateTime import java.time.format.DateTimeFormatter import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull /** * This endpoint returns the event volume for an account in a @@ -140,7 +141,7 @@ private constructor( * Cursor for pagination. This can be populated by the `next_cursor` value returned from the * initial request. */ - fun cursor(cursor: Optional) = cursor(cursor.orElse(null)) + fun cursor(cursor: Optional) = cursor(cursor.getOrNull()) /** The number of items to fetch. Defaults to 20. */ fun limit(limit: Long?) = apply { this.limit = limit } @@ -149,8 +150,7 @@ private constructor( fun limit(limit: Long) = limit(limit as Long?) /** The number of items to fetch. Defaults to 20. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun limit(limit: Optional) = limit(limit.orElse(null) as Long?) + fun limit(limit: Optional) = limit(limit.getOrNull()) /** * The end of the timeframe, exclusive, in which to return event volume. If not specified, @@ -167,7 +167,7 @@ private constructor( * time falls in. */ fun timeframeEnd(timeframeEnd: Optional) = - timeframeEnd(timeframeEnd.orElse(null)) + timeframeEnd(timeframeEnd.getOrNull()) fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/Invoice.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/Invoice.kt index 9851afcc..8c1c312a 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/Invoice.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/Invoice.kt @@ -973,7 +973,7 @@ private constructor( billingAddress(JsonField.ofNullable(billingAddress)) fun billingAddress(billingAddress: Optional) = - billingAddress(billingAddress.orElse(null)) + billingAddress(billingAddress.getOrNull()) fun billingAddress(billingAddress: JsonField) = apply { this.billingAddress = billingAddress @@ -1247,7 +1247,7 @@ private constructor( * |Vietnam |`vn_tin` |Vietnamese Tax ID Number | */ fun customerTaxId(customerTaxId: Optional) = - customerTaxId(customerTaxId.orElse(null)) + customerTaxId(customerTaxId.getOrNull()) /** * Tax IDs are commonly required to be displayed on customer invoices, which are added to @@ -1405,7 +1405,7 @@ private constructor( * When the invoice payment is due. The due date is null if the invoice is not yet * finalized. */ - fun dueDate(dueDate: Optional) = dueDate(dueDate.orElse(null)) + fun dueDate(dueDate: Optional) = dueDate(dueDate.getOrNull()) /** * When the invoice payment is due. The due date is null if the invoice is not yet @@ -1427,7 +1427,7 @@ private constructor( * will automatically begin issuing at this time. */ fun eligibleToIssueAt(eligibleToIssueAt: Optional) = - eligibleToIssueAt(eligibleToIssueAt.orElse(null)) + eligibleToIssueAt(eligibleToIssueAt.getOrNull()) /** * If the invoice has a status of `draft`, this will be the time that the invoice will be @@ -1450,7 +1450,7 @@ private constructor( * invoice's due date, or 60 days after being re-generated through the UI. */ fun hostedInvoiceUrl(hostedInvoiceUrl: Optional) = - hostedInvoiceUrl(hostedInvoiceUrl.orElse(null)) + hostedInvoiceUrl(hostedInvoiceUrl.getOrNull()) /** * A URL for the customer-facing invoice portal. This URL expires 30 days after the @@ -1486,7 +1486,7 @@ private constructor( fun invoicePdf(invoicePdf: String?) = invoicePdf(JsonField.ofNullable(invoicePdf)) /** The link to download the PDF representation of the `Invoice`. */ - fun invoicePdf(invoicePdf: Optional) = invoicePdf(invoicePdf.orElse(null)) + fun invoicePdf(invoicePdf: Optional) = invoicePdf(invoicePdf.getOrNull()) /** The link to download the PDF representation of the `Invoice`. */ fun invoicePdf(invoicePdf: JsonField) = apply { this.invoicePdf = invoicePdf } @@ -1509,7 +1509,7 @@ private constructor( * is now in a different state.) */ fun issueFailedAt(issueFailedAt: Optional) = - issueFailedAt(issueFailedAt.orElse(null)) + issueFailedAt(issueFailedAt.getOrNull()) /** * If the invoice failed to issue, this will be the last time it failed to issue (even if it @@ -1529,7 +1529,7 @@ private constructor( * If the invoice has been issued, this will be the time it transitioned to `issued` (even * if it is now in a different state.) */ - fun issuedAt(issuedAt: Optional) = issuedAt(issuedAt.orElse(null)) + fun issuedAt(issuedAt: Optional) = issuedAt(issuedAt.getOrNull()) /** * If the invoice has been issued, this will be the time it transitioned to `issued` (even @@ -1555,7 +1555,7 @@ private constructor( fun maximum(maximum: Maximum?) = maximum(JsonField.ofNullable(maximum)) - fun maximum(maximum: Optional) = maximum(maximum.orElse(null)) + fun maximum(maximum: Optional) = maximum(maximum.getOrNull()) fun maximum(maximum: JsonField) = apply { this.maximum = maximum } @@ -1563,7 +1563,7 @@ private constructor( maximumAmount(JsonField.ofNullable(maximumAmount)) fun maximumAmount(maximumAmount: Optional) = - maximumAmount(maximumAmount.orElse(null)) + maximumAmount(maximumAmount.getOrNull()) fun maximumAmount(maximumAmount: JsonField) = apply { this.maximumAmount = maximumAmount @@ -1573,7 +1573,7 @@ private constructor( fun memo(memo: String?) = memo(JsonField.ofNullable(memo)) /** Free-form text which is available on the invoice PDF and the Orb invoice portal. */ - fun memo(memo: Optional) = memo(memo.orElse(null)) + fun memo(memo: Optional) = memo(memo.getOrNull()) /** Free-form text which is available on the invoice PDF and the Orb invoice portal. */ fun memo(memo: JsonField) = apply { this.memo = memo } @@ -1594,7 +1594,7 @@ private constructor( fun minimum(minimum: Minimum?) = minimum(JsonField.ofNullable(minimum)) - fun minimum(minimum: Optional) = minimum(minimum.orElse(null)) + fun minimum(minimum: Optional) = minimum(minimum.getOrNull()) fun minimum(minimum: JsonField) = apply { this.minimum = minimum } @@ -1602,7 +1602,7 @@ private constructor( minimumAmount(JsonField.ofNullable(minimumAmount)) fun minimumAmount(minimumAmount: Optional) = - minimumAmount(minimumAmount.orElse(null)) + minimumAmount(minimumAmount.getOrNull()) fun minimumAmount(minimumAmount: JsonField) = apply { this.minimumAmount = minimumAmount @@ -1616,7 +1616,7 @@ private constructor( /** * If the invoice has a status of `paid`, this gives a timestamp when the invoice was paid. */ - fun paidAt(paidAt: Optional) = paidAt(paidAt.orElse(null)) + fun paidAt(paidAt: Optional) = paidAt(paidAt.getOrNull()) /** * If the invoice has a status of `paid`, this gives a timestamp when the invoice was paid. @@ -1652,7 +1652,7 @@ private constructor( * recent attempt. */ fun paymentFailedAt(paymentFailedAt: Optional) = - paymentFailedAt(paymentFailedAt.orElse(null)) + paymentFailedAt(paymentFailedAt.getOrNull()) /** * If payment was attempted on this invoice but failed, this will be the time of the most @@ -1676,7 +1676,7 @@ private constructor( * (like bank transfers), where payment can take 3 days or more. */ fun paymentStartedAt(paymentStartedAt: Optional) = - paymentStartedAt(paymentStartedAt.orElse(null)) + paymentStartedAt(paymentStartedAt.getOrNull()) /** * If payment was attempted on this invoice, this will be the start time of the most recent @@ -1699,7 +1699,7 @@ private constructor( * be issued. */ fun scheduledIssueAt(scheduledIssueAt: Optional) = - scheduledIssueAt(scheduledIssueAt.orElse(null)) + scheduledIssueAt(scheduledIssueAt.getOrNull()) /** * If the invoice is in draft, this timestamp will reflect when the invoice is scheduled to @@ -1713,7 +1713,7 @@ private constructor( shippingAddress(JsonField.ofNullable(shippingAddress)) fun shippingAddress(shippingAddress: Optional) = - shippingAddress(shippingAddress.orElse(null)) + shippingAddress(shippingAddress.getOrNull()) fun shippingAddress(shippingAddress: JsonField) = apply { this.shippingAddress = shippingAddress @@ -1727,7 +1727,7 @@ private constructor( subscription(JsonField.ofNullable(subscription)) fun subscription(subscription: Optional) = - subscription(subscription.orElse(null)) + subscription(subscription.getOrNull()) fun subscription(subscription: JsonField) = apply { this.subscription = subscription @@ -1751,7 +1751,7 @@ private constructor( * sync was attempted. This field will always be `null` for invoices using Orb Invoicing. */ fun syncFailedAt(syncFailedAt: Optional) = - syncFailedAt(syncFailedAt.orElse(null)) + syncFailedAt(syncFailedAt.getOrNull()) /** * If the invoice failed to sync, this will be the last time an external invoicing provider @@ -1777,7 +1777,7 @@ private constructor( * If the invoice has a status of `void`, this gives a timestamp when the invoice was * voided. */ - fun voidedAt(voidedAt: Optional) = voidedAt(voidedAt.orElse(null)) + fun voidedAt(voidedAt: Optional) = voidedAt(voidedAt.getOrNull()) /** * If the invoice has a status of `void`, this gives a timestamp when the invoice was @@ -2003,8 +2003,7 @@ private constructor( fun enabled(enabled: Boolean) = enabled(enabled as Boolean?) /** True only if auto-collection is enabled for this invoice. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun enabled(enabled: Optional) = enabled(enabled.orElse(null) as Boolean?) + fun enabled(enabled: Optional) = enabled(enabled.getOrNull()) /** True only if auto-collection is enabled for this invoice. */ fun enabled(enabled: JsonField) = apply { this.enabled = enabled } @@ -2023,7 +2022,7 @@ private constructor( * enabled for this invoice, this field will be `null`. */ fun nextAttemptAt(nextAttemptAt: Optional) = - nextAttemptAt(nextAttemptAt.orElse(null)) + nextAttemptAt(nextAttemptAt.getOrNull()) /** * If the invoice is scheduled for auto-collection, this field will reflect when the @@ -2041,9 +2040,7 @@ private constructor( fun numAttempts(numAttempts: Long) = numAttempts(numAttempts as Long?) /** Number of auto-collection payment attempts. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun numAttempts(numAttempts: Optional) = - numAttempts(numAttempts.orElse(null) as Long?) + fun numAttempts(numAttempts: Optional) = numAttempts(numAttempts.getOrNull()) /** Number of auto-collection payment attempts. */ fun numAttempts(numAttempts: JsonField) = apply { this.numAttempts = numAttempts } @@ -2068,7 +2065,7 @@ private constructor( * `next_attempt_time` is null). */ fun previouslyAttemptedAt(previouslyAttemptedAt: Optional) = - previouslyAttemptedAt(previouslyAttemptedAt.orElse(null)) + previouslyAttemptedAt(previouslyAttemptedAt.getOrNull()) /** * If Orb has ever attempted payment auto-collection for this invoice, this field will @@ -2246,37 +2243,37 @@ private constructor( fun city(city: String?) = city(JsonField.ofNullable(city)) - fun city(city: Optional) = city(city.orElse(null)) + fun city(city: Optional) = city(city.getOrNull()) fun city(city: JsonField) = apply { this.city = city } fun country(country: String?) = country(JsonField.ofNullable(country)) - fun country(country: Optional) = country(country.orElse(null)) + fun country(country: Optional) = country(country.getOrNull()) fun country(country: JsonField) = apply { this.country = country } fun line1(line1: String?) = line1(JsonField.ofNullable(line1)) - fun line1(line1: Optional) = line1(line1.orElse(null)) + fun line1(line1: Optional) = line1(line1.getOrNull()) fun line1(line1: JsonField) = apply { this.line1 = line1 } fun line2(line2: String?) = line2(JsonField.ofNullable(line2)) - fun line2(line2: Optional) = line2(line2.orElse(null)) + fun line2(line2: Optional) = line2(line2.getOrNull()) fun line2(line2: JsonField) = apply { this.line2 = line2 } fun postalCode(postalCode: String?) = postalCode(JsonField.ofNullable(postalCode)) - fun postalCode(postalCode: Optional) = postalCode(postalCode.orElse(null)) + fun postalCode(postalCode: Optional) = postalCode(postalCode.getOrNull()) fun postalCode(postalCode: JsonField) = apply { this.postalCode = postalCode } fun state(state: String?) = state(JsonField.ofNullable(state)) - fun state(state: Optional) = state(state.orElse(null)) + fun state(state: Optional) = state(state.getOrNull()) fun state(state: JsonField) = apply { this.state = state } @@ -2480,7 +2477,7 @@ private constructor( fun memo(memo: String?) = memo(JsonField.ofNullable(memo)) /** An optional memo supplied on the credit note. */ - fun memo(memo: Optional) = memo(memo.orElse(null)) + fun memo(memo: Optional) = memo(memo.getOrNull()) /** An optional memo supplied on the credit note. */ fun memo(memo: JsonField) = apply { this.memo = memo } @@ -2507,7 +2504,7 @@ private constructor( * If the credit note has a status of `void`, this gives a timestamp when the credit * note was voided. */ - fun voidedAt(voidedAt: Optional) = voidedAt(voidedAt.orElse(null)) + fun voidedAt(voidedAt: Optional) = voidedAt(voidedAt.getOrNull()) /** * If the credit note has a status of `void`, this gives a timestamp when the credit @@ -2642,7 +2639,7 @@ private constructor( externalCustomerId(JsonField.ofNullable(externalCustomerId)) fun externalCustomerId(externalCustomerId: Optional) = - externalCustomerId(externalCustomerId.orElse(null)) + externalCustomerId(externalCustomerId.getOrNull()) fun externalCustomerId(externalCustomerId: JsonField) = apply { this.externalCustomerId = externalCustomerId @@ -2909,7 +2906,7 @@ private constructor( fun creditNote(creditNote: CreditNote?) = creditNote(JsonField.ofNullable(creditNote)) - fun creditNote(creditNote: Optional) = creditNote(creditNote.orElse(null)) + fun creditNote(creditNote: Optional) = creditNote(creditNote.getOrNull()) fun creditNote(creditNote: JsonField) = apply { this.creditNote = creditNote @@ -2919,7 +2916,7 @@ private constructor( fun description(description: String?) = description(JsonField.ofNullable(description)) /** An optional description provided for manual customer balance adjustments. */ - fun description(description: Optional) = description(description.orElse(null)) + fun description(description: Optional) = description(description.getOrNull()) /** An optional description provided for manual customer balance adjustments. */ fun description(description: JsonField) = apply { @@ -2942,7 +2939,7 @@ private constructor( fun invoice(invoice: InnerInvoice?) = invoice(JsonField.ofNullable(invoice)) - fun invoice(invoice: Optional) = invoice(invoice.orElse(null)) + fun invoice(invoice: Optional) = invoice(invoice.getOrNull()) fun invoice(invoice: JsonField) = apply { this.invoice = invoice } @@ -5434,7 +5431,7 @@ private constructor( fun discount(discount: Discount?) = discount(JsonField.ofNullable(discount)) - fun discount(discount: Optional) = discount(discount.orElse(null)) + fun discount(discount: Optional) = discount(discount.getOrNull()) fun discount(discount: JsonField) = apply { this.discount = discount } @@ -5465,7 +5462,7 @@ private constructor( fun filter(filter: String?) = filter(JsonField.ofNullable(filter)) /** An additional filter that was used to calculate the usage for this line item. */ - fun filter(filter: Optional) = filter(filter.orElse(null)) + fun filter(filter: Optional) = filter(filter.getOrNull()) /** An additional filter that was used to calculate the usage for this line item. */ fun filter(filter: JsonField) = apply { this.filter = filter } @@ -5482,7 +5479,7 @@ private constructor( * populated with the key and a value. The `amount` and `subtotal` will be the values * for this particular grouping. */ - fun grouping(grouping: Optional) = grouping(grouping.orElse(null)) + fun grouping(grouping: Optional) = grouping(grouping.getOrNull()) /** * [DEPRECATED] For configured prices that are split by a grouping key, this will be @@ -5497,7 +5494,7 @@ private constructor( /** This field is deprecated in favor of `adjustments`. */ @Deprecated("deprecated") - fun maximum(maximum: Optional) = maximum(maximum.orElse(null)) + fun maximum(maximum: Optional) = maximum(maximum.getOrNull()) /** This field is deprecated in favor of `adjustments`. */ @Deprecated("deprecated") @@ -5511,7 +5508,7 @@ private constructor( /** This field is deprecated in favor of `adjustments`. */ @Deprecated("deprecated") fun maximumAmount(maximumAmount: Optional) = - maximumAmount(maximumAmount.orElse(null)) + maximumAmount(maximumAmount.getOrNull()) /** This field is deprecated in favor of `adjustments`. */ @Deprecated("deprecated") @@ -5525,7 +5522,7 @@ private constructor( /** This field is deprecated in favor of `adjustments`. */ @Deprecated("deprecated") - fun minimum(minimum: Optional) = minimum(minimum.orElse(null)) + fun minimum(minimum: Optional) = minimum(minimum.getOrNull()) /** This field is deprecated in favor of `adjustments`. */ @Deprecated("deprecated") @@ -5539,7 +5536,7 @@ private constructor( /** This field is deprecated in favor of `adjustments`. */ @Deprecated("deprecated") fun minimumAmount(minimumAmount: Optional) = - minimumAmount(minimumAmount.orElse(null)) + minimumAmount(minimumAmount.getOrNull()) /** This field is deprecated in favor of `adjustments`. */ @Deprecated("deprecated") @@ -5588,7 +5585,7 @@ private constructor( * For more on the types of prices, see * [the core concepts documentation](/core-concepts#plan-and-price) */ - fun price(price: Optional) = price(price.orElse(null)) + fun price(price: Optional) = price(price.getOrNull()) /** * The Price resource represents a price that can be billed on a subscription, resulting @@ -6114,7 +6111,7 @@ private constructor( /** A list of customer ids that were used to calculate the usage for this line item. */ fun usageCustomerIds(usageCustomerIds: Optional>) = - usageCustomerIds(usageCustomerIds.orElse(null)) + usageCustomerIds(usageCustomerIds.getOrNull()) /** A list of customer ids that were used to calculate the usage for this line item. */ fun usageCustomerIds(usageCustomerIds: JsonField>) = apply { @@ -6675,7 +6672,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -7081,7 +7078,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -7473,7 +7470,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -7882,7 +7879,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -8273,7 +8270,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -9079,7 +9076,7 @@ private constructor( fun grouping(grouping: Grouping?) = grouping(JsonField.ofNullable(grouping)) - fun grouping(grouping: Optional) = grouping(grouping.orElse(null)) + fun grouping(grouping: Optional) = grouping(grouping.getOrNull()) fun grouping(grouping: JsonField) = apply { this.grouping = grouping } @@ -9215,7 +9212,7 @@ private constructor( fun value(value: String?) = value(JsonField.ofNullable(value)) /** No value indicates the default group */ - fun value(value: Optional) = value(value.orElse(null)) + fun value(value: Optional) = value(value.getOrNull()) /** No value indicates the default group */ fun value(value: JsonField) = apply { this.value = value } @@ -9644,7 +9641,7 @@ private constructor( fun grouping(grouping: Grouping?) = grouping(JsonField.ofNullable(grouping)) - fun grouping(grouping: Optional) = grouping(grouping.orElse(null)) + fun grouping(grouping: Optional) = grouping(grouping.getOrNull()) fun grouping(grouping: JsonField) = apply { this.grouping = grouping } @@ -9779,7 +9776,7 @@ private constructor( fun value(value: String?) = value(JsonField.ofNullable(value)) /** No value indicates the default group */ - fun value(value: Optional) = value(value.orElse(null)) + fun value(value: Optional) = value(value.getOrNull()) /** No value indicates the default group */ fun value(value: JsonField) = apply { this.value = value } @@ -9929,11 +9926,7 @@ private constructor( fun lastUnit(lastUnit: Double) = lastUnit(lastUnit as Double?) - @Suppress( - "USELESS_CAST" - ) // See https://youtrack.jetbrains.com/issue/KT-74228 - fun lastUnit(lastUnit: Optional) = - lastUnit(lastUnit.orElse(null) as Double?) + fun lastUnit(lastUnit: Optional) = lastUnit(lastUnit.getOrNull()) fun lastUnit(lastUnit: JsonField) = apply { this.lastUnit = lastUnit @@ -10227,7 +10220,7 @@ private constructor( fun grouping(grouping: Grouping?) = grouping(JsonField.ofNullable(grouping)) - fun grouping(grouping: Optional) = grouping(grouping.orElse(null)) + fun grouping(grouping: Optional) = grouping(grouping.getOrNull()) fun grouping(grouping: JsonField) = apply { this.grouping = grouping } @@ -10355,7 +10348,7 @@ private constructor( fun value(value: String?) = value(JsonField.ofNullable(value)) /** No value indicates the default group */ - fun value(value: Optional) = value(value.orElse(null)) + fun value(value: Optional) = value(value.getOrNull()) /** No value indicates the default group */ fun value(value: JsonField) = apply { this.value = value } @@ -10638,7 +10631,7 @@ private constructor( /** The tax rate percentage, out of 100. */ fun taxRatePercentage(taxRatePercentage: Optional) = - taxRatePercentage(taxRatePercentage.orElse(null)) + taxRatePercentage(taxRatePercentage.getOrNull()) /** The tax rate percentage, out of 100. */ fun taxRatePercentage(taxRatePercentage: JsonField) = apply { @@ -11276,7 +11269,7 @@ private constructor( /** The payment provider that attempted to collect the payment. */ fun paymentProvider(paymentProvider: Optional) = - paymentProvider(paymentProvider.orElse(null)) + paymentProvider(paymentProvider.getOrNull()) /** The payment provider that attempted to collect the payment. */ fun paymentProvider(paymentProvider: JsonField) = apply { @@ -11289,7 +11282,7 @@ private constructor( /** The ID of the payment attempt in the payment provider. */ fun paymentProviderId(paymentProviderId: Optional) = - paymentProviderId(paymentProviderId.orElse(null)) + paymentProviderId(paymentProviderId.getOrNull()) /** The ID of the payment attempt in the payment provider. */ fun paymentProviderId(paymentProviderId: JsonField) = apply { @@ -11566,37 +11559,37 @@ private constructor( fun city(city: String?) = city(JsonField.ofNullable(city)) - fun city(city: Optional) = city(city.orElse(null)) + fun city(city: Optional) = city(city.getOrNull()) fun city(city: JsonField) = apply { this.city = city } fun country(country: String?) = country(JsonField.ofNullable(country)) - fun country(country: Optional) = country(country.orElse(null)) + fun country(country: Optional) = country(country.getOrNull()) fun country(country: JsonField) = apply { this.country = country } fun line1(line1: String?) = line1(JsonField.ofNullable(line1)) - fun line1(line1: Optional) = line1(line1.orElse(null)) + fun line1(line1: Optional) = line1(line1.getOrNull()) fun line1(line1: JsonField) = apply { this.line1 = line1 } fun line2(line2: String?) = line2(JsonField.ofNullable(line2)) - fun line2(line2: Optional) = line2(line2.orElse(null)) + fun line2(line2: Optional) = line2(line2.getOrNull()) fun line2(line2: JsonField) = apply { this.line2 = line2 } fun postalCode(postalCode: String?) = postalCode(JsonField.ofNullable(postalCode)) - fun postalCode(postalCode: Optional) = postalCode(postalCode.orElse(null)) + fun postalCode(postalCode: Optional) = postalCode(postalCode.getOrNull()) fun postalCode(postalCode: JsonField) = apply { this.postalCode = postalCode } fun state(state: String?) = state(JsonField.ofNullable(state)) - fun state(state: Optional) = state(state.orElse(null)) + fun state(state: Optional) = state(state.getOrNull()) fun state(state: JsonField) = apply { this.state = state } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceCreateParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceCreateParams.kt index 3a1b0eb5..40520717 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceCreateParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceCreateParams.kt @@ -24,6 +24,7 @@ import java.time.LocalDate import java.time.OffsetDateTime import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull /** This endpoint is used to create a one-off invoice for a customer. */ class InvoiceCreateParams @@ -433,7 +434,7 @@ private constructor( * The id of the `Customer` to create this invoice for. One of `customer_id` and * `external_customer_id` are required. */ - fun customerId(customerId: Optional) = customerId(customerId.orElse(null)) + fun customerId(customerId: Optional) = customerId(customerId.getOrNull()) /** * The id of the `Customer` to create this invoice for. One of `customer_id` and @@ -445,7 +446,7 @@ private constructor( fun discount(discount: Discount?) = discount(JsonField.ofNullable(discount)) /** An optional discount to attach to the invoice. */ - fun discount(discount: Optional) = discount(discount.orElse(null)) + fun discount(discount: Optional) = discount(discount.getOrNull()) /** An optional discount to attach to the invoice. */ fun discount(discount: JsonField) = apply { this.discount = discount } @@ -484,7 +485,7 @@ private constructor( * `customer_id` and `external_customer_id` are required. */ fun externalCustomerId(externalCustomerId: Optional) = - externalCustomerId(externalCustomerId.orElse(null)) + externalCustomerId(externalCustomerId.getOrNull()) /** * The `external_customer_id` of the `Customer` to create this invoice for. One of @@ -498,7 +499,7 @@ private constructor( fun memo(memo: String?) = memo(JsonField.ofNullable(memo)) /** An optional memo to attach to the invoice. */ - fun memo(memo: Optional) = memo(memo.orElse(null)) + fun memo(memo: Optional) = memo(memo.getOrNull()) /** An optional memo to attach to the invoice. */ fun memo(memo: JsonField) = apply { this.memo = memo } @@ -515,7 +516,7 @@ private constructor( * setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed by @@ -678,7 +679,7 @@ private constructor( * The id of the `Customer` to create this invoice for. One of `customer_id` and * `external_customer_id` are required. */ - fun customerId(customerId: Optional) = customerId(customerId.orElse(null)) + fun customerId(customerId: Optional) = customerId(customerId.getOrNull()) /** * The id of the `Customer` to create this invoice for. One of `customer_id` and @@ -690,7 +691,7 @@ private constructor( fun discount(discount: Discount?) = apply { body.discount(discount) } /** An optional discount to attach to the invoice. */ - fun discount(discount: Optional) = discount(discount.orElse(null)) + fun discount(discount: Optional) = discount(discount.getOrNull()) /** An optional discount to attach to the invoice. */ fun discount(discount: JsonField) = apply { body.discount(discount) } @@ -725,7 +726,7 @@ private constructor( * `customer_id` and `external_customer_id` are required. */ fun externalCustomerId(externalCustomerId: Optional) = - externalCustomerId(externalCustomerId.orElse(null)) + externalCustomerId(externalCustomerId.getOrNull()) /** * The `external_customer_id` of the `Customer` to create this invoice for. One of @@ -739,7 +740,7 @@ private constructor( fun memo(memo: String?) = apply { body.memo(memo) } /** An optional memo to attach to the invoice. */ - fun memo(memo: Optional) = memo(memo.orElse(null)) + fun memo(memo: Optional) = memo(memo.getOrNull()) /** An optional memo to attach to the invoice. */ fun memo(memo: JsonField) = apply { body.memo(memo) } @@ -756,7 +757,7 @@ private constructor( * setting the value to `null`, and the entire metadata mapping can be cleared by setting * `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed by diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceFetchUpcomingResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceFetchUpcomingResponse.kt index 462dde29..790cfa2e 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceFetchUpcomingResponse.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceFetchUpcomingResponse.kt @@ -967,7 +967,7 @@ private constructor( billingAddress(JsonField.ofNullable(billingAddress)) fun billingAddress(billingAddress: Optional) = - billingAddress(billingAddress.orElse(null)) + billingAddress(billingAddress.getOrNull()) fun billingAddress(billingAddress: JsonField) = apply { this.billingAddress = billingAddress @@ -1241,7 +1241,7 @@ private constructor( * |Vietnam |`vn_tin` |Vietnamese Tax ID Number | */ fun customerTaxId(customerTaxId: Optional) = - customerTaxId(customerTaxId.orElse(null)) + customerTaxId(customerTaxId.getOrNull()) /** * Tax IDs are commonly required to be displayed on customer invoices, which are added to @@ -1399,7 +1399,7 @@ private constructor( * When the invoice payment is due. The due date is null if the invoice is not yet * finalized. */ - fun dueDate(dueDate: Optional) = dueDate(dueDate.orElse(null)) + fun dueDate(dueDate: Optional) = dueDate(dueDate.getOrNull()) /** * When the invoice payment is due. The due date is null if the invoice is not yet @@ -1421,7 +1421,7 @@ private constructor( * will automatically begin issuing at this time. */ fun eligibleToIssueAt(eligibleToIssueAt: Optional) = - eligibleToIssueAt(eligibleToIssueAt.orElse(null)) + eligibleToIssueAt(eligibleToIssueAt.getOrNull()) /** * If the invoice has a status of `draft`, this will be the time that the invoice will be @@ -1444,7 +1444,7 @@ private constructor( * invoice's due date, or 60 days after being re-generated through the UI. */ fun hostedInvoiceUrl(hostedInvoiceUrl: Optional) = - hostedInvoiceUrl(hostedInvoiceUrl.orElse(null)) + hostedInvoiceUrl(hostedInvoiceUrl.getOrNull()) /** * A URL for the customer-facing invoice portal. This URL expires 30 days after the @@ -1472,7 +1472,7 @@ private constructor( fun invoicePdf(invoicePdf: String?) = invoicePdf(JsonField.ofNullable(invoicePdf)) /** The link to download the PDF representation of the `Invoice`. */ - fun invoicePdf(invoicePdf: Optional) = invoicePdf(invoicePdf.orElse(null)) + fun invoicePdf(invoicePdf: Optional) = invoicePdf(invoicePdf.getOrNull()) /** The link to download the PDF representation of the `Invoice`. */ fun invoicePdf(invoicePdf: JsonField) = apply { this.invoicePdf = invoicePdf } @@ -1495,7 +1495,7 @@ private constructor( * is now in a different state.) */ fun issueFailedAt(issueFailedAt: Optional) = - issueFailedAt(issueFailedAt.orElse(null)) + issueFailedAt(issueFailedAt.getOrNull()) /** * If the invoice failed to issue, this will be the last time it failed to issue (even if it @@ -1515,7 +1515,7 @@ private constructor( * If the invoice has been issued, this will be the time it transitioned to `issued` (even * if it is now in a different state.) */ - fun issuedAt(issuedAt: Optional) = issuedAt(issuedAt.orElse(null)) + fun issuedAt(issuedAt: Optional) = issuedAt(issuedAt.getOrNull()) /** * If the invoice has been issued, this will be the time it transitioned to `issued` (even @@ -1541,7 +1541,7 @@ private constructor( fun maximum(maximum: Maximum?) = maximum(JsonField.ofNullable(maximum)) - fun maximum(maximum: Optional) = maximum(maximum.orElse(null)) + fun maximum(maximum: Optional) = maximum(maximum.getOrNull()) fun maximum(maximum: JsonField) = apply { this.maximum = maximum } @@ -1549,7 +1549,7 @@ private constructor( maximumAmount(JsonField.ofNullable(maximumAmount)) fun maximumAmount(maximumAmount: Optional) = - maximumAmount(maximumAmount.orElse(null)) + maximumAmount(maximumAmount.getOrNull()) fun maximumAmount(maximumAmount: JsonField) = apply { this.maximumAmount = maximumAmount @@ -1559,7 +1559,7 @@ private constructor( fun memo(memo: String?) = memo(JsonField.ofNullable(memo)) /** Free-form text which is available on the invoice PDF and the Orb invoice portal. */ - fun memo(memo: Optional) = memo(memo.orElse(null)) + fun memo(memo: Optional) = memo(memo.getOrNull()) /** Free-form text which is available on the invoice PDF and the Orb invoice portal. */ fun memo(memo: JsonField) = apply { this.memo = memo } @@ -1580,7 +1580,7 @@ private constructor( fun minimum(minimum: Minimum?) = minimum(JsonField.ofNullable(minimum)) - fun minimum(minimum: Optional) = minimum(minimum.orElse(null)) + fun minimum(minimum: Optional) = minimum(minimum.getOrNull()) fun minimum(minimum: JsonField) = apply { this.minimum = minimum } @@ -1588,7 +1588,7 @@ private constructor( minimumAmount(JsonField.ofNullable(minimumAmount)) fun minimumAmount(minimumAmount: Optional) = - minimumAmount(minimumAmount.orElse(null)) + minimumAmount(minimumAmount.getOrNull()) fun minimumAmount(minimumAmount: JsonField) = apply { this.minimumAmount = minimumAmount @@ -1602,7 +1602,7 @@ private constructor( /** * If the invoice has a status of `paid`, this gives a timestamp when the invoice was paid. */ - fun paidAt(paidAt: Optional) = paidAt(paidAt.orElse(null)) + fun paidAt(paidAt: Optional) = paidAt(paidAt.getOrNull()) /** * If the invoice has a status of `paid`, this gives a timestamp when the invoice was paid. @@ -1638,7 +1638,7 @@ private constructor( * recent attempt. */ fun paymentFailedAt(paymentFailedAt: Optional) = - paymentFailedAt(paymentFailedAt.orElse(null)) + paymentFailedAt(paymentFailedAt.getOrNull()) /** * If payment was attempted on this invoice but failed, this will be the time of the most @@ -1662,7 +1662,7 @@ private constructor( * (like bank transfers), where payment can take 3 days or more. */ fun paymentStartedAt(paymentStartedAt: Optional) = - paymentStartedAt(paymentStartedAt.orElse(null)) + paymentStartedAt(paymentStartedAt.getOrNull()) /** * If payment was attempted on this invoice, this will be the start time of the most recent @@ -1685,7 +1685,7 @@ private constructor( * be issued. */ fun scheduledIssueAt(scheduledIssueAt: Optional) = - scheduledIssueAt(scheduledIssueAt.orElse(null)) + scheduledIssueAt(scheduledIssueAt.getOrNull()) /** * If the invoice is in draft, this timestamp will reflect when the invoice is scheduled to @@ -1699,7 +1699,7 @@ private constructor( shippingAddress(JsonField.ofNullable(shippingAddress)) fun shippingAddress(shippingAddress: Optional) = - shippingAddress(shippingAddress.orElse(null)) + shippingAddress(shippingAddress.getOrNull()) fun shippingAddress(shippingAddress: JsonField) = apply { this.shippingAddress = shippingAddress @@ -1713,7 +1713,7 @@ private constructor( subscription(JsonField.ofNullable(subscription)) fun subscription(subscription: Optional) = - subscription(subscription.orElse(null)) + subscription(subscription.getOrNull()) fun subscription(subscription: JsonField) = apply { this.subscription = subscription @@ -1737,7 +1737,7 @@ private constructor( * sync was attempted. This field will always be `null` for invoices using Orb Invoicing. */ fun syncFailedAt(syncFailedAt: Optional) = - syncFailedAt(syncFailedAt.orElse(null)) + syncFailedAt(syncFailedAt.getOrNull()) /** * If the invoice failed to sync, this will be the last time an external invoicing provider @@ -1771,7 +1771,7 @@ private constructor( * If the invoice has a status of `void`, this gives a timestamp when the invoice was * voided. */ - fun voidedAt(voidedAt: Optional) = voidedAt(voidedAt.orElse(null)) + fun voidedAt(voidedAt: Optional) = voidedAt(voidedAt.getOrNull()) /** * If the invoice has a status of `void`, this gives a timestamp when the invoice was @@ -1997,8 +1997,7 @@ private constructor( fun enabled(enabled: Boolean) = enabled(enabled as Boolean?) /** True only if auto-collection is enabled for this invoice. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun enabled(enabled: Optional) = enabled(enabled.orElse(null) as Boolean?) + fun enabled(enabled: Optional) = enabled(enabled.getOrNull()) /** True only if auto-collection is enabled for this invoice. */ fun enabled(enabled: JsonField) = apply { this.enabled = enabled } @@ -2017,7 +2016,7 @@ private constructor( * enabled for this invoice, this field will be `null`. */ fun nextAttemptAt(nextAttemptAt: Optional) = - nextAttemptAt(nextAttemptAt.orElse(null)) + nextAttemptAt(nextAttemptAt.getOrNull()) /** * If the invoice is scheduled for auto-collection, this field will reflect when the @@ -2035,9 +2034,7 @@ private constructor( fun numAttempts(numAttempts: Long) = numAttempts(numAttempts as Long?) /** Number of auto-collection payment attempts. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun numAttempts(numAttempts: Optional) = - numAttempts(numAttempts.orElse(null) as Long?) + fun numAttempts(numAttempts: Optional) = numAttempts(numAttempts.getOrNull()) /** Number of auto-collection payment attempts. */ fun numAttempts(numAttempts: JsonField) = apply { this.numAttempts = numAttempts } @@ -2062,7 +2059,7 @@ private constructor( * `next_attempt_time` is null). */ fun previouslyAttemptedAt(previouslyAttemptedAt: Optional) = - previouslyAttemptedAt(previouslyAttemptedAt.orElse(null)) + previouslyAttemptedAt(previouslyAttemptedAt.getOrNull()) /** * If Orb has ever attempted payment auto-collection for this invoice, this field will @@ -2240,37 +2237,37 @@ private constructor( fun city(city: String?) = city(JsonField.ofNullable(city)) - fun city(city: Optional) = city(city.orElse(null)) + fun city(city: Optional) = city(city.getOrNull()) fun city(city: JsonField) = apply { this.city = city } fun country(country: String?) = country(JsonField.ofNullable(country)) - fun country(country: Optional) = country(country.orElse(null)) + fun country(country: Optional) = country(country.getOrNull()) fun country(country: JsonField) = apply { this.country = country } fun line1(line1: String?) = line1(JsonField.ofNullable(line1)) - fun line1(line1: Optional) = line1(line1.orElse(null)) + fun line1(line1: Optional) = line1(line1.getOrNull()) fun line1(line1: JsonField) = apply { this.line1 = line1 } fun line2(line2: String?) = line2(JsonField.ofNullable(line2)) - fun line2(line2: Optional) = line2(line2.orElse(null)) + fun line2(line2: Optional) = line2(line2.getOrNull()) fun line2(line2: JsonField) = apply { this.line2 = line2 } fun postalCode(postalCode: String?) = postalCode(JsonField.ofNullable(postalCode)) - fun postalCode(postalCode: Optional) = postalCode(postalCode.orElse(null)) + fun postalCode(postalCode: Optional) = postalCode(postalCode.getOrNull()) fun postalCode(postalCode: JsonField) = apply { this.postalCode = postalCode } fun state(state: String?) = state(JsonField.ofNullable(state)) - fun state(state: Optional) = state(state.orElse(null)) + fun state(state: Optional) = state(state.getOrNull()) fun state(state: JsonField) = apply { this.state = state } @@ -2474,7 +2471,7 @@ private constructor( fun memo(memo: String?) = memo(JsonField.ofNullable(memo)) /** An optional memo supplied on the credit note. */ - fun memo(memo: Optional) = memo(memo.orElse(null)) + fun memo(memo: Optional) = memo(memo.getOrNull()) /** An optional memo supplied on the credit note. */ fun memo(memo: JsonField) = apply { this.memo = memo } @@ -2501,7 +2498,7 @@ private constructor( * If the credit note has a status of `void`, this gives a timestamp when the credit * note was voided. */ - fun voidedAt(voidedAt: Optional) = voidedAt(voidedAt.orElse(null)) + fun voidedAt(voidedAt: Optional) = voidedAt(voidedAt.getOrNull()) /** * If the credit note has a status of `void`, this gives a timestamp when the credit @@ -2636,7 +2633,7 @@ private constructor( externalCustomerId(JsonField.ofNullable(externalCustomerId)) fun externalCustomerId(externalCustomerId: Optional) = - externalCustomerId(externalCustomerId.orElse(null)) + externalCustomerId(externalCustomerId.getOrNull()) fun externalCustomerId(externalCustomerId: JsonField) = apply { this.externalCustomerId = externalCustomerId @@ -2903,7 +2900,7 @@ private constructor( fun creditNote(creditNote: CreditNote?) = creditNote(JsonField.ofNullable(creditNote)) - fun creditNote(creditNote: Optional) = creditNote(creditNote.orElse(null)) + fun creditNote(creditNote: Optional) = creditNote(creditNote.getOrNull()) fun creditNote(creditNote: JsonField) = apply { this.creditNote = creditNote @@ -2913,7 +2910,7 @@ private constructor( fun description(description: String?) = description(JsonField.ofNullable(description)) /** An optional description provided for manual customer balance adjustments. */ - fun description(description: Optional) = description(description.orElse(null)) + fun description(description: Optional) = description(description.getOrNull()) /** An optional description provided for manual customer balance adjustments. */ fun description(description: JsonField) = apply { @@ -2936,7 +2933,7 @@ private constructor( fun invoice(invoice: Invoice?) = invoice(JsonField.ofNullable(invoice)) - fun invoice(invoice: Optional) = invoice(invoice.orElse(null)) + fun invoice(invoice: Optional) = invoice(invoice.getOrNull()) fun invoice(invoice: JsonField) = apply { this.invoice = invoice } @@ -5427,7 +5424,7 @@ private constructor( fun discount(discount: Discount?) = discount(JsonField.ofNullable(discount)) - fun discount(discount: Optional) = discount(discount.orElse(null)) + fun discount(discount: Optional) = discount(discount.getOrNull()) fun discount(discount: JsonField) = apply { this.discount = discount } @@ -5458,7 +5455,7 @@ private constructor( fun filter(filter: String?) = filter(JsonField.ofNullable(filter)) /** An additional filter that was used to calculate the usage for this line item. */ - fun filter(filter: Optional) = filter(filter.orElse(null)) + fun filter(filter: Optional) = filter(filter.getOrNull()) /** An additional filter that was used to calculate the usage for this line item. */ fun filter(filter: JsonField) = apply { this.filter = filter } @@ -5475,7 +5472,7 @@ private constructor( * populated with the key and a value. The `amount` and `subtotal` will be the values * for this particular grouping. */ - fun grouping(grouping: Optional) = grouping(grouping.orElse(null)) + fun grouping(grouping: Optional) = grouping(grouping.getOrNull()) /** * [DEPRECATED] For configured prices that are split by a grouping key, this will be @@ -5490,7 +5487,7 @@ private constructor( /** This field is deprecated in favor of `adjustments`. */ @Deprecated("deprecated") - fun maximum(maximum: Optional) = maximum(maximum.orElse(null)) + fun maximum(maximum: Optional) = maximum(maximum.getOrNull()) /** This field is deprecated in favor of `adjustments`. */ @Deprecated("deprecated") @@ -5504,7 +5501,7 @@ private constructor( /** This field is deprecated in favor of `adjustments`. */ @Deprecated("deprecated") fun maximumAmount(maximumAmount: Optional) = - maximumAmount(maximumAmount.orElse(null)) + maximumAmount(maximumAmount.getOrNull()) /** This field is deprecated in favor of `adjustments`. */ @Deprecated("deprecated") @@ -5518,7 +5515,7 @@ private constructor( /** This field is deprecated in favor of `adjustments`. */ @Deprecated("deprecated") - fun minimum(minimum: Optional) = minimum(minimum.orElse(null)) + fun minimum(minimum: Optional) = minimum(minimum.getOrNull()) /** This field is deprecated in favor of `adjustments`. */ @Deprecated("deprecated") @@ -5532,7 +5529,7 @@ private constructor( /** This field is deprecated in favor of `adjustments`. */ @Deprecated("deprecated") fun minimumAmount(minimumAmount: Optional) = - minimumAmount(minimumAmount.orElse(null)) + minimumAmount(minimumAmount.getOrNull()) /** This field is deprecated in favor of `adjustments`. */ @Deprecated("deprecated") @@ -5581,7 +5578,7 @@ private constructor( * For more on the types of prices, see * [the core concepts documentation](/core-concepts#plan-and-price) */ - fun price(price: Optional) = price(price.orElse(null)) + fun price(price: Optional) = price(price.getOrNull()) /** * The Price resource represents a price that can be billed on a subscription, resulting @@ -6107,7 +6104,7 @@ private constructor( /** A list of customer ids that were used to calculate the usage for this line item. */ fun usageCustomerIds(usageCustomerIds: Optional>) = - usageCustomerIds(usageCustomerIds.orElse(null)) + usageCustomerIds(usageCustomerIds.getOrNull()) /** A list of customer ids that were used to calculate the usage for this line item. */ fun usageCustomerIds(usageCustomerIds: JsonField>) = apply { @@ -6668,7 +6665,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -7074,7 +7071,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -7466,7 +7463,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -7875,7 +7872,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -8266,7 +8263,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -9072,7 +9069,7 @@ private constructor( fun grouping(grouping: Grouping?) = grouping(JsonField.ofNullable(grouping)) - fun grouping(grouping: Optional) = grouping(grouping.orElse(null)) + fun grouping(grouping: Optional) = grouping(grouping.getOrNull()) fun grouping(grouping: JsonField) = apply { this.grouping = grouping } @@ -9208,7 +9205,7 @@ private constructor( fun value(value: String?) = value(JsonField.ofNullable(value)) /** No value indicates the default group */ - fun value(value: Optional) = value(value.orElse(null)) + fun value(value: Optional) = value(value.getOrNull()) /** No value indicates the default group */ fun value(value: JsonField) = apply { this.value = value } @@ -9637,7 +9634,7 @@ private constructor( fun grouping(grouping: Grouping?) = grouping(JsonField.ofNullable(grouping)) - fun grouping(grouping: Optional) = grouping(grouping.orElse(null)) + fun grouping(grouping: Optional) = grouping(grouping.getOrNull()) fun grouping(grouping: JsonField) = apply { this.grouping = grouping } @@ -9772,7 +9769,7 @@ private constructor( fun value(value: String?) = value(JsonField.ofNullable(value)) /** No value indicates the default group */ - fun value(value: Optional) = value(value.orElse(null)) + fun value(value: Optional) = value(value.getOrNull()) /** No value indicates the default group */ fun value(value: JsonField) = apply { this.value = value } @@ -9922,11 +9919,7 @@ private constructor( fun lastUnit(lastUnit: Double) = lastUnit(lastUnit as Double?) - @Suppress( - "USELESS_CAST" - ) // See https://youtrack.jetbrains.com/issue/KT-74228 - fun lastUnit(lastUnit: Optional) = - lastUnit(lastUnit.orElse(null) as Double?) + fun lastUnit(lastUnit: Optional) = lastUnit(lastUnit.getOrNull()) fun lastUnit(lastUnit: JsonField) = apply { this.lastUnit = lastUnit @@ -10220,7 +10213,7 @@ private constructor( fun grouping(grouping: Grouping?) = grouping(JsonField.ofNullable(grouping)) - fun grouping(grouping: Optional) = grouping(grouping.orElse(null)) + fun grouping(grouping: Optional) = grouping(grouping.getOrNull()) fun grouping(grouping: JsonField) = apply { this.grouping = grouping } @@ -10348,7 +10341,7 @@ private constructor( fun value(value: String?) = value(JsonField.ofNullable(value)) /** No value indicates the default group */ - fun value(value: Optional) = value(value.orElse(null)) + fun value(value: Optional) = value(value.getOrNull()) /** No value indicates the default group */ fun value(value: JsonField) = apply { this.value = value } @@ -10631,7 +10624,7 @@ private constructor( /** The tax rate percentage, out of 100. */ fun taxRatePercentage(taxRatePercentage: Optional) = - taxRatePercentage(taxRatePercentage.orElse(null)) + taxRatePercentage(taxRatePercentage.getOrNull()) /** The tax rate percentage, out of 100. */ fun taxRatePercentage(taxRatePercentage: JsonField) = apply { @@ -11269,7 +11262,7 @@ private constructor( /** The payment provider that attempted to collect the payment. */ fun paymentProvider(paymentProvider: Optional) = - paymentProvider(paymentProvider.orElse(null)) + paymentProvider(paymentProvider.getOrNull()) /** The payment provider that attempted to collect the payment. */ fun paymentProvider(paymentProvider: JsonField) = apply { @@ -11282,7 +11275,7 @@ private constructor( /** The ID of the payment attempt in the payment provider. */ fun paymentProviderId(paymentProviderId: Optional) = - paymentProviderId(paymentProviderId.orElse(null)) + paymentProviderId(paymentProviderId.getOrNull()) /** The ID of the payment attempt in the payment provider. */ fun paymentProviderId(paymentProviderId: JsonField) = apply { @@ -11559,37 +11552,37 @@ private constructor( fun city(city: String?) = city(JsonField.ofNullable(city)) - fun city(city: Optional) = city(city.orElse(null)) + fun city(city: Optional) = city(city.getOrNull()) fun city(city: JsonField) = apply { this.city = city } fun country(country: String?) = country(JsonField.ofNullable(country)) - fun country(country: Optional) = country(country.orElse(null)) + fun country(country: Optional) = country(country.getOrNull()) fun country(country: JsonField) = apply { this.country = country } fun line1(line1: String?) = line1(JsonField.ofNullable(line1)) - fun line1(line1: Optional) = line1(line1.orElse(null)) + fun line1(line1: Optional) = line1(line1.getOrNull()) fun line1(line1: JsonField) = apply { this.line1 = line1 } fun line2(line2: String?) = line2(JsonField.ofNullable(line2)) - fun line2(line2: Optional) = line2(line2.orElse(null)) + fun line2(line2: Optional) = line2(line2.getOrNull()) fun line2(line2: JsonField) = apply { this.line2 = line2 } fun postalCode(postalCode: String?) = postalCode(JsonField.ofNullable(postalCode)) - fun postalCode(postalCode: Optional) = postalCode(postalCode.orElse(null)) + fun postalCode(postalCode: Optional) = postalCode(postalCode.getOrNull()) fun postalCode(postalCode: JsonField) = apply { this.postalCode = postalCode } fun state(state: String?) = state(JsonField.ofNullable(state)) - fun state(state: Optional) = state(state.orElse(null)) + fun state(state: Optional) = state(state.getOrNull()) fun state(state: JsonField) = apply { this.state = state } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceLineItemCreateResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceLineItemCreateResponse.kt index a8da894d..1edfa82c 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceLineItemCreateResponse.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceLineItemCreateResponse.kt @@ -565,7 +565,7 @@ private constructor( fun discount(discount: Discount?) = discount(JsonField.ofNullable(discount)) - fun discount(discount: Optional) = discount(discount.orElse(null)) + fun discount(discount: Optional) = discount(discount.getOrNull()) fun discount(discount: JsonField) = apply { this.discount = discount } @@ -595,7 +595,7 @@ private constructor( fun filter(filter: String?) = filter(JsonField.ofNullable(filter)) /** An additional filter that was used to calculate the usage for this line item. */ - fun filter(filter: Optional) = filter(filter.orElse(null)) + fun filter(filter: Optional) = filter(filter.getOrNull()) /** An additional filter that was used to calculate the usage for this line item. */ fun filter(filter: JsonField) = apply { this.filter = filter } @@ -612,7 +612,7 @@ private constructor( * populated with the key and a value. The `amount` and `subtotal` will be the values for * this particular grouping. */ - fun grouping(grouping: Optional) = grouping(grouping.orElse(null)) + fun grouping(grouping: Optional) = grouping(grouping.getOrNull()) /** * [DEPRECATED] For configured prices that are split by a grouping key, this will be @@ -627,7 +627,7 @@ private constructor( /** This field is deprecated in favor of `adjustments`. */ @Deprecated("deprecated") - fun maximum(maximum: Optional) = maximum(maximum.orElse(null)) + fun maximum(maximum: Optional) = maximum(maximum.getOrNull()) /** This field is deprecated in favor of `adjustments`. */ @Deprecated("deprecated") @@ -641,7 +641,7 @@ private constructor( /** This field is deprecated in favor of `adjustments`. */ @Deprecated("deprecated") fun maximumAmount(maximumAmount: Optional) = - maximumAmount(maximumAmount.orElse(null)) + maximumAmount(maximumAmount.getOrNull()) /** This field is deprecated in favor of `adjustments`. */ @Deprecated("deprecated") @@ -655,7 +655,7 @@ private constructor( /** This field is deprecated in favor of `adjustments`. */ @Deprecated("deprecated") - fun minimum(minimum: Optional) = minimum(minimum.orElse(null)) + fun minimum(minimum: Optional) = minimum(minimum.getOrNull()) /** This field is deprecated in favor of `adjustments`. */ @Deprecated("deprecated") @@ -669,7 +669,7 @@ private constructor( /** This field is deprecated in favor of `adjustments`. */ @Deprecated("deprecated") fun minimumAmount(minimumAmount: Optional) = - minimumAmount(minimumAmount.orElse(null)) + minimumAmount(minimumAmount.getOrNull()) /** This field is deprecated in favor of `adjustments`. */ @Deprecated("deprecated") @@ -718,7 +718,7 @@ private constructor( * For more on the types of prices, see * [the core concepts documentation](/core-concepts#plan-and-price) */ - fun price(price: Optional) = price(price.orElse(null)) + fun price(price: Optional) = price(price.getOrNull()) /** * The Price resource represents a price that can be billed on a subscription, resulting in @@ -1241,7 +1241,7 @@ private constructor( /** A list of customer ids that were used to calculate the usage for this line item. */ fun usageCustomerIds(usageCustomerIds: Optional>) = - usageCustomerIds(usageCustomerIds.orElse(null)) + usageCustomerIds(usageCustomerIds.getOrNull()) /** A list of customer ids that were used to calculate the usage for this line item. */ fun usageCustomerIds(usageCustomerIds: JsonField>) = apply { @@ -1785,7 +1785,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -2190,7 +2190,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -2580,7 +2580,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -2985,7 +2985,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -3372,7 +3372,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -4156,7 +4156,7 @@ private constructor( fun grouping(grouping: Grouping?) = grouping(JsonField.ofNullable(grouping)) - fun grouping(grouping: Optional) = grouping(grouping.orElse(null)) + fun grouping(grouping: Optional) = grouping(grouping.getOrNull()) fun grouping(grouping: JsonField) = apply { this.grouping = grouping } @@ -4291,7 +4291,7 @@ private constructor( fun value(value: String?) = value(JsonField.ofNullable(value)) /** No value indicates the default group */ - fun value(value: Optional) = value(value.orElse(null)) + fun value(value: Optional) = value(value.getOrNull()) /** No value indicates the default group */ fun value(value: JsonField) = apply { this.value = value } @@ -4714,7 +4714,7 @@ private constructor( fun grouping(grouping: Grouping?) = grouping(JsonField.ofNullable(grouping)) - fun grouping(grouping: Optional) = grouping(grouping.orElse(null)) + fun grouping(grouping: Optional) = grouping(grouping.getOrNull()) fun grouping(grouping: JsonField) = apply { this.grouping = grouping } @@ -4848,7 +4848,7 @@ private constructor( fun value(value: String?) = value(JsonField.ofNullable(value)) /** No value indicates the default group */ - fun value(value: Optional) = value(value.orElse(null)) + fun value(value: Optional) = value(value.getOrNull()) /** No value indicates the default group */ fun value(value: JsonField) = apply { this.value = value } @@ -4997,9 +4997,7 @@ private constructor( fun lastUnit(lastUnit: Double) = lastUnit(lastUnit as Double?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun lastUnit(lastUnit: Optional) = - lastUnit(lastUnit.orElse(null) as Double?) + fun lastUnit(lastUnit: Optional) = lastUnit(lastUnit.getOrNull()) fun lastUnit(lastUnit: JsonField) = apply { this.lastUnit = lastUnit } @@ -5287,7 +5285,7 @@ private constructor( fun grouping(grouping: Grouping?) = grouping(JsonField.ofNullable(grouping)) - fun grouping(grouping: Optional) = grouping(grouping.orElse(null)) + fun grouping(grouping: Optional) = grouping(grouping.getOrNull()) fun grouping(grouping: JsonField) = apply { this.grouping = grouping } @@ -5414,7 +5412,7 @@ private constructor( fun value(value: String?) = value(JsonField.ofNullable(value)) /** No value indicates the default group */ - fun value(value: Optional) = value(value.orElse(null)) + fun value(value: Optional) = value(value.getOrNull()) /** No value indicates the default group */ fun value(value: JsonField) = apply { this.value = value } @@ -5694,7 +5692,7 @@ private constructor( /** The tax rate percentage, out of 100. */ fun taxRatePercentage(taxRatePercentage: Optional) = - taxRatePercentage(taxRatePercentage.orElse(null)) + taxRatePercentage(taxRatePercentage.getOrNull()) /** The tax rate percentage, out of 100. */ fun taxRatePercentage(taxRatePercentage: JsonField) = apply { diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceListPage.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceListPage.kt index c1b655d3..87f73707 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceListPage.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceListPage.kt @@ -18,6 +18,7 @@ import java.util.Objects import java.util.Optional import java.util.stream.Stream import java.util.stream.StreamSupport +import kotlin.jvm.optionals.getOrNull /** * This endpoint returns a list of all [`Invoice`](/core-concepts#invoice)s for an account in a list @@ -194,7 +195,7 @@ private constructor( while (index < page.data().size) { yield(page.data()[index++]) } - page = page.getNextPage().orElse(null) ?: break + page = page.getNextPage().getOrNull() ?: break index = 0 } } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceListParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceListParams.kt index d93c005d..9e151647 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceListParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceListParams.kt @@ -16,6 +16,7 @@ import java.time.OffsetDateTime import java.time.format.DateTimeFormatter import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull /** * This endpoint returns a list of all [`Invoice`](/core-concepts#invoice)s for an account in a list @@ -220,15 +221,15 @@ private constructor( fun amount(amount: String?) = apply { this.amount = amount } - fun amount(amount: Optional) = amount(amount.orElse(null)) + fun amount(amount: Optional) = amount(amount.getOrNull()) fun amountGt(amountGt: String?) = apply { this.amountGt = amountGt } - fun amountGt(amountGt: Optional) = amountGt(amountGt.orElse(null)) + fun amountGt(amountGt: Optional) = amountGt(amountGt.getOrNull()) fun amountLt(amountLt: String?) = apply { this.amountLt = amountLt } - fun amountLt(amountLt: Optional) = amountLt(amountLt.orElse(null)) + fun amountLt(amountLt: Optional) = amountLt(amountLt.getOrNull()) /** * Cursor for pagination. This can be populated by the `next_cursor` value returned from the @@ -240,19 +241,19 @@ private constructor( * Cursor for pagination. This can be populated by the `next_cursor` value returned from the * initial request. */ - fun cursor(cursor: Optional) = cursor(cursor.orElse(null)) + fun cursor(cursor: Optional) = cursor(cursor.getOrNull()) fun customerId(customerId: String?) = apply { this.customerId = customerId } - fun customerId(customerId: Optional) = customerId(customerId.orElse(null)) + fun customerId(customerId: Optional) = customerId(customerId.getOrNull()) fun dateType(dateType: DateType?) = apply { this.dateType = dateType } - fun dateType(dateType: Optional) = dateType(dateType.orElse(null)) + fun dateType(dateType: Optional) = dateType(dateType.getOrNull()) fun dueDate(dueDate: LocalDate?) = apply { this.dueDate = dueDate } - fun dueDate(dueDate: Optional) = dueDate(dueDate.orElse(null)) + fun dueDate(dueDate: Optional) = dueDate(dueDate.getOrNull()) /** * Filters invoices by their due dates within a specific time range in the past. Specify the @@ -267,58 +268,56 @@ private constructor( * invoices due in the last 7 days, and '2m' filters those due in the last 2 months. */ fun dueDateWindow(dueDateWindow: Optional) = - dueDateWindow(dueDateWindow.orElse(null)) + dueDateWindow(dueDateWindow.getOrNull()) fun dueDateGt(dueDateGt: LocalDate?) = apply { this.dueDateGt = dueDateGt } - fun dueDateGt(dueDateGt: Optional) = dueDateGt(dueDateGt.orElse(null)) + fun dueDateGt(dueDateGt: Optional) = dueDateGt(dueDateGt.getOrNull()) fun dueDateLt(dueDateLt: LocalDate?) = apply { this.dueDateLt = dueDateLt } - fun dueDateLt(dueDateLt: Optional) = dueDateLt(dueDateLt.orElse(null)) + fun dueDateLt(dueDateLt: Optional) = dueDateLt(dueDateLt.getOrNull()) fun externalCustomerId(externalCustomerId: String?) = apply { this.externalCustomerId = externalCustomerId } fun externalCustomerId(externalCustomerId: Optional) = - externalCustomerId(externalCustomerId.orElse(null)) + externalCustomerId(externalCustomerId.getOrNull()) fun invoiceDateGt(invoiceDateGt: OffsetDateTime?) = apply { this.invoiceDateGt = invoiceDateGt } fun invoiceDateGt(invoiceDateGt: Optional) = - invoiceDateGt(invoiceDateGt.orElse(null)) + invoiceDateGt(invoiceDateGt.getOrNull()) fun invoiceDateGte(invoiceDateGte: OffsetDateTime?) = apply { this.invoiceDateGte = invoiceDateGte } fun invoiceDateGte(invoiceDateGte: Optional) = - invoiceDateGte(invoiceDateGte.orElse(null)) + invoiceDateGte(invoiceDateGte.getOrNull()) fun invoiceDateLt(invoiceDateLt: OffsetDateTime?) = apply { this.invoiceDateLt = invoiceDateLt } fun invoiceDateLt(invoiceDateLt: Optional) = - invoiceDateLt(invoiceDateLt.orElse(null)) + invoiceDateLt(invoiceDateLt.getOrNull()) fun invoiceDateLte(invoiceDateLte: OffsetDateTime?) = apply { this.invoiceDateLte = invoiceDateLte } fun invoiceDateLte(invoiceDateLte: Optional) = - invoiceDateLte(invoiceDateLte.orElse(null)) + invoiceDateLte(invoiceDateLte.getOrNull()) fun isRecurring(isRecurring: Boolean?) = apply { this.isRecurring = isRecurring } fun isRecurring(isRecurring: Boolean) = isRecurring(isRecurring as Boolean?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun isRecurring(isRecurring: Optional) = - isRecurring(isRecurring.orElse(null) as Boolean?) + fun isRecurring(isRecurring: Optional) = isRecurring(isRecurring.getOrNull()) /** The number of items to fetch. Defaults to 20. */ fun limit(limit: Long?) = apply { this.limit = limit } @@ -327,12 +326,11 @@ private constructor( fun limit(limit: Long) = limit(limit as Long?) /** The number of items to fetch. Defaults to 20. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun limit(limit: Optional) = limit(limit.orElse(null) as Long?) + fun limit(limit: Optional) = limit(limit.getOrNull()) fun status(status: List?) = apply { this.status = status?.toMutableList() } - fun status(status: Optional>) = status(status.orElse(null)) + fun status(status: Optional>) = status(status.getOrNull()) fun addStatus(status: Status) = apply { this.status = (this.status ?: mutableListOf()).apply { add(status) } @@ -341,7 +339,7 @@ private constructor( fun subscriptionId(subscriptionId: String?) = apply { this.subscriptionId = subscriptionId } fun subscriptionId(subscriptionId: Optional) = - subscriptionId(subscriptionId.orElse(null)) + subscriptionId(subscriptionId.getOrNull()) fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceMarkPaidParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceMarkPaidParams.kt index 8c0d0a75..b08a411c 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceMarkPaidParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceMarkPaidParams.kt @@ -20,6 +20,7 @@ import com.withorb.api.core.toImmutable import java.time.LocalDate import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull /** * This endpoint allows an invoice's status to be set the `paid` status. This can only be done to @@ -174,7 +175,7 @@ private constructor( fun externalId(externalId: String?) = externalId(JsonField.ofNullable(externalId)) /** An optional external ID to associate with the payment. */ - fun externalId(externalId: Optional) = externalId(externalId.orElse(null)) + fun externalId(externalId: Optional) = externalId(externalId.getOrNull()) /** An optional external ID to associate with the payment. */ fun externalId(externalId: JsonField) = apply { this.externalId = externalId } @@ -183,7 +184,7 @@ private constructor( fun notes(notes: String?) = notes(JsonField.ofNullable(notes)) /** An optional note to associate with the payment. */ - fun notes(notes: Optional) = notes(notes.orElse(null)) + fun notes(notes: Optional) = notes(notes.getOrNull()) /** An optional note to associate with the payment. */ fun notes(notes: JsonField) = apply { this.notes = notes } @@ -283,7 +284,7 @@ private constructor( fun externalId(externalId: String?) = apply { body.externalId(externalId) } /** An optional external ID to associate with the payment. */ - fun externalId(externalId: Optional) = externalId(externalId.orElse(null)) + fun externalId(externalId: Optional) = externalId(externalId.getOrNull()) /** An optional external ID to associate with the payment. */ fun externalId(externalId: JsonField) = apply { body.externalId(externalId) } @@ -292,7 +293,7 @@ private constructor( fun notes(notes: String?) = apply { body.notes(notes) } /** An optional note to associate with the payment. */ - fun notes(notes: Optional) = notes(notes.orElse(null)) + fun notes(notes: Optional) = notes(notes.getOrNull()) /** An optional note to associate with the payment. */ fun notes(notes: JsonField) = apply { body.notes(notes) } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceUpdateParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceUpdateParams.kt index dfe34da2..2ab21edb 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceUpdateParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceUpdateParams.kt @@ -19,6 +19,7 @@ import com.withorb.api.core.immutableEmptyMap import com.withorb.api.core.toImmutable import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull /** * This endpoint allows you to update the `metadata` property on an invoice. If you pass null for @@ -141,7 +142,7 @@ private constructor( * setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed by @@ -236,7 +237,7 @@ private constructor( * setting the value to `null`, and the entire metadata mapping can be cleared by setting * `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed by diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/ItemListPage.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/ItemListPage.kt index 270b8601..85318fb6 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/ItemListPage.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/ItemListPage.kt @@ -18,6 +18,7 @@ import java.util.Objects import java.util.Optional import java.util.stream.Stream import java.util.stream.StreamSupport +import kotlin.jvm.optionals.getOrNull /** This endpoint returns a list of all Items, ordered in descending order by creation time. */ class ItemListPage @@ -181,7 +182,7 @@ private constructor( while (index < page.data().size) { yield(page.data()[index++]) } - page = page.getNextPage().orElse(null) ?: break + page = page.getNextPage().getOrNull() ?: break index = 0 } } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/ItemListParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/ItemListParams.kt index 3872986b..bfd55b72 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/ItemListParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/ItemListParams.kt @@ -8,6 +8,7 @@ import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull /** This endpoint returns a list of all Items, ordered in descending order by creation time. */ class ItemListParams @@ -78,7 +79,7 @@ private constructor( * Cursor for pagination. This can be populated by the `next_cursor` value returned from the * initial request. */ - fun cursor(cursor: Optional) = cursor(cursor.orElse(null)) + fun cursor(cursor: Optional) = cursor(cursor.getOrNull()) /** The number of items to fetch. Defaults to 20. */ fun limit(limit: Long?) = apply { this.limit = limit } @@ -87,8 +88,7 @@ private constructor( fun limit(limit: Long) = limit(limit as Long?) /** The number of items to fetch. Defaults to 20. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun limit(limit: Optional) = limit(limit.orElse(null) as Long?) + fun limit(limit: Optional) = limit(limit.getOrNull()) fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/ItemUpdateParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/ItemUpdateParams.kt index 7e00919b..b0d78bac 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/ItemUpdateParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/ItemUpdateParams.kt @@ -22,6 +22,7 @@ import com.withorb.api.core.toImmutable import com.withorb.api.errors.OrbInvalidDataException import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull /** This endpoint can be used to update properties on the Item. */ class ItemUpdateParams @@ -133,7 +134,7 @@ private constructor( externalConnections(JsonField.ofNullable(externalConnections)) fun externalConnections(externalConnections: Optional>) = - externalConnections(externalConnections.orElse(null)) + externalConnections(externalConnections.getOrNull()) fun externalConnections(externalConnections: JsonField>) = apply { @@ -149,7 +150,7 @@ private constructor( fun name(name: String?) = name(JsonField.ofNullable(name)) - fun name(name: Optional) = name(name.orElse(null)) + fun name(name: Optional) = name(name.getOrNull()) fun name(name: JsonField) = apply { this.name = name } @@ -237,7 +238,7 @@ private constructor( } fun externalConnections(externalConnections: Optional>) = - externalConnections(externalConnections.orElse(null)) + externalConnections(externalConnections.getOrNull()) fun externalConnections(externalConnections: JsonField>) = apply { body.externalConnections(externalConnections) @@ -249,7 +250,7 @@ private constructor( fun name(name: String?) = apply { body.name(name) } - fun name(name: Optional) = name(name.orElse(null)) + fun name(name: Optional) = name(name.getOrNull()) fun name(name: JsonField) = apply { body.name(name) } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/MetricCreateParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/MetricCreateParams.kt index e7ac78a1..03fa406d 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/MetricCreateParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/MetricCreateParams.kt @@ -19,6 +19,7 @@ import com.withorb.api.core.immutableEmptyMap import com.withorb.api.core.toImmutable import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull /** * This endpoint is used to create a [metric](/core-concepts###metric) using a SQL string. See @@ -205,7 +206,7 @@ private constructor( fun description(description: String?) = description(JsonField.ofNullable(description)) /** A description of the metric. */ - fun description(description: Optional) = description(description.orElse(null)) + fun description(description: Optional) = description(description.getOrNull()) /** A description of the metric. */ fun description(description: JsonField) = apply { @@ -242,7 +243,7 @@ private constructor( * setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed by @@ -336,7 +337,7 @@ private constructor( fun description(description: String?) = apply { body.description(description) } /** A description of the metric. */ - fun description(description: Optional) = description(description.orElse(null)) + fun description(description: Optional) = description(description.getOrNull()) /** A description of the metric. */ fun description(description: JsonField) = apply { body.description(description) } @@ -371,7 +372,7 @@ private constructor( * setting the value to `null`, and the entire metadata mapping can be cleared by setting * `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed by diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/MetricListPage.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/MetricListPage.kt index 4961013a..d3c24188 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/MetricListPage.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/MetricListPage.kt @@ -18,6 +18,7 @@ import java.util.Objects import java.util.Optional import java.util.stream.Stream import java.util.stream.StreamSupport +import kotlin.jvm.optionals.getOrNull /** * This endpoint is used to fetch [metric](/core-concepts##metric) details given a metric @@ -184,7 +185,7 @@ private constructor( while (index < page.data().size) { yield(page.data()[index++]) } - page = page.getNextPage().orElse(null) ?: break + page = page.getNextPage().getOrNull() ?: break index = 0 } } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/MetricListParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/MetricListParams.kt index 6a372c3c..6fb13665 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/MetricListParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/MetricListParams.kt @@ -10,6 +10,7 @@ import java.time.OffsetDateTime import java.time.format.DateTimeFormatter import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull /** * This endpoint is used to fetch [metric](/core-concepts##metric) details given a metric @@ -120,22 +121,22 @@ private constructor( fun createdAtGt(createdAtGt: OffsetDateTime?) = apply { this.createdAtGt = createdAtGt } fun createdAtGt(createdAtGt: Optional) = - createdAtGt(createdAtGt.orElse(null)) + createdAtGt(createdAtGt.getOrNull()) fun createdAtGte(createdAtGte: OffsetDateTime?) = apply { this.createdAtGte = createdAtGte } fun createdAtGte(createdAtGte: Optional) = - createdAtGte(createdAtGte.orElse(null)) + createdAtGte(createdAtGte.getOrNull()) fun createdAtLt(createdAtLt: OffsetDateTime?) = apply { this.createdAtLt = createdAtLt } fun createdAtLt(createdAtLt: Optional) = - createdAtLt(createdAtLt.orElse(null)) + createdAtLt(createdAtLt.getOrNull()) fun createdAtLte(createdAtLte: OffsetDateTime?) = apply { this.createdAtLte = createdAtLte } fun createdAtLte(createdAtLte: Optional) = - createdAtLte(createdAtLte.orElse(null)) + createdAtLte(createdAtLte.getOrNull()) /** * Cursor for pagination. This can be populated by the `next_cursor` value returned from the @@ -147,7 +148,7 @@ private constructor( * Cursor for pagination. This can be populated by the `next_cursor` value returned from the * initial request. */ - fun cursor(cursor: Optional) = cursor(cursor.orElse(null)) + fun cursor(cursor: Optional) = cursor(cursor.getOrNull()) /** The number of items to fetch. Defaults to 20. */ fun limit(limit: Long?) = apply { this.limit = limit } @@ -156,8 +157,7 @@ private constructor( fun limit(limit: Long) = limit(limit as Long?) /** The number of items to fetch. Defaults to 20. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun limit(limit: Optional) = limit(limit.orElse(null) as Long?) + fun limit(limit: Optional) = limit(limit.getOrNull()) fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/MetricUpdateParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/MetricUpdateParams.kt index c81dfeeb..5e7df9ed 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/MetricUpdateParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/MetricUpdateParams.kt @@ -19,6 +19,7 @@ import com.withorb.api.core.immutableEmptyMap import com.withorb.api.core.toImmutable import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull /** * This endpoint allows you to update the `metadata` property on a metric. If you pass `null` for @@ -139,7 +140,7 @@ private constructor( * setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed by @@ -234,7 +235,7 @@ private constructor( * setting the value to `null`, and the entire metadata mapping can be cleared by setting * `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed by diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/PaginationMetadata.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/PaginationMetadata.kt index 43f8b77d..12afd8aa 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/PaginationMetadata.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/PaginationMetadata.kt @@ -16,6 +16,7 @@ import com.withorb.api.core.immutableEmptyMap import com.withorb.api.core.toImmutable import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull @NoAutoDetect class PaginationMetadata @@ -90,7 +91,7 @@ private constructor( fun nextCursor(nextCursor: String?) = nextCursor(JsonField.ofNullable(nextCursor)) - fun nextCursor(nextCursor: Optional) = nextCursor(nextCursor.orElse(null)) + fun nextCursor(nextCursor: Optional) = nextCursor(nextCursor.getOrNull()) fun nextCursor(nextCursor: JsonField) = apply { this.nextCursor = nextCursor } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/PercentageDiscount.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/PercentageDiscount.kt index 6f6f7df7..0bcd3ba4 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/PercentageDiscount.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/PercentageDiscount.kt @@ -19,6 +19,7 @@ import com.withorb.api.core.toImmutable import com.withorb.api.errors.OrbInvalidDataException import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull @NoAutoDetect class PercentageDiscount @@ -167,7 +168,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) fun reason(reason: JsonField) = apply { this.reason = reason } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/Plan.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/Plan.kt index 11fe3e97..35fabd11 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/Plan.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/Plan.kt @@ -507,7 +507,7 @@ private constructor( fun basePlan(basePlan: BasePlan?) = basePlan(JsonField.ofNullable(basePlan)) - fun basePlan(basePlan: Optional) = basePlan(basePlan.orElse(null)) + fun basePlan(basePlan: Optional) = basePlan(basePlan.getOrNull()) fun basePlan(basePlan: JsonField) = apply { this.basePlan = basePlan } @@ -521,7 +521,7 @@ private constructor( * The parent plan id if the given plan was created by overriding one or more of the * parent's prices */ - fun basePlanId(basePlanId: Optional) = basePlanId(basePlanId.orElse(null)) + fun basePlanId(basePlanId: Optional) = basePlanId(basePlanId.getOrNull()) /** * The parent plan id if the given plan was created by overriding one or more of the @@ -556,7 +556,7 @@ private constructor( * that each subscription may configure its own memo. */ fun defaultInvoiceMemo(defaultInvoiceMemo: Optional) = - defaultInvoiceMemo(defaultInvoiceMemo.orElse(null)) + defaultInvoiceMemo(defaultInvoiceMemo.getOrNull()) /** * The default memo text on the invoices corresponding to subscriptions on this plan. Note @@ -572,7 +572,7 @@ private constructor( fun discount(discount: Discount?) = discount(JsonField.ofNullable(discount)) - fun discount(discount: Optional) = discount(discount.orElse(null)) + fun discount(discount: Optional) = discount(discount.getOrNull()) fun discount(discount: JsonField) = apply { this.discount = discount } @@ -606,7 +606,7 @@ private constructor( * system. */ fun externalPlanId(externalPlanId: Optional) = - externalPlanId(externalPlanId.orElse(null)) + externalPlanId(externalPlanId.getOrNull()) /** * An optional user-defined ID for this plan resource, used throughout the system as an @@ -634,7 +634,7 @@ private constructor( fun maximum(maximum: Maximum?) = maximum(JsonField.ofNullable(maximum)) - fun maximum(maximum: Optional) = maximum(maximum.orElse(null)) + fun maximum(maximum: Optional) = maximum(maximum.getOrNull()) fun maximum(maximum: JsonField) = apply { this.maximum = maximum } @@ -642,7 +642,7 @@ private constructor( maximumAmount(JsonField.ofNullable(maximumAmount)) fun maximumAmount(maximumAmount: Optional) = - maximumAmount(maximumAmount.orElse(null)) + maximumAmount(maximumAmount.getOrNull()) fun maximumAmount(maximumAmount: JsonField) = apply { this.maximumAmount = maximumAmount @@ -664,7 +664,7 @@ private constructor( fun minimum(minimum: Minimum?) = minimum(JsonField.ofNullable(minimum)) - fun minimum(minimum: Optional) = minimum(minimum.orElse(null)) + fun minimum(minimum: Optional) = minimum(minimum.getOrNull()) fun minimum(minimum: JsonField) = apply { this.minimum = minimum } @@ -672,7 +672,7 @@ private constructor( minimumAmount(JsonField.ofNullable(minimumAmount)) fun minimumAmount(minimumAmount: Optional) = - minimumAmount(minimumAmount.orElse(null)) + minimumAmount(minimumAmount.getOrNull()) fun minimumAmount(minimumAmount: JsonField) = apply { this.minimumAmount = minimumAmount @@ -704,8 +704,7 @@ private constructor( * customer has a month to pay the invoice before its overdue. Note that individual * subscriptions or invoices may set a different net terms configuration. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun netTerms(netTerms: Optional) = netTerms(netTerms.orElse(null) as Long?) + fun netTerms(netTerms: Optional) = netTerms(netTerms.getOrNull()) /** * Determines the difference between the invoice issue date and the due date. A value of "0" @@ -717,7 +716,7 @@ private constructor( fun planPhases(planPhases: List?) = planPhases(JsonField.ofNullable(planPhases)) - fun planPhases(planPhases: Optional>) = planPhases(planPhases.orElse(null)) + fun planPhases(planPhases: Optional>) = planPhases(planPhases.getOrNull()) fun planPhases(planPhases: JsonField>) = apply { this.planPhases = planPhases.map { it.toMutableList() } @@ -1501,9 +1500,8 @@ private constructor( fun planPhaseOrder(planPhaseOrder: Long) = planPhaseOrder(planPhaseOrder as Long?) /** The plan phase in which this adjustment is active. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) /** The plan phase in which this adjustment is active. */ fun planPhaseOrder(planPhaseOrder: JsonField) = apply { @@ -1514,7 +1512,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -1920,9 +1918,8 @@ private constructor( fun planPhaseOrder(planPhaseOrder: Long) = planPhaseOrder(planPhaseOrder as Long?) /** The plan phase in which this adjustment is active. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) /** The plan phase in which this adjustment is active. */ fun planPhaseOrder(planPhaseOrder: JsonField) = apply { @@ -1933,7 +1930,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -2324,9 +2321,8 @@ private constructor( fun planPhaseOrder(planPhaseOrder: Long) = planPhaseOrder(planPhaseOrder as Long?) /** The plan phase in which this adjustment is active. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) /** The plan phase in which this adjustment is active. */ fun planPhaseOrder(planPhaseOrder: JsonField) = apply { @@ -2337,7 +2333,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -2743,9 +2739,8 @@ private constructor( fun planPhaseOrder(planPhaseOrder: Long) = planPhaseOrder(planPhaseOrder as Long?) /** The plan phase in which this adjustment is active. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) /** The plan phase in which this adjustment is active. */ fun planPhaseOrder(planPhaseOrder: JsonField) = apply { @@ -2756,7 +2751,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -3144,9 +3139,8 @@ private constructor( fun planPhaseOrder(planPhaseOrder: Long) = planPhaseOrder(planPhaseOrder as Long?) /** The plan phase in which this adjustment is active. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) /** The plan phase in which this adjustment is active. */ fun planPhaseOrder(planPhaseOrder: JsonField) = apply { @@ -3157,7 +3151,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -3411,7 +3405,7 @@ private constructor( fun id(id: String?) = id(JsonField.ofNullable(id)) - fun id(id: Optional) = id(id.orElse(null)) + fun id(id: Optional) = id(id.getOrNull()) fun id(id: JsonField) = apply { this.id = id } @@ -3429,7 +3423,7 @@ private constructor( * your system. */ fun externalPlanId(externalPlanId: Optional) = - externalPlanId(externalPlanId.orElse(null)) + externalPlanId(externalPlanId.getOrNull()) /** * An optional user-defined ID for this plan resource, used throughout the system as an @@ -3442,7 +3436,7 @@ private constructor( fun name(name: String?) = name(JsonField.ofNullable(name)) - fun name(name: Optional) = name(name.orElse(null)) + fun name(name: Optional) = name(name.getOrNull()) fun name(name: JsonField) = apply { this.name = name } @@ -4093,7 +4087,7 @@ private constructor( fun description(description: String?) = description(JsonField.ofNullable(description)) - fun description(description: Optional) = description(description.orElse(null)) + fun description(description: Optional) = description(description.getOrNull()) fun description(description: JsonField) = apply { this.description = description @@ -4101,7 +4095,7 @@ private constructor( fun discount(discount: Discount?) = discount(JsonField.ofNullable(discount)) - fun discount(discount: Optional) = discount(discount.orElse(null)) + fun discount(discount: Optional) = discount(discount.getOrNull()) fun discount(discount: JsonField) = apply { this.discount = discount } @@ -4138,8 +4132,7 @@ private constructor( * How many terms of length `duration_unit` this phase is active for. If null, this * phase is evergreen and active indefinitely */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun duration(duration: Optional) = duration(duration.orElse(null) as Long?) + fun duration(duration: Optional) = duration(duration.getOrNull()) /** * How many terms of length `duration_unit` this phase is active for. If null, this @@ -4151,7 +4144,7 @@ private constructor( durationUnit(JsonField.ofNullable(durationUnit)) fun durationUnit(durationUnit: Optional) = - durationUnit(durationUnit.orElse(null)) + durationUnit(durationUnit.getOrNull()) fun durationUnit(durationUnit: JsonField) = apply { this.durationUnit = durationUnit @@ -4159,7 +4152,7 @@ private constructor( fun maximum(maximum: Maximum?) = maximum(JsonField.ofNullable(maximum)) - fun maximum(maximum: Optional) = maximum(maximum.orElse(null)) + fun maximum(maximum: Optional) = maximum(maximum.getOrNull()) fun maximum(maximum: JsonField) = apply { this.maximum = maximum } @@ -4167,7 +4160,7 @@ private constructor( maximumAmount(JsonField.ofNullable(maximumAmount)) fun maximumAmount(maximumAmount: Optional) = - maximumAmount(maximumAmount.orElse(null)) + maximumAmount(maximumAmount.getOrNull()) fun maximumAmount(maximumAmount: JsonField) = apply { this.maximumAmount = maximumAmount @@ -4175,7 +4168,7 @@ private constructor( fun minimum(minimum: Minimum?) = minimum(JsonField.ofNullable(minimum)) - fun minimum(minimum: Optional) = minimum(minimum.orElse(null)) + fun minimum(minimum: Optional) = minimum(minimum.getOrNull()) fun minimum(minimum: JsonField) = apply { this.minimum = minimum } @@ -4183,7 +4176,7 @@ private constructor( minimumAmount(JsonField.ofNullable(minimumAmount)) fun minimumAmount(minimumAmount: Optional) = - minimumAmount(minimumAmount.orElse(null)) + minimumAmount(minimumAmount.getOrNull()) fun minimumAmount(minimumAmount: JsonField) = apply { this.minimumAmount = minimumAmount @@ -5028,9 +5021,7 @@ private constructor( fun trialPeriod(trialPeriod: Long) = trialPeriod(trialPeriod as Long?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun trialPeriod(trialPeriod: Optional) = - trialPeriod(trialPeriod.orElse(null) as Long?) + fun trialPeriod(trialPeriod: Optional) = trialPeriod(trialPeriod.getOrNull()) fun trialPeriod(trialPeriod: JsonField) = apply { this.trialPeriod = trialPeriod } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/PlanCreateParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/PlanCreateParams.kt index 8fff6097..28557084 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/PlanCreateParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/PlanCreateParams.kt @@ -532,7 +532,7 @@ private constructor( /** Free-form text which is available on the invoice PDF and the Orb invoice portal. */ fun defaultInvoiceMemo(defaultInvoiceMemo: Optional) = - defaultInvoiceMemo(defaultInvoiceMemo.orElse(null)) + defaultInvoiceMemo(defaultInvoiceMemo.getOrNull()) /** Free-form text which is available on the invoice PDF and the Orb invoice portal. */ fun defaultInvoiceMemo(defaultInvoiceMemo: JsonField) = apply { @@ -543,7 +543,7 @@ private constructor( externalPlanId(JsonField.ofNullable(externalPlanId)) fun externalPlanId(externalPlanId: Optional) = - externalPlanId(externalPlanId.orElse(null)) + externalPlanId(externalPlanId.getOrNull()) fun externalPlanId(externalPlanId: JsonField) = apply { this.externalPlanId = externalPlanId @@ -561,7 +561,7 @@ private constructor( * setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed by @@ -586,8 +586,7 @@ private constructor( * The net terms determines the difference between the invoice date and the issue date * for the invoice. If you intend the invoice to be due on issue, set this to 0. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun netTerms(netTerms: Optional) = netTerms(netTerms.orElse(null) as Long?) + fun netTerms(netTerms: Optional) = netTerms(netTerms.getOrNull()) /** * The net terms determines the difference between the invoice date and the issue date @@ -924,7 +923,7 @@ private constructor( /** Free-form text which is available on the invoice PDF and the Orb invoice portal. */ fun defaultInvoiceMemo(defaultInvoiceMemo: Optional) = - defaultInvoiceMemo(defaultInvoiceMemo.orElse(null)) + defaultInvoiceMemo(defaultInvoiceMemo.getOrNull()) /** Free-form text which is available on the invoice PDF and the Orb invoice portal. */ fun defaultInvoiceMemo(defaultInvoiceMemo: JsonField) = apply { @@ -934,7 +933,7 @@ private constructor( fun externalPlanId(externalPlanId: String?) = apply { body.externalPlanId(externalPlanId) } fun externalPlanId(externalPlanId: Optional) = - externalPlanId(externalPlanId.orElse(null)) + externalPlanId(externalPlanId.getOrNull()) fun externalPlanId(externalPlanId: JsonField) = apply { body.externalPlanId(externalPlanId) @@ -952,7 +951,7 @@ private constructor( * setting the value to `null`, and the entire metadata mapping can be cleared by setting * `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed by @@ -977,8 +976,7 @@ private constructor( * The net terms determines the difference between the invoice date and the issue date for * the invoice. If you intend the invoice to be due on issue, set this to 0. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun netTerms(netTerms: Optional) = netTerms(netTerms.orElse(null) as Long?) + fun netTerms(netTerms: Optional) = netTerms(netTerms.getOrNull()) /** * The net terms determines the difference between the invoice date and the issue date for @@ -2454,7 +2452,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -2482,9 +2480,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if this @@ -2508,7 +2505,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -2527,9 +2524,8 @@ private constructor( conversionRate(conversionRate as Double?) /** The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** The per unit conversion rate of the price currency to the invoicing currency. */ fun conversionRate(conversionRate: JsonField) = apply { @@ -2546,7 +2542,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -2560,7 +2556,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -2585,9 +2581,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -2603,7 +2598,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -2624,7 +2619,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are produced. @@ -2646,7 +2641,7 @@ private constructor( * by setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -4004,7 +3999,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -4032,9 +4027,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if this @@ -4058,7 +4052,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -4077,9 +4071,8 @@ private constructor( conversionRate(conversionRate as Double?) /** The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** The per unit conversion rate of the price currency to the invoicing currency. */ fun conversionRate(conversionRate: JsonField) = apply { @@ -4096,7 +4089,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -4110,7 +4103,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -4135,9 +4128,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -4153,7 +4145,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -4174,7 +4166,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are produced. @@ -4196,7 +4188,7 @@ private constructor( * by setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -5591,7 +5583,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -5619,9 +5611,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if this @@ -5645,7 +5636,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -5664,9 +5655,8 @@ private constructor( conversionRate(conversionRate as Double?) /** The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** The per unit conversion rate of the price currency to the invoicing currency. */ fun conversionRate(conversionRate: JsonField) = apply { @@ -5683,7 +5673,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -5697,7 +5687,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -5722,9 +5712,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -5740,7 +5729,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -5761,7 +5750,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are produced. @@ -5783,7 +5772,7 @@ private constructor( * by setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -7391,7 +7380,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -7419,9 +7408,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if this @@ -7445,7 +7433,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -7464,9 +7452,8 @@ private constructor( conversionRate(conversionRate as Double?) /** The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** The per unit conversion rate of the price currency to the invoicing currency. */ fun conversionRate(conversionRate: JsonField) = apply { @@ -7483,7 +7470,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -7497,7 +7484,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -7522,9 +7509,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -7540,7 +7526,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -7561,7 +7547,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are produced. @@ -7583,7 +7569,7 @@ private constructor( * by setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -8087,11 +8073,7 @@ private constructor( /** * Exclusive tier ending value. If null, this is treated as the last tier */ - @Suppress( - "USELESS_CAST" - ) // See https://youtrack.jetbrains.com/issue/KT-74228 - fun lastUnit(lastUnit: Optional) = - lastUnit(lastUnit.orElse(null) as Double?) + fun lastUnit(lastUnit: Optional) = lastUnit(lastUnit.getOrNull()) /** * Exclusive tier ending value. If null, this is treated as the last tier @@ -9132,7 +9114,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -9160,9 +9142,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if this @@ -9186,7 +9167,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -9205,9 +9186,8 @@ private constructor( conversionRate(conversionRate as Double?) /** The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** The per unit conversion rate of the price currency to the invoicing currency. */ fun conversionRate(conversionRate: JsonField) = apply { @@ -9224,7 +9204,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -9238,7 +9218,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -9263,9 +9243,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -9281,7 +9260,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -9302,7 +9281,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are produced. @@ -9324,7 +9303,7 @@ private constructor( * by setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -9848,7 +9827,7 @@ private constructor( /** Exclusive tier ending value */ fun maximumAmount(maximumAmount: Optional) = - maximumAmount(maximumAmount.orElse(null)) + maximumAmount(maximumAmount.getOrNull()) /** Exclusive tier ending value */ fun maximumAmount(maximumAmount: JsonField) = apply { @@ -9861,7 +9840,7 @@ private constructor( /** Per unit maximum to charge */ fun perUnitMaximum(perUnitMaximum: Optional) = - perUnitMaximum(perUnitMaximum.orElse(null)) + perUnitMaximum(perUnitMaximum.getOrNull()) /** Per unit maximum to charge */ fun perUnitMaximum(perUnitMaximum: JsonField) = apply { @@ -10898,7 +10877,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -10926,9 +10905,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if this @@ -10952,7 +10930,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -10971,9 +10949,8 @@ private constructor( conversionRate(conversionRate as Double?) /** The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** The per unit conversion rate of the price currency to the invoicing currency. */ fun conversionRate(conversionRate: JsonField) = apply { @@ -10990,7 +10967,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -11004,7 +10981,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -11029,9 +11006,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -11047,7 +11023,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -11068,7 +11044,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are produced. @@ -11090,7 +11066,7 @@ private constructor( * by setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -11228,7 +11204,7 @@ private constructor( /** Optional currency amount maximum to cap spend per event */ fun perUnitMaximum(perUnitMaximum: Optional) = - perUnitMaximum(perUnitMaximum.orElse(null)) + perUnitMaximum(perUnitMaximum.getOrNull()) /** Optional currency amount maximum to cap spend per event */ fun perUnitMaximum(perUnitMaximum: JsonField) = apply { @@ -12473,7 +12449,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -12501,9 +12477,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if this @@ -12527,7 +12502,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -12546,9 +12521,8 @@ private constructor( conversionRate(conversionRate as Double?) /** The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** The per unit conversion rate of the price currency to the invoicing currency. */ fun conversionRate(conversionRate: JsonField) = apply { @@ -12565,7 +12539,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -12579,7 +12553,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -12604,9 +12578,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -12622,7 +12595,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -12643,7 +12616,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are produced. @@ -12665,7 +12638,7 @@ private constructor( * by setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -12938,7 +12911,7 @@ private constructor( /** Upper bound for tier */ fun maximumAmount(maximumAmount: Optional) = - maximumAmount(maximumAmount.orElse(null)) + maximumAmount(maximumAmount.getOrNull()) /** Upper bound for tier */ fun maximumAmount(maximumAmount: JsonField) = apply { @@ -12951,7 +12924,7 @@ private constructor( /** The maximum amount to charge for any one event */ fun perUnitMaximum(perUnitMaximum: Optional) = - perUnitMaximum(perUnitMaximum.orElse(null)) + perUnitMaximum(perUnitMaximum.getOrNull()) /** The maximum amount to charge for any one event */ fun perUnitMaximum(perUnitMaximum: JsonField) = apply { @@ -14214,7 +14187,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -14242,9 +14215,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if this @@ -14268,7 +14240,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -14287,9 +14259,8 @@ private constructor( conversionRate(conversionRate as Double?) /** The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** The per unit conversion rate of the price currency to the invoicing currency. */ fun conversionRate(conversionRate: JsonField) = apply { @@ -14306,7 +14277,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -14320,7 +14291,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -14345,9 +14316,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -14363,7 +14333,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -14384,7 +14354,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are produced. @@ -14406,7 +14376,7 @@ private constructor( * by setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -14656,11 +14626,8 @@ private constructor( maximumUnits(maximumUnits as Double?) /** Upper bound for this tier */ - @Suppress( - "USELESS_CAST" - ) // See https://youtrack.jetbrains.com/issue/KT-74228 fun maximumUnits(maximumUnits: Optional) = - maximumUnits(maximumUnits.orElse(null) as Double?) + maximumUnits(maximumUnits.getOrNull()) /** Upper bound for this tier */ fun maximumUnits(maximumUnits: JsonField) = apply { @@ -15935,7 +15902,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -15963,9 +15930,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if this @@ -15989,7 +15955,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -16008,9 +15974,8 @@ private constructor( conversionRate(conversionRate as Double?) /** The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** The per unit conversion rate of the price currency to the invoicing currency. */ fun conversionRate(conversionRate: JsonField) = apply { @@ -16027,7 +15992,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -16041,7 +16006,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -16066,9 +16031,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -16084,7 +16048,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -16105,7 +16069,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are produced. @@ -16127,7 +16091,7 @@ private constructor( * by setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -17463,7 +17427,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -17491,9 +17455,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if this @@ -17517,7 +17480,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -17536,9 +17499,8 @@ private constructor( conversionRate(conversionRate as Double?) /** The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** The per unit conversion rate of the price currency to the invoicing currency. */ fun conversionRate(conversionRate: JsonField) = apply { @@ -17555,7 +17517,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -17569,7 +17531,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -17594,9 +17556,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -17612,7 +17573,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -17633,7 +17594,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are produced. @@ -17655,7 +17616,7 @@ private constructor( * by setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -18994,7 +18955,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -19022,9 +18983,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if this @@ -19048,7 +19008,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -19067,9 +19027,8 @@ private constructor( conversionRate(conversionRate as Double?) /** The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** The per unit conversion rate of the price currency to the invoicing currency. */ fun conversionRate(conversionRate: JsonField) = apply { @@ -19086,7 +19045,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -19100,7 +19059,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -19125,9 +19084,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -19143,7 +19101,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -19164,7 +19122,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are produced. @@ -19186,7 +19144,7 @@ private constructor( * by setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -20523,7 +20481,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -20551,9 +20509,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if this @@ -20577,7 +20534,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -20596,9 +20553,8 @@ private constructor( conversionRate(conversionRate as Double?) /** The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** The per unit conversion rate of the price currency to the invoicing currency. */ fun conversionRate(conversionRate: JsonField) = apply { @@ -20615,7 +20571,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -20629,7 +20585,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -20654,9 +20610,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -20672,7 +20627,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -20693,7 +20648,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are produced. @@ -20715,7 +20670,7 @@ private constructor( * by setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -22057,7 +22012,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -22085,9 +22040,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if this @@ -22111,7 +22065,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -22130,9 +22084,8 @@ private constructor( conversionRate(conversionRate as Double?) /** The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** The per unit conversion rate of the price currency to the invoicing currency. */ fun conversionRate(conversionRate: JsonField) = apply { @@ -22149,7 +22102,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -22163,7 +22116,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -22188,9 +22141,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -22206,7 +22158,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -22227,7 +22179,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are produced. @@ -22249,7 +22201,7 @@ private constructor( * by setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -23590,7 +23542,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -23618,9 +23570,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if this @@ -23644,7 +23595,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -23663,9 +23614,8 @@ private constructor( conversionRate(conversionRate as Double?) /** The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** The per unit conversion rate of the price currency to the invoicing currency. */ fun conversionRate(conversionRate: JsonField) = apply { @@ -23682,7 +23632,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -23696,7 +23646,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -23721,9 +23671,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -23739,7 +23688,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -23760,7 +23709,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are produced. @@ -23782,7 +23731,7 @@ private constructor( * by setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -25122,7 +25071,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -25150,9 +25099,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if this @@ -25176,7 +25124,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -25195,9 +25143,8 @@ private constructor( conversionRate(conversionRate as Double?) /** The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** The per unit conversion rate of the price currency to the invoicing currency. */ fun conversionRate(conversionRate: JsonField) = apply { @@ -25214,7 +25161,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -25228,7 +25175,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -25253,9 +25200,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -25271,7 +25217,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -25292,7 +25238,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are produced. @@ -25314,7 +25260,7 @@ private constructor( * by setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -26653,7 +26599,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -26681,9 +26627,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if this @@ -26707,7 +26652,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -26726,9 +26671,8 @@ private constructor( conversionRate(conversionRate as Double?) /** The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** The per unit conversion rate of the price currency to the invoicing currency. */ fun conversionRate(conversionRate: JsonField) = apply { @@ -26745,7 +26689,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -26759,7 +26703,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -26784,9 +26728,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -26802,7 +26745,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -26823,7 +26766,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are produced. @@ -26845,7 +26788,7 @@ private constructor( * by setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -28191,7 +28134,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -28219,9 +28162,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if this @@ -28245,7 +28187,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -28264,9 +28206,8 @@ private constructor( conversionRate(conversionRate as Double?) /** The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** The per unit conversion rate of the price currency to the invoicing currency. */ fun conversionRate(conversionRate: JsonField) = apply { @@ -28283,7 +28224,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -28297,7 +28238,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -28322,9 +28263,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -28340,7 +28280,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -28361,7 +28301,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are produced. @@ -28383,7 +28323,7 @@ private constructor( * by setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -29733,7 +29673,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -29761,9 +29701,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if this @@ -29787,7 +29726,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -29806,9 +29745,8 @@ private constructor( conversionRate(conversionRate as Double?) /** The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** The per unit conversion rate of the price currency to the invoicing currency. */ fun conversionRate(conversionRate: JsonField) = apply { @@ -29825,7 +29763,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -29839,7 +29777,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -29864,9 +29802,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -29882,7 +29819,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -29903,7 +29840,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are produced. @@ -29925,7 +29862,7 @@ private constructor( * by setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -31272,7 +31209,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -31300,9 +31237,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if this @@ -31326,7 +31262,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -31345,9 +31281,8 @@ private constructor( conversionRate(conversionRate as Double?) /** The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** The per unit conversion rate of the price currency to the invoicing currency. */ fun conversionRate(conversionRate: JsonField) = apply { @@ -31364,7 +31299,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -31378,7 +31313,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -31403,9 +31338,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -31421,7 +31355,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -31442,7 +31376,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are produced. @@ -31464,7 +31398,7 @@ private constructor( * by setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -32804,7 +32738,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -32832,9 +32766,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if this @@ -32858,7 +32791,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -32877,9 +32810,8 @@ private constructor( conversionRate(conversionRate as Double?) /** The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** The per unit conversion rate of the price currency to the invoicing currency. */ fun conversionRate(conversionRate: JsonField) = apply { @@ -32896,7 +32828,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -32910,7 +32842,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -32935,9 +32867,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -32953,7 +32884,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -32974,7 +32905,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are produced. @@ -32996,7 +32927,7 @@ private constructor( * by setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -34338,7 +34269,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -34366,9 +34297,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if this @@ -34392,7 +34322,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -34411,9 +34341,8 @@ private constructor( conversionRate(conversionRate as Double?) /** The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** The per unit conversion rate of the price currency to the invoicing currency. */ fun conversionRate(conversionRate: JsonField) = apply { @@ -34430,7 +34359,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -34444,7 +34373,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -34469,9 +34398,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -34487,7 +34415,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -34508,7 +34436,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are produced. @@ -34530,7 +34458,7 @@ private constructor( * by setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -35873,7 +35801,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -35901,9 +35829,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if this @@ -35927,7 +35854,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -35946,9 +35873,8 @@ private constructor( conversionRate(conversionRate as Double?) /** The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** The per unit conversion rate of the price currency to the invoicing currency. */ fun conversionRate(conversionRate: JsonField) = apply { @@ -35965,7 +35891,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -35979,7 +35905,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -36004,9 +35930,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -36022,7 +35947,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -36043,7 +35968,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are produced. @@ -36065,7 +35990,7 @@ private constructor( * by setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -37423,7 +37348,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -37451,9 +37376,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if this @@ -37477,7 +37401,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -37496,9 +37420,8 @@ private constructor( conversionRate(conversionRate as Double?) /** The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** The per unit conversion rate of the price currency to the invoicing currency. */ fun conversionRate(conversionRate: JsonField) = apply { @@ -37515,7 +37438,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -37529,7 +37452,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -37554,9 +37477,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -37572,7 +37494,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -37593,7 +37515,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are produced. @@ -37615,7 +37537,7 @@ private constructor( * by setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -38980,7 +38902,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -39008,9 +38930,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if this @@ -39034,7 +38955,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -39053,9 +38974,8 @@ private constructor( conversionRate(conversionRate as Double?) /** The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** The per unit conversion rate of the price currency to the invoicing currency. */ fun conversionRate(conversionRate: JsonField) = apply { @@ -39072,7 +38992,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -39086,7 +39006,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -39111,9 +39031,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -39129,7 +39048,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -39150,7 +39069,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are produced. @@ -39172,7 +39091,7 @@ private constructor( * by setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -40524,7 +40443,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -40552,9 +40471,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if this @@ -40578,7 +40496,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -40597,9 +40515,8 @@ private constructor( conversionRate(conversionRate as Double?) /** The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** The per unit conversion rate of the price currency to the invoicing currency. */ fun conversionRate(conversionRate: JsonField) = apply { @@ -40616,7 +40533,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -40630,7 +40547,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -40655,9 +40572,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -40673,7 +40589,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -40694,7 +40610,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are produced. @@ -40716,7 +40632,7 @@ private constructor( * by setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/PlanExternalPlanIdUpdateParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/PlanExternalPlanIdUpdateParams.kt index 333d6295..e853501e 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/PlanExternalPlanIdUpdateParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/PlanExternalPlanIdUpdateParams.kt @@ -19,6 +19,7 @@ import com.withorb.api.core.immutableEmptyMap import com.withorb.api.core.toImmutable import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull /** * This endpoint can be used to update the `external_plan_id`, and `metadata` of an existing plan. @@ -177,7 +178,7 @@ private constructor( * your system. */ fun externalPlanId(externalPlanId: Optional) = - externalPlanId(externalPlanId.orElse(null)) + externalPlanId(externalPlanId.getOrNull()) /** * An optional user-defined ID for this plan resource, used throughout the system as an @@ -200,7 +201,7 @@ private constructor( * setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed by @@ -299,7 +300,7 @@ private constructor( * system. */ fun externalPlanId(externalPlanId: Optional) = - externalPlanId(externalPlanId.orElse(null)) + externalPlanId(externalPlanId.getOrNull()) /** * An optional user-defined ID for this plan resource, used throughout the system as an @@ -322,7 +323,7 @@ private constructor( * setting the value to `null`, and the entire metadata mapping can be cleared by setting * `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed by diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/PlanListPage.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/PlanListPage.kt index 58e61682..f698c1a4 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/PlanListPage.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/PlanListPage.kt @@ -18,6 +18,7 @@ import java.util.Objects import java.util.Optional import java.util.stream.Stream import java.util.stream.StreamSupport +import kotlin.jvm.optionals.getOrNull /** * This endpoint returns a list of all [plans](/core-concepts#plan-and-price) for an account in a @@ -186,7 +187,7 @@ private constructor( while (index < page.data().size) { yield(page.data()[index++]) } - page = page.getNextPage().orElse(null) ?: break + page = page.getNextPage().getOrNull() ?: break index = 0 } } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/PlanListParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/PlanListParams.kt index 7c24853a..9fda2a18 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/PlanListParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/PlanListParams.kt @@ -14,6 +14,7 @@ import java.time.OffsetDateTime import java.time.format.DateTimeFormatter import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull /** * This endpoint returns a list of all [plans](/core-concepts#plan-and-price) for an account in a @@ -133,22 +134,22 @@ private constructor( fun createdAtGt(createdAtGt: OffsetDateTime?) = apply { this.createdAtGt = createdAtGt } fun createdAtGt(createdAtGt: Optional) = - createdAtGt(createdAtGt.orElse(null)) + createdAtGt(createdAtGt.getOrNull()) fun createdAtGte(createdAtGte: OffsetDateTime?) = apply { this.createdAtGte = createdAtGte } fun createdAtGte(createdAtGte: Optional) = - createdAtGte(createdAtGte.orElse(null)) + createdAtGte(createdAtGte.getOrNull()) fun createdAtLt(createdAtLt: OffsetDateTime?) = apply { this.createdAtLt = createdAtLt } fun createdAtLt(createdAtLt: Optional) = - createdAtLt(createdAtLt.orElse(null)) + createdAtLt(createdAtLt.getOrNull()) fun createdAtLte(createdAtLte: OffsetDateTime?) = apply { this.createdAtLte = createdAtLte } fun createdAtLte(createdAtLte: Optional) = - createdAtLte(createdAtLte.orElse(null)) + createdAtLte(createdAtLte.getOrNull()) /** * Cursor for pagination. This can be populated by the `next_cursor` value returned from the @@ -160,7 +161,7 @@ private constructor( * Cursor for pagination. This can be populated by the `next_cursor` value returned from the * initial request. */ - fun cursor(cursor: Optional) = cursor(cursor.orElse(null)) + fun cursor(cursor: Optional) = cursor(cursor.getOrNull()) /** The number of items to fetch. Defaults to 20. */ fun limit(limit: Long?) = apply { this.limit = limit } @@ -169,14 +170,13 @@ private constructor( fun limit(limit: Long) = limit(limit as Long?) /** The number of items to fetch. Defaults to 20. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun limit(limit: Optional) = limit(limit.orElse(null) as Long?) + fun limit(limit: Optional) = limit(limit.getOrNull()) /** The plan status to filter to ('active', 'archived', or 'draft'). */ fun status(status: Status?) = apply { this.status = status } /** The plan status to filter to ('active', 'archived', or 'draft'). */ - fun status(status: Optional) = status(status.orElse(null)) + fun status(status: Optional) = status(status.getOrNull()) fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/PlanUpdateParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/PlanUpdateParams.kt index b5d4ba24..b74f75f5 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/PlanUpdateParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/PlanUpdateParams.kt @@ -19,6 +19,7 @@ import com.withorb.api.core.immutableEmptyMap import com.withorb.api.core.toImmutable import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull /** * This endpoint can be used to update the `external_plan_id`, and `metadata` of an existing plan. @@ -177,7 +178,7 @@ private constructor( * your system. */ fun externalPlanId(externalPlanId: Optional) = - externalPlanId(externalPlanId.orElse(null)) + externalPlanId(externalPlanId.getOrNull()) /** * An optional user-defined ID for this plan resource, used throughout the system as an @@ -200,7 +201,7 @@ private constructor( * setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed by @@ -296,7 +297,7 @@ private constructor( * system. */ fun externalPlanId(externalPlanId: Optional) = - externalPlanId(externalPlanId.orElse(null)) + externalPlanId(externalPlanId.getOrNull()) /** * An optional user-defined ID for this plan resource, used throughout the system as an @@ -319,7 +320,7 @@ private constructor( * setting the value to `null`, and the entire metadata mapping can be cleared by setting * `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed by diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/Price.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/Price.kt index a908421b..8f7450e4 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/Price.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/Price.kt @@ -1349,7 +1349,7 @@ private constructor( billableMetric(JsonField.ofNullable(billableMetric)) fun billableMetric(billableMetric: Optional) = - billableMetric(billableMetric.orElse(null)) + billableMetric(billableMetric.getOrNull()) fun billableMetric(billableMetric: JsonField) = apply { this.billableMetric = billableMetric @@ -1371,9 +1371,8 @@ private constructor( fun conversionRate(conversionRate: Double) = conversionRate(conversionRate as Double?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) fun conversionRate(conversionRate: JsonField) = apply { this.conversionRate = conversionRate @@ -1389,7 +1388,7 @@ private constructor( creditAllocation(JsonField.ofNullable(creditAllocation)) fun creditAllocation(creditAllocation: Optional) = - creditAllocation(creditAllocation.orElse(null)) + creditAllocation(creditAllocation.getOrNull()) fun creditAllocation(creditAllocation: JsonField) = apply { this.creditAllocation = creditAllocation @@ -1401,7 +1400,7 @@ private constructor( fun discount(discount: Discount?) = discount(JsonField.ofNullable(discount)) - fun discount(discount: Optional) = discount(discount.orElse(null)) + fun discount(discount: Optional) = discount(discount.getOrNull()) fun discount(discount: JsonField) = apply { this.discount = discount } @@ -1426,7 +1425,7 @@ private constructor( externalPriceId(JsonField.ofNullable(externalPriceId)) fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) fun externalPriceId(externalPriceId: JsonField) = apply { this.externalPriceId = externalPriceId @@ -1438,9 +1437,8 @@ private constructor( fun fixedPriceQuantity(fixedPriceQuantity: Double) = fixedPriceQuantity(fixedPriceQuantity as Double?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) fun fixedPriceQuantity(fixedPriceQuantity: JsonField) = apply { this.fixedPriceQuantity = fixedPriceQuantity @@ -1452,7 +1450,7 @@ private constructor( fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) fun invoicingCycleConfiguration( invoicingCycleConfiguration: JsonField @@ -1464,7 +1462,7 @@ private constructor( fun maximum(maximum: Maximum?) = maximum(JsonField.ofNullable(maximum)) - fun maximum(maximum: Optional) = maximum(maximum.orElse(null)) + fun maximum(maximum: Optional) = maximum(maximum.getOrNull()) fun maximum(maximum: JsonField) = apply { this.maximum = maximum } @@ -1472,7 +1470,7 @@ private constructor( maximumAmount(JsonField.ofNullable(maximumAmount)) fun maximumAmount(maximumAmount: Optional) = - maximumAmount(maximumAmount.orElse(null)) + maximumAmount(maximumAmount.getOrNull()) fun maximumAmount(maximumAmount: JsonField) = apply { this.maximumAmount = maximumAmount @@ -1494,7 +1492,7 @@ private constructor( fun minimum(minimum: Minimum?) = minimum(JsonField.ofNullable(minimum)) - fun minimum(minimum: Optional) = minimum(minimum.orElse(null)) + fun minimum(minimum: Optional) = minimum(minimum.getOrNull()) fun minimum(minimum: JsonField) = apply { this.minimum = minimum } @@ -1502,7 +1500,7 @@ private constructor( minimumAmount(JsonField.ofNullable(minimumAmount)) fun minimumAmount(minimumAmount: Optional) = - minimumAmount(minimumAmount.orElse(null)) + minimumAmount(minimumAmount.getOrNull()) fun minimumAmount(minimumAmount: JsonField) = apply { this.minimumAmount = minimumAmount @@ -1521,9 +1519,8 @@ private constructor( fun planPhaseOrder(planPhaseOrder: Long) = planPhaseOrder(planPhaseOrder as Long?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) fun planPhaseOrder(planPhaseOrder: JsonField) = apply { this.planPhaseOrder = planPhaseOrder @@ -1545,7 +1542,7 @@ private constructor( fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: Optional - ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.orElse(null)) + ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.getOrNull()) fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: JsonField @@ -3835,7 +3832,7 @@ private constructor( billableMetric(JsonField.ofNullable(billableMetric)) fun billableMetric(billableMetric: Optional) = - billableMetric(billableMetric.orElse(null)) + billableMetric(billableMetric.getOrNull()) fun billableMetric(billableMetric: JsonField) = apply { this.billableMetric = billableMetric @@ -3857,9 +3854,8 @@ private constructor( fun conversionRate(conversionRate: Double) = conversionRate(conversionRate as Double?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) fun conversionRate(conversionRate: JsonField) = apply { this.conversionRate = conversionRate @@ -3875,7 +3871,7 @@ private constructor( creditAllocation(JsonField.ofNullable(creditAllocation)) fun creditAllocation(creditAllocation: Optional) = - creditAllocation(creditAllocation.orElse(null)) + creditAllocation(creditAllocation.getOrNull()) fun creditAllocation(creditAllocation: JsonField) = apply { this.creditAllocation = creditAllocation @@ -3887,7 +3883,7 @@ private constructor( fun discount(discount: Discount?) = discount(JsonField.ofNullable(discount)) - fun discount(discount: Optional) = discount(discount.orElse(null)) + fun discount(discount: Optional) = discount(discount.getOrNull()) fun discount(discount: JsonField) = apply { this.discount = discount } @@ -3912,7 +3908,7 @@ private constructor( externalPriceId(JsonField.ofNullable(externalPriceId)) fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) fun externalPriceId(externalPriceId: JsonField) = apply { this.externalPriceId = externalPriceId @@ -3924,9 +3920,8 @@ private constructor( fun fixedPriceQuantity(fixedPriceQuantity: Double) = fixedPriceQuantity(fixedPriceQuantity as Double?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) fun fixedPriceQuantity(fixedPriceQuantity: JsonField) = apply { this.fixedPriceQuantity = fixedPriceQuantity @@ -3938,7 +3933,7 @@ private constructor( fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) fun invoicingCycleConfiguration( invoicingCycleConfiguration: JsonField @@ -3950,7 +3945,7 @@ private constructor( fun maximum(maximum: Maximum?) = maximum(JsonField.ofNullable(maximum)) - fun maximum(maximum: Optional) = maximum(maximum.orElse(null)) + fun maximum(maximum: Optional) = maximum(maximum.getOrNull()) fun maximum(maximum: JsonField) = apply { this.maximum = maximum } @@ -3958,7 +3953,7 @@ private constructor( maximumAmount(JsonField.ofNullable(maximumAmount)) fun maximumAmount(maximumAmount: Optional) = - maximumAmount(maximumAmount.orElse(null)) + maximumAmount(maximumAmount.getOrNull()) fun maximumAmount(maximumAmount: JsonField) = apply { this.maximumAmount = maximumAmount @@ -3980,7 +3975,7 @@ private constructor( fun minimum(minimum: Minimum?) = minimum(JsonField.ofNullable(minimum)) - fun minimum(minimum: Optional) = minimum(minimum.orElse(null)) + fun minimum(minimum: Optional) = minimum(minimum.getOrNull()) fun minimum(minimum: JsonField) = apply { this.minimum = minimum } @@ -3988,7 +3983,7 @@ private constructor( minimumAmount(JsonField.ofNullable(minimumAmount)) fun minimumAmount(minimumAmount: Optional) = - minimumAmount(minimumAmount.orElse(null)) + minimumAmount(minimumAmount.getOrNull()) fun minimumAmount(minimumAmount: JsonField) = apply { this.minimumAmount = minimumAmount @@ -4014,9 +4009,8 @@ private constructor( fun planPhaseOrder(planPhaseOrder: Long) = planPhaseOrder(planPhaseOrder as Long?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) fun planPhaseOrder(planPhaseOrder: JsonField) = apply { this.planPhaseOrder = planPhaseOrder @@ -4032,7 +4026,7 @@ private constructor( fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: Optional - ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.orElse(null)) + ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.getOrNull()) fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: JsonField @@ -6359,7 +6353,7 @@ private constructor( billableMetric(JsonField.ofNullable(billableMetric)) fun billableMetric(billableMetric: Optional) = - billableMetric(billableMetric.orElse(null)) + billableMetric(billableMetric.getOrNull()) fun billableMetric(billableMetric: JsonField) = apply { this.billableMetric = billableMetric @@ -6381,9 +6375,8 @@ private constructor( fun conversionRate(conversionRate: Double) = conversionRate(conversionRate as Double?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) fun conversionRate(conversionRate: JsonField) = apply { this.conversionRate = conversionRate @@ -6399,7 +6392,7 @@ private constructor( creditAllocation(JsonField.ofNullable(creditAllocation)) fun creditAllocation(creditAllocation: Optional) = - creditAllocation(creditAllocation.orElse(null)) + creditAllocation(creditAllocation.getOrNull()) fun creditAllocation(creditAllocation: JsonField) = apply { this.creditAllocation = creditAllocation @@ -6411,7 +6404,7 @@ private constructor( fun discount(discount: Discount?) = discount(JsonField.ofNullable(discount)) - fun discount(discount: Optional) = discount(discount.orElse(null)) + fun discount(discount: Optional) = discount(discount.getOrNull()) fun discount(discount: JsonField) = apply { this.discount = discount } @@ -6436,7 +6429,7 @@ private constructor( externalPriceId(JsonField.ofNullable(externalPriceId)) fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) fun externalPriceId(externalPriceId: JsonField) = apply { this.externalPriceId = externalPriceId @@ -6448,9 +6441,8 @@ private constructor( fun fixedPriceQuantity(fixedPriceQuantity: Double) = fixedPriceQuantity(fixedPriceQuantity as Double?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) fun fixedPriceQuantity(fixedPriceQuantity: JsonField) = apply { this.fixedPriceQuantity = fixedPriceQuantity @@ -6462,7 +6454,7 @@ private constructor( fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) fun invoicingCycleConfiguration( invoicingCycleConfiguration: JsonField @@ -6480,7 +6472,7 @@ private constructor( fun maximum(maximum: Maximum?) = maximum(JsonField.ofNullable(maximum)) - fun maximum(maximum: Optional) = maximum(maximum.orElse(null)) + fun maximum(maximum: Optional) = maximum(maximum.getOrNull()) fun maximum(maximum: JsonField) = apply { this.maximum = maximum } @@ -6488,7 +6480,7 @@ private constructor( maximumAmount(JsonField.ofNullable(maximumAmount)) fun maximumAmount(maximumAmount: Optional) = - maximumAmount(maximumAmount.orElse(null)) + maximumAmount(maximumAmount.getOrNull()) fun maximumAmount(maximumAmount: JsonField) = apply { this.maximumAmount = maximumAmount @@ -6510,7 +6502,7 @@ private constructor( fun minimum(minimum: Minimum?) = minimum(JsonField.ofNullable(minimum)) - fun minimum(minimum: Optional) = minimum(minimum.orElse(null)) + fun minimum(minimum: Optional) = minimum(minimum.getOrNull()) fun minimum(minimum: JsonField) = apply { this.minimum = minimum } @@ -6518,7 +6510,7 @@ private constructor( minimumAmount(JsonField.ofNullable(minimumAmount)) fun minimumAmount(minimumAmount: Optional) = - minimumAmount(minimumAmount.orElse(null)) + minimumAmount(minimumAmount.getOrNull()) fun minimumAmount(minimumAmount: JsonField) = apply { this.minimumAmount = minimumAmount @@ -6537,9 +6529,8 @@ private constructor( fun planPhaseOrder(planPhaseOrder: Long) = planPhaseOrder(planPhaseOrder as Long?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) fun planPhaseOrder(planPhaseOrder: JsonField) = apply { this.planPhaseOrder = planPhaseOrder @@ -6555,7 +6546,7 @@ private constructor( fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: Optional - ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.orElse(null)) + ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.getOrNull()) fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: JsonField @@ -9087,7 +9078,7 @@ private constructor( billableMetric(JsonField.ofNullable(billableMetric)) fun billableMetric(billableMetric: Optional) = - billableMetric(billableMetric.orElse(null)) + billableMetric(billableMetric.getOrNull()) fun billableMetric(billableMetric: JsonField) = apply { this.billableMetric = billableMetric @@ -9109,9 +9100,8 @@ private constructor( fun conversionRate(conversionRate: Double) = conversionRate(conversionRate as Double?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) fun conversionRate(conversionRate: JsonField) = apply { this.conversionRate = conversionRate @@ -9127,7 +9117,7 @@ private constructor( creditAllocation(JsonField.ofNullable(creditAllocation)) fun creditAllocation(creditAllocation: Optional) = - creditAllocation(creditAllocation.orElse(null)) + creditAllocation(creditAllocation.getOrNull()) fun creditAllocation(creditAllocation: JsonField) = apply { this.creditAllocation = creditAllocation @@ -9139,7 +9129,7 @@ private constructor( fun discount(discount: Discount?) = discount(JsonField.ofNullable(discount)) - fun discount(discount: Optional) = discount(discount.orElse(null)) + fun discount(discount: Optional) = discount(discount.getOrNull()) fun discount(discount: JsonField) = apply { this.discount = discount } @@ -9164,7 +9154,7 @@ private constructor( externalPriceId(JsonField.ofNullable(externalPriceId)) fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) fun externalPriceId(externalPriceId: JsonField) = apply { this.externalPriceId = externalPriceId @@ -9176,9 +9166,8 @@ private constructor( fun fixedPriceQuantity(fixedPriceQuantity: Double) = fixedPriceQuantity(fixedPriceQuantity as Double?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) fun fixedPriceQuantity(fixedPriceQuantity: JsonField) = apply { this.fixedPriceQuantity = fixedPriceQuantity @@ -9190,7 +9179,7 @@ private constructor( fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) fun invoicingCycleConfiguration( invoicingCycleConfiguration: JsonField @@ -9202,7 +9191,7 @@ private constructor( fun maximum(maximum: Maximum?) = maximum(JsonField.ofNullable(maximum)) - fun maximum(maximum: Optional) = maximum(maximum.orElse(null)) + fun maximum(maximum: Optional) = maximum(maximum.getOrNull()) fun maximum(maximum: JsonField) = apply { this.maximum = maximum } @@ -9210,7 +9199,7 @@ private constructor( maximumAmount(JsonField.ofNullable(maximumAmount)) fun maximumAmount(maximumAmount: Optional) = - maximumAmount(maximumAmount.orElse(null)) + maximumAmount(maximumAmount.getOrNull()) fun maximumAmount(maximumAmount: JsonField) = apply { this.maximumAmount = maximumAmount @@ -9232,7 +9221,7 @@ private constructor( fun minimum(minimum: Minimum?) = minimum(JsonField.ofNullable(minimum)) - fun minimum(minimum: Optional) = minimum(minimum.orElse(null)) + fun minimum(minimum: Optional) = minimum(minimum.getOrNull()) fun minimum(minimum: JsonField) = apply { this.minimum = minimum } @@ -9240,7 +9229,7 @@ private constructor( minimumAmount(JsonField.ofNullable(minimumAmount)) fun minimumAmount(minimumAmount: Optional) = - minimumAmount(minimumAmount.orElse(null)) + minimumAmount(minimumAmount.getOrNull()) fun minimumAmount(minimumAmount: JsonField) = apply { this.minimumAmount = minimumAmount @@ -9259,9 +9248,8 @@ private constructor( fun planPhaseOrder(planPhaseOrder: Long) = planPhaseOrder(planPhaseOrder as Long?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) fun planPhaseOrder(planPhaseOrder: JsonField) = apply { this.planPhaseOrder = planPhaseOrder @@ -9283,7 +9271,7 @@ private constructor( fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: Optional - ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.orElse(null)) + ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.getOrNull()) fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: JsonField @@ -11135,9 +11123,7 @@ private constructor( fun lastUnit(lastUnit: Double) = lastUnit(lastUnit as Double?) /** Exclusive tier ending value. If null, this is treated as the last tier */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun lastUnit(lastUnit: Optional) = - lastUnit(lastUnit.orElse(null) as Double?) + fun lastUnit(lastUnit: Optional) = lastUnit(lastUnit.getOrNull()) /** Exclusive tier ending value. If null, this is treated as the last tier */ fun lastUnit(lastUnit: JsonField) = apply { this.lastUnit = lastUnit } @@ -11749,7 +11735,7 @@ private constructor( billableMetric(JsonField.ofNullable(billableMetric)) fun billableMetric(billableMetric: Optional) = - billableMetric(billableMetric.orElse(null)) + billableMetric(billableMetric.getOrNull()) fun billableMetric(billableMetric: JsonField) = apply { this.billableMetric = billableMetric @@ -11771,9 +11757,8 @@ private constructor( fun conversionRate(conversionRate: Double) = conversionRate(conversionRate as Double?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) fun conversionRate(conversionRate: JsonField) = apply { this.conversionRate = conversionRate @@ -11789,7 +11774,7 @@ private constructor( creditAllocation(JsonField.ofNullable(creditAllocation)) fun creditAllocation(creditAllocation: Optional) = - creditAllocation(creditAllocation.orElse(null)) + creditAllocation(creditAllocation.getOrNull()) fun creditAllocation(creditAllocation: JsonField) = apply { this.creditAllocation = creditAllocation @@ -11801,7 +11786,7 @@ private constructor( fun discount(discount: Discount?) = discount(JsonField.ofNullable(discount)) - fun discount(discount: Optional) = discount(discount.orElse(null)) + fun discount(discount: Optional) = discount(discount.getOrNull()) fun discount(discount: JsonField) = apply { this.discount = discount } @@ -11826,7 +11811,7 @@ private constructor( externalPriceId(JsonField.ofNullable(externalPriceId)) fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) fun externalPriceId(externalPriceId: JsonField) = apply { this.externalPriceId = externalPriceId @@ -11838,9 +11823,8 @@ private constructor( fun fixedPriceQuantity(fixedPriceQuantity: Double) = fixedPriceQuantity(fixedPriceQuantity as Double?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) fun fixedPriceQuantity(fixedPriceQuantity: JsonField) = apply { this.fixedPriceQuantity = fixedPriceQuantity @@ -11852,7 +11836,7 @@ private constructor( fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) fun invoicingCycleConfiguration( invoicingCycleConfiguration: JsonField @@ -11864,7 +11848,7 @@ private constructor( fun maximum(maximum: Maximum?) = maximum(JsonField.ofNullable(maximum)) - fun maximum(maximum: Optional) = maximum(maximum.orElse(null)) + fun maximum(maximum: Optional) = maximum(maximum.getOrNull()) fun maximum(maximum: JsonField) = apply { this.maximum = maximum } @@ -11872,7 +11856,7 @@ private constructor( maximumAmount(JsonField.ofNullable(maximumAmount)) fun maximumAmount(maximumAmount: Optional) = - maximumAmount(maximumAmount.orElse(null)) + maximumAmount(maximumAmount.getOrNull()) fun maximumAmount(maximumAmount: JsonField) = apply { this.maximumAmount = maximumAmount @@ -11894,7 +11878,7 @@ private constructor( fun minimum(minimum: Minimum?) = minimum(JsonField.ofNullable(minimum)) - fun minimum(minimum: Optional) = minimum(minimum.orElse(null)) + fun minimum(minimum: Optional) = minimum(minimum.getOrNull()) fun minimum(minimum: JsonField) = apply { this.minimum = minimum } @@ -11902,7 +11886,7 @@ private constructor( minimumAmount(JsonField.ofNullable(minimumAmount)) fun minimumAmount(minimumAmount: Optional) = - minimumAmount(minimumAmount.orElse(null)) + minimumAmount(minimumAmount.getOrNull()) fun minimumAmount(minimumAmount: JsonField) = apply { this.minimumAmount = minimumAmount @@ -11921,9 +11905,8 @@ private constructor( fun planPhaseOrder(planPhaseOrder: Long) = planPhaseOrder(planPhaseOrder as Long?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) fun planPhaseOrder(planPhaseOrder: JsonField) = apply { this.planPhaseOrder = planPhaseOrder @@ -11946,7 +11929,7 @@ private constructor( fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: Optional - ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.orElse(null)) + ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.getOrNull()) fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: JsonField @@ -13822,7 +13805,7 @@ private constructor( /** Exclusive tier ending value */ fun maximumAmount(maximumAmount: Optional) = - maximumAmount(maximumAmount.orElse(null)) + maximumAmount(maximumAmount.getOrNull()) /** Exclusive tier ending value */ fun maximumAmount(maximumAmount: JsonField) = apply { @@ -13835,7 +13818,7 @@ private constructor( /** Per unit maximum to charge */ fun perUnitMaximum(perUnitMaximum: Optional) = - perUnitMaximum(perUnitMaximum.orElse(null)) + perUnitMaximum(perUnitMaximum.getOrNull()) /** Per unit maximum to charge */ fun perUnitMaximum(perUnitMaximum: JsonField) = apply { @@ -14450,7 +14433,7 @@ private constructor( billableMetric(JsonField.ofNullable(billableMetric)) fun billableMetric(billableMetric: Optional) = - billableMetric(billableMetric.orElse(null)) + billableMetric(billableMetric.getOrNull()) fun billableMetric(billableMetric: JsonField) = apply { this.billableMetric = billableMetric @@ -14476,9 +14459,8 @@ private constructor( fun conversionRate(conversionRate: Double) = conversionRate(conversionRate as Double?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) fun conversionRate(conversionRate: JsonField) = apply { this.conversionRate = conversionRate @@ -14494,7 +14476,7 @@ private constructor( creditAllocation(JsonField.ofNullable(creditAllocation)) fun creditAllocation(creditAllocation: Optional) = - creditAllocation(creditAllocation.orElse(null)) + creditAllocation(creditAllocation.getOrNull()) fun creditAllocation(creditAllocation: JsonField) = apply { this.creditAllocation = creditAllocation @@ -14506,7 +14488,7 @@ private constructor( fun discount(discount: Discount?) = discount(JsonField.ofNullable(discount)) - fun discount(discount: Optional) = discount(discount.orElse(null)) + fun discount(discount: Optional) = discount(discount.getOrNull()) fun discount(discount: JsonField) = apply { this.discount = discount } @@ -14531,7 +14513,7 @@ private constructor( externalPriceId(JsonField.ofNullable(externalPriceId)) fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) fun externalPriceId(externalPriceId: JsonField) = apply { this.externalPriceId = externalPriceId @@ -14543,9 +14525,8 @@ private constructor( fun fixedPriceQuantity(fixedPriceQuantity: Double) = fixedPriceQuantity(fixedPriceQuantity as Double?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) fun fixedPriceQuantity(fixedPriceQuantity: JsonField) = apply { this.fixedPriceQuantity = fixedPriceQuantity @@ -14557,7 +14538,7 @@ private constructor( fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) fun invoicingCycleConfiguration( invoicingCycleConfiguration: JsonField @@ -14569,7 +14550,7 @@ private constructor( fun maximum(maximum: Maximum?) = maximum(JsonField.ofNullable(maximum)) - fun maximum(maximum: Optional) = maximum(maximum.orElse(null)) + fun maximum(maximum: Optional) = maximum(maximum.getOrNull()) fun maximum(maximum: JsonField) = apply { this.maximum = maximum } @@ -14577,7 +14558,7 @@ private constructor( maximumAmount(JsonField.ofNullable(maximumAmount)) fun maximumAmount(maximumAmount: Optional) = - maximumAmount(maximumAmount.orElse(null)) + maximumAmount(maximumAmount.getOrNull()) fun maximumAmount(maximumAmount: JsonField) = apply { this.maximumAmount = maximumAmount @@ -14599,7 +14580,7 @@ private constructor( fun minimum(minimum: Minimum?) = minimum(JsonField.ofNullable(minimum)) - fun minimum(minimum: Optional) = minimum(minimum.orElse(null)) + fun minimum(minimum: Optional) = minimum(minimum.getOrNull()) fun minimum(minimum: JsonField) = apply { this.minimum = minimum } @@ -14607,7 +14588,7 @@ private constructor( minimumAmount(JsonField.ofNullable(minimumAmount)) fun minimumAmount(minimumAmount: Optional) = - minimumAmount(minimumAmount.orElse(null)) + minimumAmount(minimumAmount.getOrNull()) fun minimumAmount(minimumAmount: JsonField) = apply { this.minimumAmount = minimumAmount @@ -14626,9 +14607,8 @@ private constructor( fun planPhaseOrder(planPhaseOrder: Long) = planPhaseOrder(planPhaseOrder as Long?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) fun planPhaseOrder(planPhaseOrder: JsonField) = apply { this.planPhaseOrder = planPhaseOrder @@ -14644,7 +14624,7 @@ private constructor( fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: Optional - ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.orElse(null)) + ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.getOrNull()) fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: JsonField @@ -15127,7 +15107,7 @@ private constructor( /** Optional currency amount maximum to cap spend per event */ fun perUnitMaximum(perUnitMaximum: Optional) = - perUnitMaximum(perUnitMaximum.orElse(null)) + perUnitMaximum(perUnitMaximum.getOrNull()) /** Optional currency amount maximum to cap spend per event */ fun perUnitMaximum(perUnitMaximum: JsonField) = apply { @@ -16959,7 +16939,7 @@ private constructor( billableMetric(JsonField.ofNullable(billableMetric)) fun billableMetric(billableMetric: Optional) = - billableMetric(billableMetric.orElse(null)) + billableMetric(billableMetric.getOrNull()) fun billableMetric(billableMetric: JsonField) = apply { this.billableMetric = billableMetric @@ -16988,9 +16968,8 @@ private constructor( fun conversionRate(conversionRate: Double) = conversionRate(conversionRate as Double?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) fun conversionRate(conversionRate: JsonField) = apply { this.conversionRate = conversionRate @@ -17006,7 +16985,7 @@ private constructor( creditAllocation(JsonField.ofNullable(creditAllocation)) fun creditAllocation(creditAllocation: Optional) = - creditAllocation(creditAllocation.orElse(null)) + creditAllocation(creditAllocation.getOrNull()) fun creditAllocation(creditAllocation: JsonField) = apply { this.creditAllocation = creditAllocation @@ -17018,7 +16997,7 @@ private constructor( fun discount(discount: Discount?) = discount(JsonField.ofNullable(discount)) - fun discount(discount: Optional) = discount(discount.orElse(null)) + fun discount(discount: Optional) = discount(discount.getOrNull()) fun discount(discount: JsonField) = apply { this.discount = discount } @@ -17043,7 +17022,7 @@ private constructor( externalPriceId(JsonField.ofNullable(externalPriceId)) fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) fun externalPriceId(externalPriceId: JsonField) = apply { this.externalPriceId = externalPriceId @@ -17055,9 +17034,8 @@ private constructor( fun fixedPriceQuantity(fixedPriceQuantity: Double) = fixedPriceQuantity(fixedPriceQuantity as Double?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) fun fixedPriceQuantity(fixedPriceQuantity: JsonField) = apply { this.fixedPriceQuantity = fixedPriceQuantity @@ -17069,7 +17047,7 @@ private constructor( fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) fun invoicingCycleConfiguration( invoicingCycleConfiguration: JsonField @@ -17081,7 +17059,7 @@ private constructor( fun maximum(maximum: Maximum?) = maximum(JsonField.ofNullable(maximum)) - fun maximum(maximum: Optional) = maximum(maximum.orElse(null)) + fun maximum(maximum: Optional) = maximum(maximum.getOrNull()) fun maximum(maximum: JsonField) = apply { this.maximum = maximum } @@ -17089,7 +17067,7 @@ private constructor( maximumAmount(JsonField.ofNullable(maximumAmount)) fun maximumAmount(maximumAmount: Optional) = - maximumAmount(maximumAmount.orElse(null)) + maximumAmount(maximumAmount.getOrNull()) fun maximumAmount(maximumAmount: JsonField) = apply { this.maximumAmount = maximumAmount @@ -17111,7 +17089,7 @@ private constructor( fun minimum(minimum: Minimum?) = minimum(JsonField.ofNullable(minimum)) - fun minimum(minimum: Optional) = minimum(minimum.orElse(null)) + fun minimum(minimum: Optional) = minimum(minimum.getOrNull()) fun minimum(minimum: JsonField) = apply { this.minimum = minimum } @@ -17119,7 +17097,7 @@ private constructor( minimumAmount(JsonField.ofNullable(minimumAmount)) fun minimumAmount(minimumAmount: Optional) = - minimumAmount(minimumAmount.orElse(null)) + minimumAmount(minimumAmount.getOrNull()) fun minimumAmount(minimumAmount: JsonField) = apply { this.minimumAmount = minimumAmount @@ -17138,9 +17116,8 @@ private constructor( fun planPhaseOrder(planPhaseOrder: Long) = planPhaseOrder(planPhaseOrder as Long?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) fun planPhaseOrder(planPhaseOrder: JsonField) = apply { this.planPhaseOrder = planPhaseOrder @@ -17156,7 +17133,7 @@ private constructor( fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: Optional - ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.orElse(null)) + ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.getOrNull()) fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: JsonField @@ -17773,7 +17750,7 @@ private constructor( /** Upper bound for tier */ fun maximumAmount(maximumAmount: Optional) = - maximumAmount(maximumAmount.orElse(null)) + maximumAmount(maximumAmount.getOrNull()) /** Upper bound for tier */ fun maximumAmount(maximumAmount: JsonField) = apply { @@ -17786,7 +17763,7 @@ private constructor( /** The maximum amount to charge for any one event */ fun perUnitMaximum(perUnitMaximum: Optional) = - perUnitMaximum(perUnitMaximum.orElse(null)) + perUnitMaximum(perUnitMaximum.getOrNull()) /** The maximum amount to charge for any one event */ fun perUnitMaximum(perUnitMaximum: JsonField) = apply { @@ -19637,7 +19614,7 @@ private constructor( billableMetric(JsonField.ofNullable(billableMetric)) fun billableMetric(billableMetric: Optional) = - billableMetric(billableMetric.orElse(null)) + billableMetric(billableMetric.getOrNull()) fun billableMetric(billableMetric: JsonField) = apply { this.billableMetric = billableMetric @@ -19665,9 +19642,8 @@ private constructor( fun conversionRate(conversionRate: Double) = conversionRate(conversionRate as Double?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) fun conversionRate(conversionRate: JsonField) = apply { this.conversionRate = conversionRate @@ -19683,7 +19659,7 @@ private constructor( creditAllocation(JsonField.ofNullable(creditAllocation)) fun creditAllocation(creditAllocation: Optional) = - creditAllocation(creditAllocation.orElse(null)) + creditAllocation(creditAllocation.getOrNull()) fun creditAllocation(creditAllocation: JsonField) = apply { this.creditAllocation = creditAllocation @@ -19695,7 +19671,7 @@ private constructor( fun discount(discount: Discount?) = discount(JsonField.ofNullable(discount)) - fun discount(discount: Optional) = discount(discount.orElse(null)) + fun discount(discount: Optional) = discount(discount.getOrNull()) fun discount(discount: JsonField) = apply { this.discount = discount } @@ -19720,7 +19696,7 @@ private constructor( externalPriceId(JsonField.ofNullable(externalPriceId)) fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) fun externalPriceId(externalPriceId: JsonField) = apply { this.externalPriceId = externalPriceId @@ -19732,9 +19708,8 @@ private constructor( fun fixedPriceQuantity(fixedPriceQuantity: Double) = fixedPriceQuantity(fixedPriceQuantity as Double?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) fun fixedPriceQuantity(fixedPriceQuantity: JsonField) = apply { this.fixedPriceQuantity = fixedPriceQuantity @@ -19746,7 +19721,7 @@ private constructor( fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) fun invoicingCycleConfiguration( invoicingCycleConfiguration: JsonField @@ -19758,7 +19733,7 @@ private constructor( fun maximum(maximum: Maximum?) = maximum(JsonField.ofNullable(maximum)) - fun maximum(maximum: Optional) = maximum(maximum.orElse(null)) + fun maximum(maximum: Optional) = maximum(maximum.getOrNull()) fun maximum(maximum: JsonField) = apply { this.maximum = maximum } @@ -19766,7 +19741,7 @@ private constructor( maximumAmount(JsonField.ofNullable(maximumAmount)) fun maximumAmount(maximumAmount: Optional) = - maximumAmount(maximumAmount.orElse(null)) + maximumAmount(maximumAmount.getOrNull()) fun maximumAmount(maximumAmount: JsonField) = apply { this.maximumAmount = maximumAmount @@ -19788,7 +19763,7 @@ private constructor( fun minimum(minimum: Minimum?) = minimum(JsonField.ofNullable(minimum)) - fun minimum(minimum: Optional) = minimum(minimum.orElse(null)) + fun minimum(minimum: Optional) = minimum(minimum.getOrNull()) fun minimum(minimum: JsonField) = apply { this.minimum = minimum } @@ -19796,7 +19771,7 @@ private constructor( minimumAmount(JsonField.ofNullable(minimumAmount)) fun minimumAmount(minimumAmount: Optional) = - minimumAmount(minimumAmount.orElse(null)) + minimumAmount(minimumAmount.getOrNull()) fun minimumAmount(minimumAmount: JsonField) = apply { this.minimumAmount = minimumAmount @@ -19815,9 +19790,8 @@ private constructor( fun planPhaseOrder(planPhaseOrder: Long) = planPhaseOrder(planPhaseOrder as Long?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) fun planPhaseOrder(planPhaseOrder: JsonField) = apply { this.planPhaseOrder = planPhaseOrder @@ -19833,7 +19807,7 @@ private constructor( fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: Optional - ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.orElse(null)) + ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.getOrNull()) fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: JsonField @@ -20426,9 +20400,8 @@ private constructor( fun maximumUnits(maximumUnits: Double) = maximumUnits(maximumUnits as Double?) /** Upper bound for this tier */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun maximumUnits(maximumUnits: Optional) = - maximumUnits(maximumUnits.orElse(null) as Double?) + maximumUnits(maximumUnits.getOrNull()) /** Upper bound for this tier */ fun maximumUnits(maximumUnits: JsonField) = apply { @@ -22283,7 +22256,7 @@ private constructor( billableMetric(JsonField.ofNullable(billableMetric)) fun billableMetric(billableMetric: Optional) = - billableMetric(billableMetric.orElse(null)) + billableMetric(billableMetric.getOrNull()) fun billableMetric(billableMetric: JsonField) = apply { this.billableMetric = billableMetric @@ -22305,9 +22278,8 @@ private constructor( fun conversionRate(conversionRate: Double) = conversionRate(conversionRate as Double?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) fun conversionRate(conversionRate: JsonField) = apply { this.conversionRate = conversionRate @@ -22323,7 +22295,7 @@ private constructor( creditAllocation(JsonField.ofNullable(creditAllocation)) fun creditAllocation(creditAllocation: Optional) = - creditAllocation(creditAllocation.orElse(null)) + creditAllocation(creditAllocation.getOrNull()) fun creditAllocation(creditAllocation: JsonField) = apply { this.creditAllocation = creditAllocation @@ -22335,7 +22307,7 @@ private constructor( fun discount(discount: Discount?) = discount(JsonField.ofNullable(discount)) - fun discount(discount: Optional) = discount(discount.orElse(null)) + fun discount(discount: Optional) = discount(discount.getOrNull()) fun discount(discount: JsonField) = apply { this.discount = discount } @@ -22360,7 +22332,7 @@ private constructor( externalPriceId(JsonField.ofNullable(externalPriceId)) fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) fun externalPriceId(externalPriceId: JsonField) = apply { this.externalPriceId = externalPriceId @@ -22372,9 +22344,8 @@ private constructor( fun fixedPriceQuantity(fixedPriceQuantity: Double) = fixedPriceQuantity(fixedPriceQuantity as Double?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) fun fixedPriceQuantity(fixedPriceQuantity: JsonField) = apply { this.fixedPriceQuantity = fixedPriceQuantity @@ -22386,7 +22357,7 @@ private constructor( fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) fun invoicingCycleConfiguration( invoicingCycleConfiguration: JsonField @@ -22398,7 +22369,7 @@ private constructor( fun maximum(maximum: Maximum?) = maximum(JsonField.ofNullable(maximum)) - fun maximum(maximum: Optional) = maximum(maximum.orElse(null)) + fun maximum(maximum: Optional) = maximum(maximum.getOrNull()) fun maximum(maximum: JsonField) = apply { this.maximum = maximum } @@ -22406,7 +22377,7 @@ private constructor( maximumAmount(JsonField.ofNullable(maximumAmount)) fun maximumAmount(maximumAmount: Optional) = - maximumAmount(maximumAmount.orElse(null)) + maximumAmount(maximumAmount.getOrNull()) fun maximumAmount(maximumAmount: JsonField) = apply { this.maximumAmount = maximumAmount @@ -22428,7 +22399,7 @@ private constructor( fun minimum(minimum: Minimum?) = minimum(JsonField.ofNullable(minimum)) - fun minimum(minimum: Optional) = minimum(minimum.orElse(null)) + fun minimum(minimum: Optional) = minimum(minimum.getOrNull()) fun minimum(minimum: JsonField) = apply { this.minimum = minimum } @@ -22436,7 +22407,7 @@ private constructor( minimumAmount(JsonField.ofNullable(minimumAmount)) fun minimumAmount(minimumAmount: Optional) = - minimumAmount(minimumAmount.orElse(null)) + minimumAmount(minimumAmount.getOrNull()) fun minimumAmount(minimumAmount: JsonField) = apply { this.minimumAmount = minimumAmount @@ -22455,9 +22426,8 @@ private constructor( fun planPhaseOrder(planPhaseOrder: Long) = planPhaseOrder(planPhaseOrder as Long?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) fun planPhaseOrder(planPhaseOrder: JsonField) = apply { this.planPhaseOrder = planPhaseOrder @@ -22480,7 +22450,7 @@ private constructor( fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: Optional - ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.orElse(null)) + ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.getOrNull()) fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: JsonField @@ -24743,7 +24713,7 @@ private constructor( billableMetric(JsonField.ofNullable(billableMetric)) fun billableMetric(billableMetric: Optional) = - billableMetric(billableMetric.orElse(null)) + billableMetric(billableMetric.getOrNull()) fun billableMetric(billableMetric: JsonField) = apply { this.billableMetric = billableMetric @@ -24765,9 +24735,8 @@ private constructor( fun conversionRate(conversionRate: Double) = conversionRate(conversionRate as Double?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) fun conversionRate(conversionRate: JsonField) = apply { this.conversionRate = conversionRate @@ -24783,7 +24752,7 @@ private constructor( creditAllocation(JsonField.ofNullable(creditAllocation)) fun creditAllocation(creditAllocation: Optional) = - creditAllocation(creditAllocation.orElse(null)) + creditAllocation(creditAllocation.getOrNull()) fun creditAllocation(creditAllocation: JsonField) = apply { this.creditAllocation = creditAllocation @@ -24795,7 +24764,7 @@ private constructor( fun discount(discount: Discount?) = discount(JsonField.ofNullable(discount)) - fun discount(discount: Optional) = discount(discount.orElse(null)) + fun discount(discount: Optional) = discount(discount.getOrNull()) fun discount(discount: JsonField) = apply { this.discount = discount } @@ -24820,7 +24789,7 @@ private constructor( externalPriceId(JsonField.ofNullable(externalPriceId)) fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) fun externalPriceId(externalPriceId: JsonField) = apply { this.externalPriceId = externalPriceId @@ -24832,9 +24801,8 @@ private constructor( fun fixedPriceQuantity(fixedPriceQuantity: Double) = fixedPriceQuantity(fixedPriceQuantity as Double?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) fun fixedPriceQuantity(fixedPriceQuantity: JsonField) = apply { this.fixedPriceQuantity = fixedPriceQuantity @@ -24846,7 +24814,7 @@ private constructor( fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) fun invoicingCycleConfiguration( invoicingCycleConfiguration: JsonField @@ -24858,7 +24826,7 @@ private constructor( fun maximum(maximum: Maximum?) = maximum(JsonField.ofNullable(maximum)) - fun maximum(maximum: Optional) = maximum(maximum.orElse(null)) + fun maximum(maximum: Optional) = maximum(maximum.getOrNull()) fun maximum(maximum: JsonField) = apply { this.maximum = maximum } @@ -24866,7 +24834,7 @@ private constructor( maximumAmount(JsonField.ofNullable(maximumAmount)) fun maximumAmount(maximumAmount: Optional) = - maximumAmount(maximumAmount.orElse(null)) + maximumAmount(maximumAmount.getOrNull()) fun maximumAmount(maximumAmount: JsonField) = apply { this.maximumAmount = maximumAmount @@ -24888,7 +24856,7 @@ private constructor( fun minimum(minimum: Minimum?) = minimum(JsonField.ofNullable(minimum)) - fun minimum(minimum: Optional) = minimum(minimum.orElse(null)) + fun minimum(minimum: Optional) = minimum(minimum.getOrNull()) fun minimum(minimum: JsonField) = apply { this.minimum = minimum } @@ -24896,7 +24864,7 @@ private constructor( minimumAmount(JsonField.ofNullable(minimumAmount)) fun minimumAmount(minimumAmount: Optional) = - minimumAmount(minimumAmount.orElse(null)) + minimumAmount(minimumAmount.getOrNull()) fun minimumAmount(minimumAmount: JsonField) = apply { this.minimumAmount = minimumAmount @@ -24915,9 +24883,8 @@ private constructor( fun planPhaseOrder(planPhaseOrder: Long) = planPhaseOrder(planPhaseOrder as Long?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) fun planPhaseOrder(planPhaseOrder: JsonField) = apply { this.planPhaseOrder = planPhaseOrder @@ -24940,7 +24907,7 @@ private constructor( fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: Optional - ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.orElse(null)) + ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.getOrNull()) fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: JsonField @@ -27201,7 +27168,7 @@ private constructor( billableMetric(JsonField.ofNullable(billableMetric)) fun billableMetric(billableMetric: Optional) = - billableMetric(billableMetric.orElse(null)) + billableMetric(billableMetric.getOrNull()) fun billableMetric(billableMetric: JsonField) = apply { this.billableMetric = billableMetric @@ -27223,9 +27190,8 @@ private constructor( fun conversionRate(conversionRate: Double) = conversionRate(conversionRate as Double?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) fun conversionRate(conversionRate: JsonField) = apply { this.conversionRate = conversionRate @@ -27241,7 +27207,7 @@ private constructor( creditAllocation(JsonField.ofNullable(creditAllocation)) fun creditAllocation(creditAllocation: Optional) = - creditAllocation(creditAllocation.orElse(null)) + creditAllocation(creditAllocation.getOrNull()) fun creditAllocation(creditAllocation: JsonField) = apply { this.creditAllocation = creditAllocation @@ -27253,7 +27219,7 @@ private constructor( fun discount(discount: Discount?) = discount(JsonField.ofNullable(discount)) - fun discount(discount: Optional) = discount(discount.orElse(null)) + fun discount(discount: Optional) = discount(discount.getOrNull()) fun discount(discount: JsonField) = apply { this.discount = discount } @@ -27278,7 +27244,7 @@ private constructor( externalPriceId(JsonField.ofNullable(externalPriceId)) fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) fun externalPriceId(externalPriceId: JsonField) = apply { this.externalPriceId = externalPriceId @@ -27290,9 +27256,8 @@ private constructor( fun fixedPriceQuantity(fixedPriceQuantity: Double) = fixedPriceQuantity(fixedPriceQuantity as Double?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) fun fixedPriceQuantity(fixedPriceQuantity: JsonField) = apply { this.fixedPriceQuantity = fixedPriceQuantity @@ -27311,7 +27276,7 @@ private constructor( fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) fun invoicingCycleConfiguration( invoicingCycleConfiguration: JsonField @@ -27323,7 +27288,7 @@ private constructor( fun maximum(maximum: Maximum?) = maximum(JsonField.ofNullable(maximum)) - fun maximum(maximum: Optional) = maximum(maximum.orElse(null)) + fun maximum(maximum: Optional) = maximum(maximum.getOrNull()) fun maximum(maximum: JsonField) = apply { this.maximum = maximum } @@ -27331,7 +27296,7 @@ private constructor( maximumAmount(JsonField.ofNullable(maximumAmount)) fun maximumAmount(maximumAmount: Optional) = - maximumAmount(maximumAmount.orElse(null)) + maximumAmount(maximumAmount.getOrNull()) fun maximumAmount(maximumAmount: JsonField) = apply { this.maximumAmount = maximumAmount @@ -27353,7 +27318,7 @@ private constructor( fun minimum(minimum: Minimum?) = minimum(JsonField.ofNullable(minimum)) - fun minimum(minimum: Optional) = minimum(minimum.orElse(null)) + fun minimum(minimum: Optional) = minimum(minimum.getOrNull()) fun minimum(minimum: JsonField) = apply { this.minimum = minimum } @@ -27361,7 +27326,7 @@ private constructor( minimumAmount(JsonField.ofNullable(minimumAmount)) fun minimumAmount(minimumAmount: Optional) = - minimumAmount(minimumAmount.orElse(null)) + minimumAmount(minimumAmount.getOrNull()) fun minimumAmount(minimumAmount: JsonField) = apply { this.minimumAmount = minimumAmount @@ -27380,9 +27345,8 @@ private constructor( fun planPhaseOrder(planPhaseOrder: Long) = planPhaseOrder(planPhaseOrder as Long?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) fun planPhaseOrder(planPhaseOrder: JsonField) = apply { this.planPhaseOrder = planPhaseOrder @@ -27398,7 +27362,7 @@ private constructor( fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: Optional - ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.orElse(null)) + ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.getOrNull()) fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: JsonField @@ -29659,7 +29623,7 @@ private constructor( billableMetric(JsonField.ofNullable(billableMetric)) fun billableMetric(billableMetric: Optional) = - billableMetric(billableMetric.orElse(null)) + billableMetric(billableMetric.getOrNull()) fun billableMetric(billableMetric: JsonField) = apply { this.billableMetric = billableMetric @@ -29681,9 +29645,8 @@ private constructor( fun conversionRate(conversionRate: Double) = conversionRate(conversionRate as Double?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) fun conversionRate(conversionRate: JsonField) = apply { this.conversionRate = conversionRate @@ -29699,7 +29662,7 @@ private constructor( creditAllocation(JsonField.ofNullable(creditAllocation)) fun creditAllocation(creditAllocation: Optional) = - creditAllocation(creditAllocation.orElse(null)) + creditAllocation(creditAllocation.getOrNull()) fun creditAllocation(creditAllocation: JsonField) = apply { this.creditAllocation = creditAllocation @@ -29711,7 +29674,7 @@ private constructor( fun discount(discount: Discount?) = discount(JsonField.ofNullable(discount)) - fun discount(discount: Optional) = discount(discount.orElse(null)) + fun discount(discount: Optional) = discount(discount.getOrNull()) fun discount(discount: JsonField) = apply { this.discount = discount } @@ -29736,7 +29699,7 @@ private constructor( externalPriceId(JsonField.ofNullable(externalPriceId)) fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) fun externalPriceId(externalPriceId: JsonField) = apply { this.externalPriceId = externalPriceId @@ -29748,9 +29711,8 @@ private constructor( fun fixedPriceQuantity(fixedPriceQuantity: Double) = fixedPriceQuantity(fixedPriceQuantity as Double?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) fun fixedPriceQuantity(fixedPriceQuantity: JsonField) = apply { this.fixedPriceQuantity = fixedPriceQuantity @@ -29762,7 +29724,7 @@ private constructor( fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) fun invoicingCycleConfiguration( invoicingCycleConfiguration: JsonField @@ -29774,7 +29736,7 @@ private constructor( fun maximum(maximum: Maximum?) = maximum(JsonField.ofNullable(maximum)) - fun maximum(maximum: Optional) = maximum(maximum.orElse(null)) + fun maximum(maximum: Optional) = maximum(maximum.getOrNull()) fun maximum(maximum: JsonField) = apply { this.maximum = maximum } @@ -29782,7 +29744,7 @@ private constructor( maximumAmount(JsonField.ofNullable(maximumAmount)) fun maximumAmount(maximumAmount: Optional) = - maximumAmount(maximumAmount.orElse(null)) + maximumAmount(maximumAmount.getOrNull()) fun maximumAmount(maximumAmount: JsonField) = apply { this.maximumAmount = maximumAmount @@ -29804,7 +29766,7 @@ private constructor( fun minimum(minimum: Minimum?) = minimum(JsonField.ofNullable(minimum)) - fun minimum(minimum: Optional) = minimum(minimum.orElse(null)) + fun minimum(minimum: Optional) = minimum(minimum.getOrNull()) fun minimum(minimum: JsonField) = apply { this.minimum = minimum } @@ -29812,7 +29774,7 @@ private constructor( minimumAmount(JsonField.ofNullable(minimumAmount)) fun minimumAmount(minimumAmount: Optional) = - minimumAmount(minimumAmount.orElse(null)) + minimumAmount(minimumAmount.getOrNull()) fun minimumAmount(minimumAmount: JsonField) = apply { this.minimumAmount = minimumAmount @@ -29831,9 +29793,8 @@ private constructor( fun planPhaseOrder(planPhaseOrder: Long) = planPhaseOrder(planPhaseOrder as Long?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) fun planPhaseOrder(planPhaseOrder: JsonField) = apply { this.planPhaseOrder = planPhaseOrder @@ -29856,7 +29817,7 @@ private constructor( fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: Optional - ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.orElse(null)) + ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.getOrNull()) fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: JsonField @@ -32129,7 +32090,7 @@ private constructor( billableMetric(JsonField.ofNullable(billableMetric)) fun billableMetric(billableMetric: Optional) = - billableMetric(billableMetric.orElse(null)) + billableMetric(billableMetric.getOrNull()) fun billableMetric(billableMetric: JsonField) = apply { this.billableMetric = billableMetric @@ -32151,9 +32112,8 @@ private constructor( fun conversionRate(conversionRate: Double) = conversionRate(conversionRate as Double?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) fun conversionRate(conversionRate: JsonField) = apply { this.conversionRate = conversionRate @@ -32169,7 +32129,7 @@ private constructor( creditAllocation(JsonField.ofNullable(creditAllocation)) fun creditAllocation(creditAllocation: Optional) = - creditAllocation(creditAllocation.orElse(null)) + creditAllocation(creditAllocation.getOrNull()) fun creditAllocation(creditAllocation: JsonField) = apply { this.creditAllocation = creditAllocation @@ -32181,7 +32141,7 @@ private constructor( fun discount(discount: Discount?) = discount(JsonField.ofNullable(discount)) - fun discount(discount: Optional) = discount(discount.orElse(null)) + fun discount(discount: Optional) = discount(discount.getOrNull()) fun discount(discount: JsonField) = apply { this.discount = discount } @@ -32206,7 +32166,7 @@ private constructor( externalPriceId(JsonField.ofNullable(externalPriceId)) fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) fun externalPriceId(externalPriceId: JsonField) = apply { this.externalPriceId = externalPriceId @@ -32218,9 +32178,8 @@ private constructor( fun fixedPriceQuantity(fixedPriceQuantity: Double) = fixedPriceQuantity(fixedPriceQuantity as Double?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) fun fixedPriceQuantity(fixedPriceQuantity: JsonField) = apply { this.fixedPriceQuantity = fixedPriceQuantity @@ -32232,7 +32191,7 @@ private constructor( fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) fun invoicingCycleConfiguration( invoicingCycleConfiguration: JsonField @@ -32244,7 +32203,7 @@ private constructor( fun maximum(maximum: Maximum?) = maximum(JsonField.ofNullable(maximum)) - fun maximum(maximum: Optional) = maximum(maximum.orElse(null)) + fun maximum(maximum: Optional) = maximum(maximum.getOrNull()) fun maximum(maximum: JsonField) = apply { this.maximum = maximum } @@ -32252,7 +32211,7 @@ private constructor( maximumAmount(JsonField.ofNullable(maximumAmount)) fun maximumAmount(maximumAmount: Optional) = - maximumAmount(maximumAmount.orElse(null)) + maximumAmount(maximumAmount.getOrNull()) fun maximumAmount(maximumAmount: JsonField) = apply { this.maximumAmount = maximumAmount @@ -32274,7 +32233,7 @@ private constructor( fun minimum(minimum: Minimum?) = minimum(JsonField.ofNullable(minimum)) - fun minimum(minimum: Optional) = minimum(minimum.orElse(null)) + fun minimum(minimum: Optional) = minimum(minimum.getOrNull()) fun minimum(minimum: JsonField) = apply { this.minimum = minimum } @@ -32282,7 +32241,7 @@ private constructor( minimumAmount(JsonField.ofNullable(minimumAmount)) fun minimumAmount(minimumAmount: Optional) = - minimumAmount(minimumAmount.orElse(null)) + minimumAmount(minimumAmount.getOrNull()) fun minimumAmount(minimumAmount: JsonField) = apply { this.minimumAmount = minimumAmount @@ -32301,9 +32260,8 @@ private constructor( fun planPhaseOrder(planPhaseOrder: Long) = planPhaseOrder(planPhaseOrder as Long?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) fun planPhaseOrder(planPhaseOrder: JsonField) = apply { this.planPhaseOrder = planPhaseOrder @@ -32327,7 +32285,7 @@ private constructor( fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: Optional - ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.orElse(null)) + ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.getOrNull()) fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: JsonField @@ -34596,7 +34554,7 @@ private constructor( billableMetric(JsonField.ofNullable(billableMetric)) fun billableMetric(billableMetric: Optional) = - billableMetric(billableMetric.orElse(null)) + billableMetric(billableMetric.getOrNull()) fun billableMetric(billableMetric: JsonField) = apply { this.billableMetric = billableMetric @@ -34618,9 +34576,8 @@ private constructor( fun conversionRate(conversionRate: Double) = conversionRate(conversionRate as Double?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) fun conversionRate(conversionRate: JsonField) = apply { this.conversionRate = conversionRate @@ -34636,7 +34593,7 @@ private constructor( creditAllocation(JsonField.ofNullable(creditAllocation)) fun creditAllocation(creditAllocation: Optional) = - creditAllocation(creditAllocation.orElse(null)) + creditAllocation(creditAllocation.getOrNull()) fun creditAllocation(creditAllocation: JsonField) = apply { this.creditAllocation = creditAllocation @@ -34648,7 +34605,7 @@ private constructor( fun discount(discount: Discount?) = discount(JsonField.ofNullable(discount)) - fun discount(discount: Optional) = discount(discount.orElse(null)) + fun discount(discount: Optional) = discount(discount.getOrNull()) fun discount(discount: JsonField) = apply { this.discount = discount } @@ -34673,7 +34630,7 @@ private constructor( externalPriceId(JsonField.ofNullable(externalPriceId)) fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) fun externalPriceId(externalPriceId: JsonField) = apply { this.externalPriceId = externalPriceId @@ -34685,9 +34642,8 @@ private constructor( fun fixedPriceQuantity(fixedPriceQuantity: Double) = fixedPriceQuantity(fixedPriceQuantity as Double?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) fun fixedPriceQuantity(fixedPriceQuantity: JsonField) = apply { this.fixedPriceQuantity = fixedPriceQuantity @@ -34699,7 +34655,7 @@ private constructor( fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) fun invoicingCycleConfiguration( invoicingCycleConfiguration: JsonField @@ -34711,7 +34667,7 @@ private constructor( fun maximum(maximum: Maximum?) = maximum(JsonField.ofNullable(maximum)) - fun maximum(maximum: Optional) = maximum(maximum.orElse(null)) + fun maximum(maximum: Optional) = maximum(maximum.getOrNull()) fun maximum(maximum: JsonField) = apply { this.maximum = maximum } @@ -34719,7 +34675,7 @@ private constructor( maximumAmount(JsonField.ofNullable(maximumAmount)) fun maximumAmount(maximumAmount: Optional) = - maximumAmount(maximumAmount.orElse(null)) + maximumAmount(maximumAmount.getOrNull()) fun maximumAmount(maximumAmount: JsonField) = apply { this.maximumAmount = maximumAmount @@ -34741,7 +34697,7 @@ private constructor( fun minimum(minimum: Minimum?) = minimum(JsonField.ofNullable(minimum)) - fun minimum(minimum: Optional) = minimum(minimum.orElse(null)) + fun minimum(minimum: Optional) = minimum(minimum.getOrNull()) fun minimum(minimum: JsonField) = apply { this.minimum = minimum } @@ -34749,7 +34705,7 @@ private constructor( minimumAmount(JsonField.ofNullable(minimumAmount)) fun minimumAmount(minimumAmount: Optional) = - minimumAmount(minimumAmount.orElse(null)) + minimumAmount(minimumAmount.getOrNull()) fun minimumAmount(minimumAmount: JsonField) = apply { this.minimumAmount = minimumAmount @@ -34776,9 +34732,8 @@ private constructor( fun planPhaseOrder(planPhaseOrder: Long) = planPhaseOrder(planPhaseOrder as Long?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) fun planPhaseOrder(planPhaseOrder: JsonField) = apply { this.planPhaseOrder = planPhaseOrder @@ -34794,7 +34749,7 @@ private constructor( fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: Optional - ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.orElse(null)) + ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.getOrNull()) fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: JsonField @@ -37058,7 +37013,7 @@ private constructor( billableMetric(JsonField.ofNullable(billableMetric)) fun billableMetric(billableMetric: Optional) = - billableMetric(billableMetric.orElse(null)) + billableMetric(billableMetric.getOrNull()) fun billableMetric(billableMetric: JsonField) = apply { this.billableMetric = billableMetric @@ -37080,9 +37035,8 @@ private constructor( fun conversionRate(conversionRate: Double) = conversionRate(conversionRate as Double?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) fun conversionRate(conversionRate: JsonField) = apply { this.conversionRate = conversionRate @@ -37098,7 +37052,7 @@ private constructor( creditAllocation(JsonField.ofNullable(creditAllocation)) fun creditAllocation(creditAllocation: Optional) = - creditAllocation(creditAllocation.orElse(null)) + creditAllocation(creditAllocation.getOrNull()) fun creditAllocation(creditAllocation: JsonField) = apply { this.creditAllocation = creditAllocation @@ -37110,7 +37064,7 @@ private constructor( fun discount(discount: Discount?) = discount(JsonField.ofNullable(discount)) - fun discount(discount: Optional) = discount(discount.orElse(null)) + fun discount(discount: Optional) = discount(discount.getOrNull()) fun discount(discount: JsonField) = apply { this.discount = discount } @@ -37135,7 +37089,7 @@ private constructor( externalPriceId(JsonField.ofNullable(externalPriceId)) fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) fun externalPriceId(externalPriceId: JsonField) = apply { this.externalPriceId = externalPriceId @@ -37147,9 +37101,8 @@ private constructor( fun fixedPriceQuantity(fixedPriceQuantity: Double) = fixedPriceQuantity(fixedPriceQuantity as Double?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) fun fixedPriceQuantity(fixedPriceQuantity: JsonField) = apply { this.fixedPriceQuantity = fixedPriceQuantity @@ -37161,7 +37114,7 @@ private constructor( fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) fun invoicingCycleConfiguration( invoicingCycleConfiguration: JsonField @@ -37173,7 +37126,7 @@ private constructor( fun maximum(maximum: Maximum?) = maximum(JsonField.ofNullable(maximum)) - fun maximum(maximum: Optional) = maximum(maximum.orElse(null)) + fun maximum(maximum: Optional) = maximum(maximum.getOrNull()) fun maximum(maximum: JsonField) = apply { this.maximum = maximum } @@ -37181,7 +37134,7 @@ private constructor( maximumAmount(JsonField.ofNullable(maximumAmount)) fun maximumAmount(maximumAmount: Optional) = - maximumAmount(maximumAmount.orElse(null)) + maximumAmount(maximumAmount.getOrNull()) fun maximumAmount(maximumAmount: JsonField) = apply { this.maximumAmount = maximumAmount @@ -37203,7 +37156,7 @@ private constructor( fun minimum(minimum: Minimum?) = minimum(JsonField.ofNullable(minimum)) - fun minimum(minimum: Optional) = minimum(minimum.orElse(null)) + fun minimum(minimum: Optional) = minimum(minimum.getOrNull()) fun minimum(minimum: JsonField) = apply { this.minimum = minimum } @@ -37211,7 +37164,7 @@ private constructor( minimumAmount(JsonField.ofNullable(minimumAmount)) fun minimumAmount(minimumAmount: Optional) = - minimumAmount(minimumAmount.orElse(null)) + minimumAmount(minimumAmount.getOrNull()) fun minimumAmount(minimumAmount: JsonField) = apply { this.minimumAmount = minimumAmount @@ -37230,9 +37183,8 @@ private constructor( fun planPhaseOrder(planPhaseOrder: Long) = planPhaseOrder(planPhaseOrder as Long?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) fun planPhaseOrder(planPhaseOrder: JsonField) = apply { this.planPhaseOrder = planPhaseOrder @@ -37256,7 +37208,7 @@ private constructor( fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: Optional - ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.orElse(null)) + ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.getOrNull()) fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: JsonField @@ -39522,7 +39474,7 @@ private constructor( billableMetric(JsonField.ofNullable(billableMetric)) fun billableMetric(billableMetric: Optional) = - billableMetric(billableMetric.orElse(null)) + billableMetric(billableMetric.getOrNull()) fun billableMetric(billableMetric: JsonField) = apply { this.billableMetric = billableMetric @@ -39544,9 +39496,8 @@ private constructor( fun conversionRate(conversionRate: Double) = conversionRate(conversionRate as Double?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) fun conversionRate(conversionRate: JsonField) = apply { this.conversionRate = conversionRate @@ -39562,7 +39513,7 @@ private constructor( creditAllocation(JsonField.ofNullable(creditAllocation)) fun creditAllocation(creditAllocation: Optional) = - creditAllocation(creditAllocation.orElse(null)) + creditAllocation(creditAllocation.getOrNull()) fun creditAllocation(creditAllocation: JsonField) = apply { this.creditAllocation = creditAllocation @@ -39574,7 +39525,7 @@ private constructor( fun discount(discount: Discount?) = discount(JsonField.ofNullable(discount)) - fun discount(discount: Optional) = discount(discount.orElse(null)) + fun discount(discount: Optional) = discount(discount.getOrNull()) fun discount(discount: JsonField) = apply { this.discount = discount } @@ -39599,7 +39550,7 @@ private constructor( externalPriceId(JsonField.ofNullable(externalPriceId)) fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) fun externalPriceId(externalPriceId: JsonField) = apply { this.externalPriceId = externalPriceId @@ -39611,9 +39562,8 @@ private constructor( fun fixedPriceQuantity(fixedPriceQuantity: Double) = fixedPriceQuantity(fixedPriceQuantity as Double?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) fun fixedPriceQuantity(fixedPriceQuantity: JsonField) = apply { this.fixedPriceQuantity = fixedPriceQuantity @@ -39625,7 +39575,7 @@ private constructor( fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) fun invoicingCycleConfiguration( invoicingCycleConfiguration: JsonField @@ -39644,7 +39594,7 @@ private constructor( fun maximum(maximum: Maximum?) = maximum(JsonField.ofNullable(maximum)) - fun maximum(maximum: Optional) = maximum(maximum.orElse(null)) + fun maximum(maximum: Optional) = maximum(maximum.getOrNull()) fun maximum(maximum: JsonField) = apply { this.maximum = maximum } @@ -39652,7 +39602,7 @@ private constructor( maximumAmount(JsonField.ofNullable(maximumAmount)) fun maximumAmount(maximumAmount: Optional) = - maximumAmount(maximumAmount.orElse(null)) + maximumAmount(maximumAmount.getOrNull()) fun maximumAmount(maximumAmount: JsonField) = apply { this.maximumAmount = maximumAmount @@ -39674,7 +39624,7 @@ private constructor( fun minimum(minimum: Minimum?) = minimum(JsonField.ofNullable(minimum)) - fun minimum(minimum: Optional) = minimum(minimum.orElse(null)) + fun minimum(minimum: Optional) = minimum(minimum.getOrNull()) fun minimum(minimum: JsonField) = apply { this.minimum = minimum } @@ -39682,7 +39632,7 @@ private constructor( minimumAmount(JsonField.ofNullable(minimumAmount)) fun minimumAmount(minimumAmount: Optional) = - minimumAmount(minimumAmount.orElse(null)) + minimumAmount(minimumAmount.getOrNull()) fun minimumAmount(minimumAmount: JsonField) = apply { this.minimumAmount = minimumAmount @@ -39701,9 +39651,8 @@ private constructor( fun planPhaseOrder(planPhaseOrder: Long) = planPhaseOrder(planPhaseOrder as Long?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) fun planPhaseOrder(planPhaseOrder: JsonField) = apply { this.planPhaseOrder = planPhaseOrder @@ -39719,7 +39668,7 @@ private constructor( fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: Optional - ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.orElse(null)) + ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.getOrNull()) fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: JsonField @@ -42282,7 +42231,7 @@ private constructor( billableMetric(JsonField.ofNullable(billableMetric)) fun billableMetric(billableMetric: Optional) = - billableMetric(billableMetric.orElse(null)) + billableMetric(billableMetric.getOrNull()) fun billableMetric(billableMetric: JsonField) = apply { this.billableMetric = billableMetric @@ -42304,9 +42253,8 @@ private constructor( fun conversionRate(conversionRate: Double) = conversionRate(conversionRate as Double?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) fun conversionRate(conversionRate: JsonField) = apply { this.conversionRate = conversionRate @@ -42322,7 +42270,7 @@ private constructor( creditAllocation(JsonField.ofNullable(creditAllocation)) fun creditAllocation(creditAllocation: Optional) = - creditAllocation(creditAllocation.orElse(null)) + creditAllocation(creditAllocation.getOrNull()) fun creditAllocation(creditAllocation: JsonField) = apply { this.creditAllocation = creditAllocation @@ -42334,7 +42282,7 @@ private constructor( fun discount(discount: Discount?) = discount(JsonField.ofNullable(discount)) - fun discount(discount: Optional) = discount(discount.orElse(null)) + fun discount(discount: Optional) = discount(discount.getOrNull()) fun discount(discount: JsonField) = apply { this.discount = discount } @@ -42359,7 +42307,7 @@ private constructor( externalPriceId(JsonField.ofNullable(externalPriceId)) fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) fun externalPriceId(externalPriceId: JsonField) = apply { this.externalPriceId = externalPriceId @@ -42371,9 +42319,8 @@ private constructor( fun fixedPriceQuantity(fixedPriceQuantity: Double) = fixedPriceQuantity(fixedPriceQuantity as Double?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) fun fixedPriceQuantity(fixedPriceQuantity: JsonField) = apply { this.fixedPriceQuantity = fixedPriceQuantity @@ -42385,7 +42332,7 @@ private constructor( fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) fun invoicingCycleConfiguration( invoicingCycleConfiguration: JsonField @@ -42397,7 +42344,7 @@ private constructor( fun maximum(maximum: Maximum?) = maximum(JsonField.ofNullable(maximum)) - fun maximum(maximum: Optional) = maximum(maximum.orElse(null)) + fun maximum(maximum: Optional) = maximum(maximum.getOrNull()) fun maximum(maximum: JsonField) = apply { this.maximum = maximum } @@ -42405,7 +42352,7 @@ private constructor( maximumAmount(JsonField.ofNullable(maximumAmount)) fun maximumAmount(maximumAmount: Optional) = - maximumAmount(maximumAmount.orElse(null)) + maximumAmount(maximumAmount.getOrNull()) fun maximumAmount(maximumAmount: JsonField) = apply { this.maximumAmount = maximumAmount @@ -42427,7 +42374,7 @@ private constructor( fun minimum(minimum: Minimum?) = minimum(JsonField.ofNullable(minimum)) - fun minimum(minimum: Optional) = minimum(minimum.orElse(null)) + fun minimum(minimum: Optional) = minimum(minimum.getOrNull()) fun minimum(minimum: JsonField) = apply { this.minimum = minimum } @@ -42435,7 +42382,7 @@ private constructor( minimumAmount(JsonField.ofNullable(minimumAmount)) fun minimumAmount(minimumAmount: Optional) = - minimumAmount(minimumAmount.orElse(null)) + minimumAmount(minimumAmount.getOrNull()) fun minimumAmount(minimumAmount: JsonField) = apply { this.minimumAmount = minimumAmount @@ -42454,9 +42401,8 @@ private constructor( fun planPhaseOrder(planPhaseOrder: Long) = planPhaseOrder(planPhaseOrder as Long?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) fun planPhaseOrder(planPhaseOrder: JsonField) = apply { this.planPhaseOrder = planPhaseOrder @@ -42479,7 +42425,7 @@ private constructor( fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: Optional - ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.orElse(null)) + ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.getOrNull()) fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: JsonField @@ -44742,7 +44688,7 @@ private constructor( billableMetric(JsonField.ofNullable(billableMetric)) fun billableMetric(billableMetric: Optional) = - billableMetric(billableMetric.orElse(null)) + billableMetric(billableMetric.getOrNull()) fun billableMetric(billableMetric: JsonField) = apply { this.billableMetric = billableMetric @@ -44764,9 +44710,8 @@ private constructor( fun conversionRate(conversionRate: Double) = conversionRate(conversionRate as Double?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) fun conversionRate(conversionRate: JsonField) = apply { this.conversionRate = conversionRate @@ -44782,7 +44727,7 @@ private constructor( creditAllocation(JsonField.ofNullable(creditAllocation)) fun creditAllocation(creditAllocation: Optional) = - creditAllocation(creditAllocation.orElse(null)) + creditAllocation(creditAllocation.getOrNull()) fun creditAllocation(creditAllocation: JsonField) = apply { this.creditAllocation = creditAllocation @@ -44794,7 +44739,7 @@ private constructor( fun discount(discount: Discount?) = discount(JsonField.ofNullable(discount)) - fun discount(discount: Optional) = discount(discount.orElse(null)) + fun discount(discount: Optional) = discount(discount.getOrNull()) fun discount(discount: JsonField) = apply { this.discount = discount } @@ -44819,7 +44764,7 @@ private constructor( externalPriceId(JsonField.ofNullable(externalPriceId)) fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) fun externalPriceId(externalPriceId: JsonField) = apply { this.externalPriceId = externalPriceId @@ -44831,9 +44776,8 @@ private constructor( fun fixedPriceQuantity(fixedPriceQuantity: Double) = fixedPriceQuantity(fixedPriceQuantity as Double?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) fun fixedPriceQuantity(fixedPriceQuantity: JsonField) = apply { this.fixedPriceQuantity = fixedPriceQuantity @@ -44845,7 +44789,7 @@ private constructor( fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) fun invoicingCycleConfiguration( invoicingCycleConfiguration: JsonField @@ -44857,7 +44801,7 @@ private constructor( fun maximum(maximum: Maximum?) = maximum(JsonField.ofNullable(maximum)) - fun maximum(maximum: Optional) = maximum(maximum.orElse(null)) + fun maximum(maximum: Optional) = maximum(maximum.getOrNull()) fun maximum(maximum: JsonField) = apply { this.maximum = maximum } @@ -44865,7 +44809,7 @@ private constructor( maximumAmount(JsonField.ofNullable(maximumAmount)) fun maximumAmount(maximumAmount: Optional) = - maximumAmount(maximumAmount.orElse(null)) + maximumAmount(maximumAmount.getOrNull()) fun maximumAmount(maximumAmount: JsonField) = apply { this.maximumAmount = maximumAmount @@ -44887,7 +44831,7 @@ private constructor( fun minimum(minimum: Minimum?) = minimum(JsonField.ofNullable(minimum)) - fun minimum(minimum: Optional) = minimum(minimum.orElse(null)) + fun minimum(minimum: Optional) = minimum(minimum.getOrNull()) fun minimum(minimum: JsonField) = apply { this.minimum = minimum } @@ -44895,7 +44839,7 @@ private constructor( minimumAmount(JsonField.ofNullable(minimumAmount)) fun minimumAmount(minimumAmount: Optional) = - minimumAmount(minimumAmount.orElse(null)) + minimumAmount(minimumAmount.getOrNull()) fun minimumAmount(minimumAmount: JsonField) = apply { this.minimumAmount = minimumAmount @@ -44914,9 +44858,8 @@ private constructor( fun planPhaseOrder(planPhaseOrder: Long) = planPhaseOrder(planPhaseOrder as Long?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) fun planPhaseOrder(planPhaseOrder: JsonField) = apply { this.planPhaseOrder = planPhaseOrder @@ -44939,7 +44882,7 @@ private constructor( fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: Optional - ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.orElse(null)) + ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.getOrNull()) fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: JsonField @@ -47202,7 +47145,7 @@ private constructor( billableMetric(JsonField.ofNullable(billableMetric)) fun billableMetric(billableMetric: Optional) = - billableMetric(billableMetric.orElse(null)) + billableMetric(billableMetric.getOrNull()) fun billableMetric(billableMetric: JsonField) = apply { this.billableMetric = billableMetric @@ -47224,9 +47167,8 @@ private constructor( fun conversionRate(conversionRate: Double) = conversionRate(conversionRate as Double?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) fun conversionRate(conversionRate: JsonField) = apply { this.conversionRate = conversionRate @@ -47242,7 +47184,7 @@ private constructor( creditAllocation(JsonField.ofNullable(creditAllocation)) fun creditAllocation(creditAllocation: Optional) = - creditAllocation(creditAllocation.orElse(null)) + creditAllocation(creditAllocation.getOrNull()) fun creditAllocation(creditAllocation: JsonField) = apply { this.creditAllocation = creditAllocation @@ -47254,7 +47196,7 @@ private constructor( fun discount(discount: Discount?) = discount(JsonField.ofNullable(discount)) - fun discount(discount: Optional) = discount(discount.orElse(null)) + fun discount(discount: Optional) = discount(discount.getOrNull()) fun discount(discount: JsonField) = apply { this.discount = discount } @@ -47279,7 +47221,7 @@ private constructor( externalPriceId(JsonField.ofNullable(externalPriceId)) fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) fun externalPriceId(externalPriceId: JsonField) = apply { this.externalPriceId = externalPriceId @@ -47291,9 +47233,8 @@ private constructor( fun fixedPriceQuantity(fixedPriceQuantity: Double) = fixedPriceQuantity(fixedPriceQuantity as Double?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) fun fixedPriceQuantity(fixedPriceQuantity: JsonField) = apply { this.fixedPriceQuantity = fixedPriceQuantity @@ -47312,7 +47253,7 @@ private constructor( fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) fun invoicingCycleConfiguration( invoicingCycleConfiguration: JsonField @@ -47324,7 +47265,7 @@ private constructor( fun maximum(maximum: Maximum?) = maximum(JsonField.ofNullable(maximum)) - fun maximum(maximum: Optional) = maximum(maximum.orElse(null)) + fun maximum(maximum: Optional) = maximum(maximum.getOrNull()) fun maximum(maximum: JsonField) = apply { this.maximum = maximum } @@ -47332,7 +47273,7 @@ private constructor( maximumAmount(JsonField.ofNullable(maximumAmount)) fun maximumAmount(maximumAmount: Optional) = - maximumAmount(maximumAmount.orElse(null)) + maximumAmount(maximumAmount.getOrNull()) fun maximumAmount(maximumAmount: JsonField) = apply { this.maximumAmount = maximumAmount @@ -47354,7 +47295,7 @@ private constructor( fun minimum(minimum: Minimum?) = minimum(JsonField.ofNullable(minimum)) - fun minimum(minimum: Optional) = minimum(minimum.orElse(null)) + fun minimum(minimum: Optional) = minimum(minimum.getOrNull()) fun minimum(minimum: JsonField) = apply { this.minimum = minimum } @@ -47362,7 +47303,7 @@ private constructor( minimumAmount(JsonField.ofNullable(minimumAmount)) fun minimumAmount(minimumAmount: Optional) = - minimumAmount(minimumAmount.orElse(null)) + minimumAmount(minimumAmount.getOrNull()) fun minimumAmount(minimumAmount: JsonField) = apply { this.minimumAmount = minimumAmount @@ -47381,9 +47322,8 @@ private constructor( fun planPhaseOrder(planPhaseOrder: Long) = planPhaseOrder(planPhaseOrder as Long?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) fun planPhaseOrder(planPhaseOrder: JsonField) = apply { this.planPhaseOrder = planPhaseOrder @@ -47399,7 +47339,7 @@ private constructor( fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: Optional - ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.orElse(null)) + ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.getOrNull()) fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: JsonField @@ -49673,7 +49613,7 @@ private constructor( billableMetric(JsonField.ofNullable(billableMetric)) fun billableMetric(billableMetric: Optional) = - billableMetric(billableMetric.orElse(null)) + billableMetric(billableMetric.getOrNull()) fun billableMetric(billableMetric: JsonField) = apply { this.billableMetric = billableMetric @@ -49695,9 +49635,8 @@ private constructor( fun conversionRate(conversionRate: Double) = conversionRate(conversionRate as Double?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) fun conversionRate(conversionRate: JsonField) = apply { this.conversionRate = conversionRate @@ -49713,7 +49652,7 @@ private constructor( creditAllocation(JsonField.ofNullable(creditAllocation)) fun creditAllocation(creditAllocation: Optional) = - creditAllocation(creditAllocation.orElse(null)) + creditAllocation(creditAllocation.getOrNull()) fun creditAllocation(creditAllocation: JsonField) = apply { this.creditAllocation = creditAllocation @@ -49725,7 +49664,7 @@ private constructor( fun discount(discount: Discount?) = discount(JsonField.ofNullable(discount)) - fun discount(discount: Optional) = discount(discount.orElse(null)) + fun discount(discount: Optional) = discount(discount.getOrNull()) fun discount(discount: JsonField) = apply { this.discount = discount } @@ -49750,7 +49689,7 @@ private constructor( externalPriceId(JsonField.ofNullable(externalPriceId)) fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) fun externalPriceId(externalPriceId: JsonField) = apply { this.externalPriceId = externalPriceId @@ -49762,9 +49701,8 @@ private constructor( fun fixedPriceQuantity(fixedPriceQuantity: Double) = fixedPriceQuantity(fixedPriceQuantity as Double?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) fun fixedPriceQuantity(fixedPriceQuantity: JsonField) = apply { this.fixedPriceQuantity = fixedPriceQuantity @@ -49784,7 +49722,7 @@ private constructor( fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) fun invoicingCycleConfiguration( invoicingCycleConfiguration: JsonField @@ -49796,7 +49734,7 @@ private constructor( fun maximum(maximum: Maximum?) = maximum(JsonField.ofNullable(maximum)) - fun maximum(maximum: Optional) = maximum(maximum.orElse(null)) + fun maximum(maximum: Optional) = maximum(maximum.getOrNull()) fun maximum(maximum: JsonField) = apply { this.maximum = maximum } @@ -49804,7 +49742,7 @@ private constructor( maximumAmount(JsonField.ofNullable(maximumAmount)) fun maximumAmount(maximumAmount: Optional) = - maximumAmount(maximumAmount.orElse(null)) + maximumAmount(maximumAmount.getOrNull()) fun maximumAmount(maximumAmount: JsonField) = apply { this.maximumAmount = maximumAmount @@ -49826,7 +49764,7 @@ private constructor( fun minimum(minimum: Minimum?) = minimum(JsonField.ofNullable(minimum)) - fun minimum(minimum: Optional) = minimum(minimum.orElse(null)) + fun minimum(minimum: Optional) = minimum(minimum.getOrNull()) fun minimum(minimum: JsonField) = apply { this.minimum = minimum } @@ -49834,7 +49772,7 @@ private constructor( minimumAmount(JsonField.ofNullable(minimumAmount)) fun minimumAmount(minimumAmount: Optional) = - minimumAmount(minimumAmount.orElse(null)) + minimumAmount(minimumAmount.getOrNull()) fun minimumAmount(minimumAmount: JsonField) = apply { this.minimumAmount = minimumAmount @@ -49853,9 +49791,8 @@ private constructor( fun planPhaseOrder(planPhaseOrder: Long) = planPhaseOrder(planPhaseOrder as Long?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) fun planPhaseOrder(planPhaseOrder: JsonField) = apply { this.planPhaseOrder = planPhaseOrder @@ -49871,7 +49808,7 @@ private constructor( fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: Optional - ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.orElse(null)) + ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.getOrNull()) fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: JsonField @@ -52150,7 +52087,7 @@ private constructor( billableMetric(JsonField.ofNullable(billableMetric)) fun billableMetric(billableMetric: Optional) = - billableMetric(billableMetric.orElse(null)) + billableMetric(billableMetric.getOrNull()) fun billableMetric(billableMetric: JsonField) = apply { this.billableMetric = billableMetric @@ -52172,9 +52109,8 @@ private constructor( fun conversionRate(conversionRate: Double) = conversionRate(conversionRate as Double?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) fun conversionRate(conversionRate: JsonField) = apply { this.conversionRate = conversionRate @@ -52190,7 +52126,7 @@ private constructor( creditAllocation(JsonField.ofNullable(creditAllocation)) fun creditAllocation(creditAllocation: Optional) = - creditAllocation(creditAllocation.orElse(null)) + creditAllocation(creditAllocation.getOrNull()) fun creditAllocation(creditAllocation: JsonField) = apply { this.creditAllocation = creditAllocation @@ -52202,7 +52138,7 @@ private constructor( fun discount(discount: Discount?) = discount(JsonField.ofNullable(discount)) - fun discount(discount: Optional) = discount(discount.orElse(null)) + fun discount(discount: Optional) = discount(discount.getOrNull()) fun discount(discount: JsonField) = apply { this.discount = discount } @@ -52227,7 +52163,7 @@ private constructor( externalPriceId(JsonField.ofNullable(externalPriceId)) fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) fun externalPriceId(externalPriceId: JsonField) = apply { this.externalPriceId = externalPriceId @@ -52239,9 +52175,8 @@ private constructor( fun fixedPriceQuantity(fixedPriceQuantity: Double) = fixedPriceQuantity(fixedPriceQuantity as Double?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) fun fixedPriceQuantity(fixedPriceQuantity: JsonField) = apply { this.fixedPriceQuantity = fixedPriceQuantity @@ -52261,7 +52196,7 @@ private constructor( fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) fun invoicingCycleConfiguration( invoicingCycleConfiguration: JsonField @@ -52273,7 +52208,7 @@ private constructor( fun maximum(maximum: Maximum?) = maximum(JsonField.ofNullable(maximum)) - fun maximum(maximum: Optional) = maximum(maximum.orElse(null)) + fun maximum(maximum: Optional) = maximum(maximum.getOrNull()) fun maximum(maximum: JsonField) = apply { this.maximum = maximum } @@ -52281,7 +52216,7 @@ private constructor( maximumAmount(JsonField.ofNullable(maximumAmount)) fun maximumAmount(maximumAmount: Optional) = - maximumAmount(maximumAmount.orElse(null)) + maximumAmount(maximumAmount.getOrNull()) fun maximumAmount(maximumAmount: JsonField) = apply { this.maximumAmount = maximumAmount @@ -52303,7 +52238,7 @@ private constructor( fun minimum(minimum: Minimum?) = minimum(JsonField.ofNullable(minimum)) - fun minimum(minimum: Optional) = minimum(minimum.orElse(null)) + fun minimum(minimum: Optional) = minimum(minimum.getOrNull()) fun minimum(minimum: JsonField) = apply { this.minimum = minimum } @@ -52311,7 +52246,7 @@ private constructor( minimumAmount(JsonField.ofNullable(minimumAmount)) fun minimumAmount(minimumAmount: Optional) = - minimumAmount(minimumAmount.orElse(null)) + minimumAmount(minimumAmount.getOrNull()) fun minimumAmount(minimumAmount: JsonField) = apply { this.minimumAmount = minimumAmount @@ -52330,9 +52265,8 @@ private constructor( fun planPhaseOrder(planPhaseOrder: Long) = planPhaseOrder(planPhaseOrder as Long?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) fun planPhaseOrder(planPhaseOrder: JsonField) = apply { this.planPhaseOrder = planPhaseOrder @@ -52348,7 +52282,7 @@ private constructor( fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: Optional - ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.orElse(null)) + ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.getOrNull()) fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: JsonField @@ -54621,7 +54555,7 @@ private constructor( billableMetric(JsonField.ofNullable(billableMetric)) fun billableMetric(billableMetric: Optional) = - billableMetric(billableMetric.orElse(null)) + billableMetric(billableMetric.getOrNull()) fun billableMetric(billableMetric: JsonField) = apply { this.billableMetric = billableMetric @@ -54643,9 +54577,8 @@ private constructor( fun conversionRate(conversionRate: Double) = conversionRate(conversionRate as Double?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) fun conversionRate(conversionRate: JsonField) = apply { this.conversionRate = conversionRate @@ -54661,7 +54594,7 @@ private constructor( creditAllocation(JsonField.ofNullable(creditAllocation)) fun creditAllocation(creditAllocation: Optional) = - creditAllocation(creditAllocation.orElse(null)) + creditAllocation(creditAllocation.getOrNull()) fun creditAllocation(creditAllocation: JsonField) = apply { this.creditAllocation = creditAllocation @@ -54673,7 +54606,7 @@ private constructor( fun discount(discount: Discount?) = discount(JsonField.ofNullable(discount)) - fun discount(discount: Optional) = discount(discount.orElse(null)) + fun discount(discount: Optional) = discount(discount.getOrNull()) fun discount(discount: JsonField) = apply { this.discount = discount } @@ -54698,7 +54631,7 @@ private constructor( externalPriceId(JsonField.ofNullable(externalPriceId)) fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) fun externalPriceId(externalPriceId: JsonField) = apply { this.externalPriceId = externalPriceId @@ -54710,9 +54643,8 @@ private constructor( fun fixedPriceQuantity(fixedPriceQuantity: Double) = fixedPriceQuantity(fixedPriceQuantity as Double?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) fun fixedPriceQuantity(fixedPriceQuantity: JsonField) = apply { this.fixedPriceQuantity = fixedPriceQuantity @@ -54724,7 +54656,7 @@ private constructor( fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) fun invoicingCycleConfiguration( invoicingCycleConfiguration: JsonField @@ -54744,7 +54676,7 @@ private constructor( fun maximum(maximum: Maximum?) = maximum(JsonField.ofNullable(maximum)) - fun maximum(maximum: Optional) = maximum(maximum.orElse(null)) + fun maximum(maximum: Optional) = maximum(maximum.getOrNull()) fun maximum(maximum: JsonField) = apply { this.maximum = maximum } @@ -54752,7 +54684,7 @@ private constructor( maximumAmount(JsonField.ofNullable(maximumAmount)) fun maximumAmount(maximumAmount: Optional) = - maximumAmount(maximumAmount.orElse(null)) + maximumAmount(maximumAmount.getOrNull()) fun maximumAmount(maximumAmount: JsonField) = apply { this.maximumAmount = maximumAmount @@ -54774,7 +54706,7 @@ private constructor( fun minimum(minimum: Minimum?) = minimum(JsonField.ofNullable(minimum)) - fun minimum(minimum: Optional) = minimum(minimum.orElse(null)) + fun minimum(minimum: Optional) = minimum(minimum.getOrNull()) fun minimum(minimum: JsonField) = apply { this.minimum = minimum } @@ -54782,7 +54714,7 @@ private constructor( minimumAmount(JsonField.ofNullable(minimumAmount)) fun minimumAmount(minimumAmount: Optional) = - minimumAmount(minimumAmount.orElse(null)) + minimumAmount(minimumAmount.getOrNull()) fun minimumAmount(minimumAmount: JsonField) = apply { this.minimumAmount = minimumAmount @@ -54801,9 +54733,8 @@ private constructor( fun planPhaseOrder(planPhaseOrder: Long) = planPhaseOrder(planPhaseOrder as Long?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) fun planPhaseOrder(planPhaseOrder: JsonField) = apply { this.planPhaseOrder = planPhaseOrder @@ -54819,7 +54750,7 @@ private constructor( fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: Optional - ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.orElse(null)) + ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.getOrNull()) fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: JsonField @@ -57083,7 +57014,7 @@ private constructor( billableMetric(JsonField.ofNullable(billableMetric)) fun billableMetric(billableMetric: Optional) = - billableMetric(billableMetric.orElse(null)) + billableMetric(billableMetric.getOrNull()) fun billableMetric(billableMetric: JsonField) = apply { this.billableMetric = billableMetric @@ -57112,9 +57043,8 @@ private constructor( fun conversionRate(conversionRate: Double) = conversionRate(conversionRate as Double?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) fun conversionRate(conversionRate: JsonField) = apply { this.conversionRate = conversionRate @@ -57130,7 +57060,7 @@ private constructor( creditAllocation(JsonField.ofNullable(creditAllocation)) fun creditAllocation(creditAllocation: Optional) = - creditAllocation(creditAllocation.orElse(null)) + creditAllocation(creditAllocation.getOrNull()) fun creditAllocation(creditAllocation: JsonField) = apply { this.creditAllocation = creditAllocation @@ -57142,7 +57072,7 @@ private constructor( fun discount(discount: Discount?) = discount(JsonField.ofNullable(discount)) - fun discount(discount: Optional) = discount(discount.orElse(null)) + fun discount(discount: Optional) = discount(discount.getOrNull()) fun discount(discount: JsonField) = apply { this.discount = discount } @@ -57167,7 +57097,7 @@ private constructor( externalPriceId(JsonField.ofNullable(externalPriceId)) fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) fun externalPriceId(externalPriceId: JsonField) = apply { this.externalPriceId = externalPriceId @@ -57179,9 +57109,8 @@ private constructor( fun fixedPriceQuantity(fixedPriceQuantity: Double) = fixedPriceQuantity(fixedPriceQuantity as Double?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) fun fixedPriceQuantity(fixedPriceQuantity: JsonField) = apply { this.fixedPriceQuantity = fixedPriceQuantity @@ -57193,7 +57122,7 @@ private constructor( fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) fun invoicingCycleConfiguration( invoicingCycleConfiguration: JsonField @@ -57205,7 +57134,7 @@ private constructor( fun maximum(maximum: Maximum?) = maximum(JsonField.ofNullable(maximum)) - fun maximum(maximum: Optional) = maximum(maximum.orElse(null)) + fun maximum(maximum: Optional) = maximum(maximum.getOrNull()) fun maximum(maximum: JsonField) = apply { this.maximum = maximum } @@ -57213,7 +57142,7 @@ private constructor( maximumAmount(JsonField.ofNullable(maximumAmount)) fun maximumAmount(maximumAmount: Optional) = - maximumAmount(maximumAmount.orElse(null)) + maximumAmount(maximumAmount.getOrNull()) fun maximumAmount(maximumAmount: JsonField) = apply { this.maximumAmount = maximumAmount @@ -57235,7 +57164,7 @@ private constructor( fun minimum(minimum: Minimum?) = minimum(JsonField.ofNullable(minimum)) - fun minimum(minimum: Optional) = minimum(minimum.orElse(null)) + fun minimum(minimum: Optional) = minimum(minimum.getOrNull()) fun minimum(minimum: JsonField) = apply { this.minimum = minimum } @@ -57243,7 +57172,7 @@ private constructor( minimumAmount(JsonField.ofNullable(minimumAmount)) fun minimumAmount(minimumAmount: Optional) = - minimumAmount(minimumAmount.orElse(null)) + minimumAmount(minimumAmount.getOrNull()) fun minimumAmount(minimumAmount: JsonField) = apply { this.minimumAmount = minimumAmount @@ -57262,9 +57191,8 @@ private constructor( fun planPhaseOrder(planPhaseOrder: Long) = planPhaseOrder(planPhaseOrder as Long?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) fun planPhaseOrder(planPhaseOrder: JsonField) = apply { this.planPhaseOrder = planPhaseOrder @@ -57280,7 +57208,7 @@ private constructor( fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: Optional - ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.orElse(null)) + ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.getOrNull()) fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: JsonField @@ -59547,7 +59475,7 @@ private constructor( billableMetric(JsonField.ofNullable(billableMetric)) fun billableMetric(billableMetric: Optional) = - billableMetric(billableMetric.orElse(null)) + billableMetric(billableMetric.getOrNull()) fun billableMetric(billableMetric: JsonField) = apply { this.billableMetric = billableMetric @@ -59569,9 +59497,8 @@ private constructor( fun conversionRate(conversionRate: Double) = conversionRate(conversionRate as Double?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) fun conversionRate(conversionRate: JsonField) = apply { this.conversionRate = conversionRate @@ -59587,7 +59514,7 @@ private constructor( creditAllocation(JsonField.ofNullable(creditAllocation)) fun creditAllocation(creditAllocation: Optional) = - creditAllocation(creditAllocation.orElse(null)) + creditAllocation(creditAllocation.getOrNull()) fun creditAllocation(creditAllocation: JsonField) = apply { this.creditAllocation = creditAllocation @@ -59599,7 +59526,7 @@ private constructor( fun discount(discount: Discount?) = discount(JsonField.ofNullable(discount)) - fun discount(discount: Optional) = discount(discount.orElse(null)) + fun discount(discount: Optional) = discount(discount.getOrNull()) fun discount(discount: JsonField) = apply { this.discount = discount } @@ -59624,7 +59551,7 @@ private constructor( externalPriceId(JsonField.ofNullable(externalPriceId)) fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) fun externalPriceId(externalPriceId: JsonField) = apply { this.externalPriceId = externalPriceId @@ -59636,9 +59563,8 @@ private constructor( fun fixedPriceQuantity(fixedPriceQuantity: Double) = fixedPriceQuantity(fixedPriceQuantity as Double?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) fun fixedPriceQuantity(fixedPriceQuantity: JsonField) = apply { this.fixedPriceQuantity = fixedPriceQuantity @@ -59657,7 +59583,7 @@ private constructor( fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) fun invoicingCycleConfiguration( invoicingCycleConfiguration: JsonField @@ -59669,7 +59595,7 @@ private constructor( fun maximum(maximum: Maximum?) = maximum(JsonField.ofNullable(maximum)) - fun maximum(maximum: Optional) = maximum(maximum.orElse(null)) + fun maximum(maximum: Optional) = maximum(maximum.getOrNull()) fun maximum(maximum: JsonField) = apply { this.maximum = maximum } @@ -59677,7 +59603,7 @@ private constructor( maximumAmount(JsonField.ofNullable(maximumAmount)) fun maximumAmount(maximumAmount: Optional) = - maximumAmount(maximumAmount.orElse(null)) + maximumAmount(maximumAmount.getOrNull()) fun maximumAmount(maximumAmount: JsonField) = apply { this.maximumAmount = maximumAmount @@ -59699,7 +59625,7 @@ private constructor( fun minimum(minimum: Minimum?) = minimum(JsonField.ofNullable(minimum)) - fun minimum(minimum: Optional) = minimum(minimum.orElse(null)) + fun minimum(minimum: Optional) = minimum(minimum.getOrNull()) fun minimum(minimum: JsonField) = apply { this.minimum = minimum } @@ -59707,7 +59633,7 @@ private constructor( minimumAmount(JsonField.ofNullable(minimumAmount)) fun minimumAmount(minimumAmount: Optional) = - minimumAmount(minimumAmount.orElse(null)) + minimumAmount(minimumAmount.getOrNull()) fun minimumAmount(minimumAmount: JsonField) = apply { this.minimumAmount = minimumAmount @@ -59726,9 +59652,8 @@ private constructor( fun planPhaseOrder(planPhaseOrder: Long) = planPhaseOrder(planPhaseOrder as Long?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) fun planPhaseOrder(planPhaseOrder: JsonField) = apply { this.planPhaseOrder = planPhaseOrder @@ -59744,7 +59669,7 @@ private constructor( fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: Optional - ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.orElse(null)) + ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.getOrNull()) fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: JsonField @@ -62012,7 +61937,7 @@ private constructor( billableMetric(JsonField.ofNullable(billableMetric)) fun billableMetric(billableMetric: Optional) = - billableMetric(billableMetric.orElse(null)) + billableMetric(billableMetric.getOrNull()) fun billableMetric(billableMetric: JsonField) = apply { this.billableMetric = billableMetric @@ -62034,9 +61959,8 @@ private constructor( fun conversionRate(conversionRate: Double) = conversionRate(conversionRate as Double?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) fun conversionRate(conversionRate: JsonField) = apply { this.conversionRate = conversionRate @@ -62052,7 +61976,7 @@ private constructor( creditAllocation(JsonField.ofNullable(creditAllocation)) fun creditAllocation(creditAllocation: Optional) = - creditAllocation(creditAllocation.orElse(null)) + creditAllocation(creditAllocation.getOrNull()) fun creditAllocation(creditAllocation: JsonField) = apply { this.creditAllocation = creditAllocation @@ -62064,7 +61988,7 @@ private constructor( fun discount(discount: Discount?) = discount(JsonField.ofNullable(discount)) - fun discount(discount: Optional) = discount(discount.orElse(null)) + fun discount(discount: Optional) = discount(discount.getOrNull()) fun discount(discount: JsonField) = apply { this.discount = discount } @@ -62089,7 +62013,7 @@ private constructor( externalPriceId(JsonField.ofNullable(externalPriceId)) fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) fun externalPriceId(externalPriceId: JsonField) = apply { this.externalPriceId = externalPriceId @@ -62101,9 +62025,8 @@ private constructor( fun fixedPriceQuantity(fixedPriceQuantity: Double) = fixedPriceQuantity(fixedPriceQuantity as Double?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) fun fixedPriceQuantity(fixedPriceQuantity: JsonField) = apply { this.fixedPriceQuantity = fixedPriceQuantity @@ -62115,7 +62038,7 @@ private constructor( fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) fun invoicingCycleConfiguration( invoicingCycleConfiguration: JsonField @@ -62135,7 +62058,7 @@ private constructor( fun maximum(maximum: Maximum?) = maximum(JsonField.ofNullable(maximum)) - fun maximum(maximum: Optional) = maximum(maximum.orElse(null)) + fun maximum(maximum: Optional) = maximum(maximum.getOrNull()) fun maximum(maximum: JsonField) = apply { this.maximum = maximum } @@ -62143,7 +62066,7 @@ private constructor( maximumAmount(JsonField.ofNullable(maximumAmount)) fun maximumAmount(maximumAmount: Optional) = - maximumAmount(maximumAmount.orElse(null)) + maximumAmount(maximumAmount.getOrNull()) fun maximumAmount(maximumAmount: JsonField) = apply { this.maximumAmount = maximumAmount @@ -62165,7 +62088,7 @@ private constructor( fun minimum(minimum: Minimum?) = minimum(JsonField.ofNullable(minimum)) - fun minimum(minimum: Optional) = minimum(minimum.orElse(null)) + fun minimum(minimum: Optional) = minimum(minimum.getOrNull()) fun minimum(minimum: JsonField) = apply { this.minimum = minimum } @@ -62173,7 +62096,7 @@ private constructor( minimumAmount(JsonField.ofNullable(minimumAmount)) fun minimumAmount(minimumAmount: Optional) = - minimumAmount(minimumAmount.orElse(null)) + minimumAmount(minimumAmount.getOrNull()) fun minimumAmount(minimumAmount: JsonField) = apply { this.minimumAmount = minimumAmount @@ -62192,9 +62115,8 @@ private constructor( fun planPhaseOrder(planPhaseOrder: Long) = planPhaseOrder(planPhaseOrder as Long?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) fun planPhaseOrder(planPhaseOrder: JsonField) = apply { this.planPhaseOrder = planPhaseOrder @@ -62210,7 +62132,7 @@ private constructor( fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: Optional - ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.orElse(null)) + ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.getOrNull()) fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: JsonField @@ -64489,7 +64411,7 @@ private constructor( billableMetric(JsonField.ofNullable(billableMetric)) fun billableMetric(billableMetric: Optional) = - billableMetric(billableMetric.orElse(null)) + billableMetric(billableMetric.getOrNull()) fun billableMetric(billableMetric: JsonField) = apply { this.billableMetric = billableMetric @@ -64511,9 +64433,8 @@ private constructor( fun conversionRate(conversionRate: Double) = conversionRate(conversionRate as Double?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) fun conversionRate(conversionRate: JsonField) = apply { this.conversionRate = conversionRate @@ -64529,7 +64450,7 @@ private constructor( creditAllocation(JsonField.ofNullable(creditAllocation)) fun creditAllocation(creditAllocation: Optional) = - creditAllocation(creditAllocation.orElse(null)) + creditAllocation(creditAllocation.getOrNull()) fun creditAllocation(creditAllocation: JsonField) = apply { this.creditAllocation = creditAllocation @@ -64541,7 +64462,7 @@ private constructor( fun discount(discount: Discount?) = discount(JsonField.ofNullable(discount)) - fun discount(discount: Optional) = discount(discount.orElse(null)) + fun discount(discount: Optional) = discount(discount.getOrNull()) fun discount(discount: JsonField) = apply { this.discount = discount } @@ -64566,7 +64487,7 @@ private constructor( externalPriceId(JsonField.ofNullable(externalPriceId)) fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) fun externalPriceId(externalPriceId: JsonField) = apply { this.externalPriceId = externalPriceId @@ -64578,9 +64499,8 @@ private constructor( fun fixedPriceQuantity(fixedPriceQuantity: Double) = fixedPriceQuantity(fixedPriceQuantity as Double?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) fun fixedPriceQuantity(fixedPriceQuantity: JsonField) = apply { this.fixedPriceQuantity = fixedPriceQuantity @@ -64592,7 +64512,7 @@ private constructor( fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) fun invoicingCycleConfiguration( invoicingCycleConfiguration: JsonField @@ -64604,7 +64524,7 @@ private constructor( fun maximum(maximum: Maximum?) = maximum(JsonField.ofNullable(maximum)) - fun maximum(maximum: Optional) = maximum(maximum.orElse(null)) + fun maximum(maximum: Optional) = maximum(maximum.getOrNull()) fun maximum(maximum: JsonField) = apply { this.maximum = maximum } @@ -64612,7 +64532,7 @@ private constructor( maximumAmount(JsonField.ofNullable(maximumAmount)) fun maximumAmount(maximumAmount: Optional) = - maximumAmount(maximumAmount.orElse(null)) + maximumAmount(maximumAmount.getOrNull()) fun maximumAmount(maximumAmount: JsonField) = apply { this.maximumAmount = maximumAmount @@ -64634,7 +64554,7 @@ private constructor( fun minimum(minimum: Minimum?) = minimum(JsonField.ofNullable(minimum)) - fun minimum(minimum: Optional) = minimum(minimum.orElse(null)) + fun minimum(minimum: Optional) = minimum(minimum.getOrNull()) fun minimum(minimum: JsonField) = apply { this.minimum = minimum } @@ -64642,7 +64562,7 @@ private constructor( minimumAmount(JsonField.ofNullable(minimumAmount)) fun minimumAmount(minimumAmount: Optional) = - minimumAmount(minimumAmount.orElse(null)) + minimumAmount(minimumAmount.getOrNull()) fun minimumAmount(minimumAmount: JsonField) = apply { this.minimumAmount = minimumAmount @@ -64661,9 +64581,8 @@ private constructor( fun planPhaseOrder(planPhaseOrder: Long) = planPhaseOrder(planPhaseOrder as Long?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) fun planPhaseOrder(planPhaseOrder: JsonField) = apply { this.planPhaseOrder = planPhaseOrder @@ -64692,7 +64611,7 @@ private constructor( fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: Optional - ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.orElse(null)) + ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.getOrNull()) fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: JsonField @@ -66976,7 +66895,7 @@ private constructor( billableMetric(JsonField.ofNullable(billableMetric)) fun billableMetric(billableMetric: Optional) = - billableMetric(billableMetric.orElse(null)) + billableMetric(billableMetric.getOrNull()) fun billableMetric(billableMetric: JsonField) = apply { this.billableMetric = billableMetric @@ -66998,9 +66917,8 @@ private constructor( fun conversionRate(conversionRate: Double) = conversionRate(conversionRate as Double?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) fun conversionRate(conversionRate: JsonField) = apply { this.conversionRate = conversionRate @@ -67016,7 +66934,7 @@ private constructor( creditAllocation(JsonField.ofNullable(creditAllocation)) fun creditAllocation(creditAllocation: Optional) = - creditAllocation(creditAllocation.orElse(null)) + creditAllocation(creditAllocation.getOrNull()) fun creditAllocation(creditAllocation: JsonField) = apply { this.creditAllocation = creditAllocation @@ -67028,7 +66946,7 @@ private constructor( fun discount(discount: Discount?) = discount(JsonField.ofNullable(discount)) - fun discount(discount: Optional) = discount(discount.orElse(null)) + fun discount(discount: Optional) = discount(discount.getOrNull()) fun discount(discount: JsonField) = apply { this.discount = discount } @@ -67053,7 +66971,7 @@ private constructor( externalPriceId(JsonField.ofNullable(externalPriceId)) fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) fun externalPriceId(externalPriceId: JsonField) = apply { this.externalPriceId = externalPriceId @@ -67065,9 +66983,8 @@ private constructor( fun fixedPriceQuantity(fixedPriceQuantity: Double) = fixedPriceQuantity(fixedPriceQuantity as Double?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) fun fixedPriceQuantity(fixedPriceQuantity: JsonField) = apply { this.fixedPriceQuantity = fixedPriceQuantity @@ -67079,7 +66996,7 @@ private constructor( fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) fun invoicingCycleConfiguration( invoicingCycleConfiguration: JsonField @@ -67091,7 +67008,7 @@ private constructor( fun maximum(maximum: Maximum?) = maximum(JsonField.ofNullable(maximum)) - fun maximum(maximum: Optional) = maximum(maximum.orElse(null)) + fun maximum(maximum: Optional) = maximum(maximum.getOrNull()) fun maximum(maximum: JsonField) = apply { this.maximum = maximum } @@ -67099,7 +67016,7 @@ private constructor( maximumAmount(JsonField.ofNullable(maximumAmount)) fun maximumAmount(maximumAmount: Optional) = - maximumAmount(maximumAmount.orElse(null)) + maximumAmount(maximumAmount.getOrNull()) fun maximumAmount(maximumAmount: JsonField) = apply { this.maximumAmount = maximumAmount @@ -67121,7 +67038,7 @@ private constructor( fun minimum(minimum: Minimum?) = minimum(JsonField.ofNullable(minimum)) - fun minimum(minimum: Optional) = minimum(minimum.orElse(null)) + fun minimum(minimum: Optional) = minimum(minimum.getOrNull()) fun minimum(minimum: JsonField) = apply { this.minimum = minimum } @@ -67129,7 +67046,7 @@ private constructor( minimumAmount(JsonField.ofNullable(minimumAmount)) fun minimumAmount(minimumAmount: Optional) = - minimumAmount(minimumAmount.orElse(null)) + minimumAmount(minimumAmount.getOrNull()) fun minimumAmount(minimumAmount: JsonField) = apply { this.minimumAmount = minimumAmount @@ -67148,9 +67065,8 @@ private constructor( fun planPhaseOrder(planPhaseOrder: Long) = planPhaseOrder(planPhaseOrder as Long?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) fun planPhaseOrder(planPhaseOrder: JsonField) = apply { this.planPhaseOrder = planPhaseOrder @@ -67180,7 +67096,7 @@ private constructor( fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: Optional - ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.orElse(null)) + ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.getOrNull()) fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: JsonField @@ -69454,7 +69370,7 @@ private constructor( billableMetric(JsonField.ofNullable(billableMetric)) fun billableMetric(billableMetric: Optional) = - billableMetric(billableMetric.orElse(null)) + billableMetric(billableMetric.getOrNull()) fun billableMetric(billableMetric: JsonField) = apply { this.billableMetric = billableMetric @@ -69476,9 +69392,8 @@ private constructor( fun conversionRate(conversionRate: Double) = conversionRate(conversionRate as Double?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) fun conversionRate(conversionRate: JsonField) = apply { this.conversionRate = conversionRate @@ -69494,7 +69409,7 @@ private constructor( creditAllocation(JsonField.ofNullable(creditAllocation)) fun creditAllocation(creditAllocation: Optional) = - creditAllocation(creditAllocation.orElse(null)) + creditAllocation(creditAllocation.getOrNull()) fun creditAllocation(creditAllocation: JsonField) = apply { this.creditAllocation = creditAllocation @@ -69514,7 +69429,7 @@ private constructor( fun discount(discount: Discount?) = discount(JsonField.ofNullable(discount)) - fun discount(discount: Optional) = discount(discount.orElse(null)) + fun discount(discount: Optional) = discount(discount.getOrNull()) fun discount(discount: JsonField) = apply { this.discount = discount } @@ -69539,7 +69454,7 @@ private constructor( externalPriceId(JsonField.ofNullable(externalPriceId)) fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) fun externalPriceId(externalPriceId: JsonField) = apply { this.externalPriceId = externalPriceId @@ -69551,9 +69466,8 @@ private constructor( fun fixedPriceQuantity(fixedPriceQuantity: Double) = fixedPriceQuantity(fixedPriceQuantity as Double?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) fun fixedPriceQuantity(fixedPriceQuantity: JsonField) = apply { this.fixedPriceQuantity = fixedPriceQuantity @@ -69565,7 +69479,7 @@ private constructor( fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) fun invoicingCycleConfiguration( invoicingCycleConfiguration: JsonField @@ -69577,7 +69491,7 @@ private constructor( fun maximum(maximum: Maximum?) = maximum(JsonField.ofNullable(maximum)) - fun maximum(maximum: Optional) = maximum(maximum.orElse(null)) + fun maximum(maximum: Optional) = maximum(maximum.getOrNull()) fun maximum(maximum: JsonField) = apply { this.maximum = maximum } @@ -69585,7 +69499,7 @@ private constructor( maximumAmount(JsonField.ofNullable(maximumAmount)) fun maximumAmount(maximumAmount: Optional) = - maximumAmount(maximumAmount.orElse(null)) + maximumAmount(maximumAmount.getOrNull()) fun maximumAmount(maximumAmount: JsonField) = apply { this.maximumAmount = maximumAmount @@ -69607,7 +69521,7 @@ private constructor( fun minimum(minimum: Minimum?) = minimum(JsonField.ofNullable(minimum)) - fun minimum(minimum: Optional) = minimum(minimum.orElse(null)) + fun minimum(minimum: Optional) = minimum(minimum.getOrNull()) fun minimum(minimum: JsonField) = apply { this.minimum = minimum } @@ -69615,7 +69529,7 @@ private constructor( minimumAmount(JsonField.ofNullable(minimumAmount)) fun minimumAmount(minimumAmount: Optional) = - minimumAmount(minimumAmount.orElse(null)) + minimumAmount(minimumAmount.getOrNull()) fun minimumAmount(minimumAmount: JsonField) = apply { this.minimumAmount = minimumAmount @@ -69634,9 +69548,8 @@ private constructor( fun planPhaseOrder(planPhaseOrder: Long) = planPhaseOrder(planPhaseOrder as Long?) - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) fun planPhaseOrder(planPhaseOrder: JsonField) = apply { this.planPhaseOrder = planPhaseOrder @@ -69652,7 +69565,7 @@ private constructor( fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: Optional - ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.orElse(null)) + ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.getOrNull()) fun dimensionalPriceConfiguration( dimensionalPriceConfiguration: JsonField diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceCreateParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceCreateParams.kt index b5e559d2..90e892b6 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceCreateParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceCreateParams.kt @@ -1741,7 +1741,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -1769,9 +1769,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if this @@ -1795,7 +1794,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -1814,9 +1813,8 @@ private constructor( conversionRate(conversionRate as Double?) /** The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** The per unit conversion rate of the price currency to the invoicing currency. */ fun conversionRate(conversionRate: JsonField) = apply { @@ -1829,7 +1827,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -1854,9 +1852,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -1872,7 +1869,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -1893,7 +1890,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are produced. @@ -1915,7 +1912,7 @@ private constructor( * by setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -3277,7 +3274,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -3305,9 +3302,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if this @@ -3331,7 +3327,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -3350,9 +3346,8 @@ private constructor( conversionRate(conversionRate as Double?) /** The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** The per unit conversion rate of the price currency to the invoicing currency. */ fun conversionRate(conversionRate: JsonField) = apply { @@ -3365,7 +3360,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -3390,9 +3385,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -3408,7 +3402,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -3429,7 +3423,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are produced. @@ -3451,7 +3445,7 @@ private constructor( * by setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -4849,7 +4843,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -4877,9 +4871,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if this @@ -4903,7 +4896,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -4922,9 +4915,8 @@ private constructor( conversionRate(conversionRate as Double?) /** The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** The per unit conversion rate of the price currency to the invoicing currency. */ fun conversionRate(conversionRate: JsonField) = apply { @@ -4937,7 +4929,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -4962,9 +4954,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -4980,7 +4971,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -5001,7 +4992,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are produced. @@ -5023,7 +5014,7 @@ private constructor( * by setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -6644,7 +6635,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -6672,9 +6663,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if this @@ -6698,7 +6688,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -6717,9 +6707,8 @@ private constructor( conversionRate(conversionRate as Double?) /** The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** The per unit conversion rate of the price currency to the invoicing currency. */ fun conversionRate(conversionRate: JsonField) = apply { @@ -6732,7 +6721,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -6757,9 +6746,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -6775,7 +6763,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -6796,7 +6784,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are produced. @@ -6818,7 +6806,7 @@ private constructor( * by setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -8458,7 +8446,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -8486,9 +8474,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if this @@ -8512,7 +8499,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -8531,9 +8518,8 @@ private constructor( conversionRate(conversionRate as Double?) /** The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** The per unit conversion rate of the price currency to the invoicing currency. */ fun conversionRate(conversionRate: JsonField) = apply { @@ -8546,7 +8532,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -8571,9 +8557,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -8589,7 +8574,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -8610,7 +8595,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are produced. @@ -8632,7 +8617,7 @@ private constructor( * by setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -9136,11 +9121,7 @@ private constructor( /** * Exclusive tier ending value. If null, this is treated as the last tier */ - @Suppress( - "USELESS_CAST" - ) // See https://youtrack.jetbrains.com/issue/KT-74228 - fun lastUnit(lastUnit: Optional) = - lastUnit(lastUnit.orElse(null) as Double?) + fun lastUnit(lastUnit: Optional) = lastUnit(lastUnit.getOrNull()) /** * Exclusive tier ending value. If null, this is treated as the last tier @@ -10184,7 +10165,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -10212,9 +10193,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if this @@ -10238,7 +10218,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -10257,9 +10237,8 @@ private constructor( conversionRate(conversionRate as Double?) /** The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** The per unit conversion rate of the price currency to the invoicing currency. */ fun conversionRate(conversionRate: JsonField) = apply { @@ -10272,7 +10251,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -10297,9 +10276,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -10315,7 +10293,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -10336,7 +10314,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are produced. @@ -10358,7 +10336,7 @@ private constructor( * by setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -10882,7 +10860,7 @@ private constructor( /** Exclusive tier ending value */ fun maximumAmount(maximumAmount: Optional) = - maximumAmount(maximumAmount.orElse(null)) + maximumAmount(maximumAmount.getOrNull()) /** Exclusive tier ending value */ fun maximumAmount(maximumAmount: JsonField) = apply { @@ -10895,7 +10873,7 @@ private constructor( /** Per unit maximum to charge */ fun perUnitMaximum(perUnitMaximum: Optional) = - perUnitMaximum(perUnitMaximum.orElse(null)) + perUnitMaximum(perUnitMaximum.getOrNull()) /** Per unit maximum to charge */ fun perUnitMaximum(perUnitMaximum: JsonField) = apply { @@ -11933,7 +11911,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -11961,9 +11939,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if this @@ -11987,7 +11964,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -12006,9 +11983,8 @@ private constructor( conversionRate(conversionRate as Double?) /** The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** The per unit conversion rate of the price currency to the invoicing currency. */ fun conversionRate(conversionRate: JsonField) = apply { @@ -12021,7 +11997,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -12046,9 +12022,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -12064,7 +12039,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -12085,7 +12060,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are produced. @@ -12107,7 +12082,7 @@ private constructor( * by setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -12245,7 +12220,7 @@ private constructor( /** Optional currency amount maximum to cap spend per event */ fun perUnitMaximum(perUnitMaximum: Optional) = - perUnitMaximum(perUnitMaximum.orElse(null)) + perUnitMaximum(perUnitMaximum.getOrNull()) /** Optional currency amount maximum to cap spend per event */ fun perUnitMaximum(perUnitMaximum: JsonField) = apply { @@ -13494,7 +13469,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -13522,9 +13497,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if this @@ -13548,7 +13522,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -13567,9 +13541,8 @@ private constructor( conversionRate(conversionRate as Double?) /** The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** The per unit conversion rate of the price currency to the invoicing currency. */ fun conversionRate(conversionRate: JsonField) = apply { @@ -13582,7 +13555,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -13607,9 +13580,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -13625,7 +13597,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -13646,7 +13618,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are produced. @@ -13668,7 +13640,7 @@ private constructor( * by setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -13941,7 +13913,7 @@ private constructor( /** Upper bound for tier */ fun maximumAmount(maximumAmount: Optional) = - maximumAmount(maximumAmount.orElse(null)) + maximumAmount(maximumAmount.getOrNull()) /** Upper bound for tier */ fun maximumAmount(maximumAmount: JsonField) = apply { @@ -13954,7 +13926,7 @@ private constructor( /** The maximum amount to charge for any one event */ fun perUnitMaximum(perUnitMaximum: Optional) = - perUnitMaximum(perUnitMaximum.orElse(null)) + perUnitMaximum(perUnitMaximum.getOrNull()) /** The maximum amount to charge for any one event */ fun perUnitMaximum(perUnitMaximum: JsonField) = apply { @@ -15218,7 +15190,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -15246,9 +15218,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if this @@ -15272,7 +15243,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -15291,9 +15262,8 @@ private constructor( conversionRate(conversionRate as Double?) /** The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** The per unit conversion rate of the price currency to the invoicing currency. */ fun conversionRate(conversionRate: JsonField) = apply { @@ -15306,7 +15276,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -15331,9 +15301,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -15349,7 +15318,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -15370,7 +15339,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are produced. @@ -15392,7 +15361,7 @@ private constructor( * by setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -15642,11 +15611,8 @@ private constructor( maximumUnits(maximumUnits as Double?) /** Upper bound for this tier */ - @Suppress( - "USELESS_CAST" - ) // See https://youtrack.jetbrains.com/issue/KT-74228 fun maximumUnits(maximumUnits: Optional) = - maximumUnits(maximumUnits.orElse(null) as Double?) + maximumUnits(maximumUnits.getOrNull()) /** Upper bound for this tier */ fun maximumUnits(maximumUnits: JsonField) = apply { @@ -16922,7 +16888,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -16950,9 +16916,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if this @@ -16976,7 +16941,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -16995,9 +16960,8 @@ private constructor( conversionRate(conversionRate as Double?) /** The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** The per unit conversion rate of the price currency to the invoicing currency. */ fun conversionRate(conversionRate: JsonField) = apply { @@ -17010,7 +16974,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -17035,9 +16999,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -17053,7 +17016,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -17074,7 +17037,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are produced. @@ -17096,7 +17059,7 @@ private constructor( * by setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -18435,7 +18398,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -18463,9 +18426,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if this @@ -18489,7 +18451,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -18508,9 +18470,8 @@ private constructor( conversionRate(conversionRate as Double?) /** The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** The per unit conversion rate of the price currency to the invoicing currency. */ fun conversionRate(conversionRate: JsonField) = apply { @@ -18523,7 +18484,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -18548,9 +18509,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -18566,7 +18526,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -18587,7 +18547,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are produced. @@ -18609,7 +18569,7 @@ private constructor( * by setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -19947,7 +19907,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -19975,9 +19935,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if this @@ -20001,7 +19960,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -20020,9 +19979,8 @@ private constructor( conversionRate(conversionRate as Double?) /** The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** The per unit conversion rate of the price currency to the invoicing currency. */ fun conversionRate(conversionRate: JsonField) = apply { @@ -20035,7 +19993,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -20060,9 +20018,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -20078,7 +20035,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -20099,7 +20056,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are produced. @@ -20121,7 +20078,7 @@ private constructor( * by setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -21464,7 +21421,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -21492,9 +21449,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if this @@ -21518,7 +21474,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -21537,9 +21493,8 @@ private constructor( conversionRate(conversionRate as Double?) /** The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** The per unit conversion rate of the price currency to the invoicing currency. */ fun conversionRate(conversionRate: JsonField) = apply { @@ -21552,7 +21507,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -21577,9 +21532,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -21595,7 +21549,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -21616,7 +21570,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are produced. @@ -21638,7 +21592,7 @@ private constructor( * by setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -22980,7 +22934,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -23008,9 +22962,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if this @@ -23034,7 +22987,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -23053,9 +23006,8 @@ private constructor( conversionRate(conversionRate as Double?) /** The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** The per unit conversion rate of the price currency to the invoicing currency. */ fun conversionRate(conversionRate: JsonField) = apply { @@ -23068,7 +23020,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -23093,9 +23045,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -23111,7 +23062,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -23132,7 +23083,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are produced. @@ -23154,7 +23105,7 @@ private constructor( * by setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -24497,7 +24448,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -24525,9 +24476,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if this @@ -24551,7 +24501,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -24570,9 +24520,8 @@ private constructor( conversionRate(conversionRate as Double?) /** The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** The per unit conversion rate of the price currency to the invoicing currency. */ fun conversionRate(conversionRate: JsonField) = apply { @@ -24585,7 +24534,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -24610,9 +24559,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -24628,7 +24576,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -24649,7 +24597,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are produced. @@ -24671,7 +24619,7 @@ private constructor( * by setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -26017,7 +25965,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -26045,9 +25993,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if this @@ -26071,7 +26018,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -26090,9 +26037,8 @@ private constructor( conversionRate(conversionRate as Double?) /** The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** The per unit conversion rate of the price currency to the invoicing currency. */ fun conversionRate(conversionRate: JsonField) = apply { @@ -26105,7 +26051,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -26130,9 +26076,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -26148,7 +26093,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -26169,7 +26114,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are produced. @@ -26191,7 +26136,7 @@ private constructor( * by setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -27535,7 +27480,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -27563,9 +27508,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if this @@ -27589,7 +27533,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -27608,9 +27552,8 @@ private constructor( conversionRate(conversionRate as Double?) /** The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** The per unit conversion rate of the price currency to the invoicing currency. */ fun conversionRate(conversionRate: JsonField) = apply { @@ -27623,7 +27566,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -27648,9 +27591,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -27666,7 +27608,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -27687,7 +27629,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are produced. @@ -27709,7 +27651,7 @@ private constructor( * by setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -29051,7 +28993,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -29079,9 +29021,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if this @@ -29105,7 +29046,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -29124,9 +29065,8 @@ private constructor( conversionRate(conversionRate as Double?) /** The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** The per unit conversion rate of the price currency to the invoicing currency. */ fun conversionRate(conversionRate: JsonField) = apply { @@ -29139,7 +29079,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -29164,9 +29104,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -29182,7 +29121,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -29203,7 +29142,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are produced. @@ -29225,7 +29164,7 @@ private constructor( * by setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -30567,7 +30506,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -30595,9 +30534,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if this @@ -30621,7 +30559,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -30640,9 +30578,8 @@ private constructor( conversionRate(conversionRate as Double?) /** The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** The per unit conversion rate of the price currency to the invoicing currency. */ fun conversionRate(conversionRate: JsonField) = apply { @@ -30655,7 +30592,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -30680,9 +30617,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -30698,7 +30634,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -30719,7 +30655,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are produced. @@ -30741,7 +30677,7 @@ private constructor( * by setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -32082,7 +32018,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -32110,9 +32046,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if this @@ -32136,7 +32071,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -32155,9 +32090,8 @@ private constructor( conversionRate(conversionRate as Double?) /** The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** The per unit conversion rate of the price currency to the invoicing currency. */ fun conversionRate(conversionRate: JsonField) = apply { @@ -32170,7 +32104,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -32195,9 +32129,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -32213,7 +32146,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -32234,7 +32167,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are produced. @@ -32256,7 +32189,7 @@ private constructor( * by setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -33607,7 +33540,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -33635,9 +33568,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if this @@ -33661,7 +33593,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -33680,9 +33612,8 @@ private constructor( conversionRate(conversionRate as Double?) /** The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** The per unit conversion rate of the price currency to the invoicing currency. */ fun conversionRate(conversionRate: JsonField) = apply { @@ -33695,7 +33626,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -33720,9 +33651,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -33738,7 +33668,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -33759,7 +33689,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are produced. @@ -33781,7 +33711,7 @@ private constructor( * by setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -35136,7 +35066,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -35164,9 +35094,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if this @@ -35190,7 +35119,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -35209,9 +35138,8 @@ private constructor( conversionRate(conversionRate as Double?) /** The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** The per unit conversion rate of the price currency to the invoicing currency. */ fun conversionRate(conversionRate: JsonField) = apply { @@ -35224,7 +35152,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -35249,9 +35177,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -35267,7 +35194,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -35288,7 +35215,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are produced. @@ -35310,7 +35237,7 @@ private constructor( * by setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -36658,7 +36585,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -36686,9 +36613,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if this @@ -36712,7 +36638,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -36731,9 +36657,8 @@ private constructor( conversionRate(conversionRate as Double?) /** The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** The per unit conversion rate of the price currency to the invoicing currency. */ fun conversionRate(conversionRate: JsonField) = apply { @@ -36746,7 +36671,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -36771,9 +36696,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -36789,7 +36713,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -36810,7 +36734,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are produced. @@ -36832,7 +36756,7 @@ private constructor( * by setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -38174,7 +38098,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -38202,9 +38126,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if this @@ -38228,7 +38151,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -38247,9 +38170,8 @@ private constructor( conversionRate(conversionRate as Double?) /** The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** The per unit conversion rate of the price currency to the invoicing currency. */ fun conversionRate(conversionRate: JsonField) = apply { @@ -38262,7 +38184,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -38287,9 +38209,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -38305,7 +38226,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -38326,7 +38247,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are produced. @@ -38348,7 +38269,7 @@ private constructor( * by setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -39691,7 +39612,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -39719,9 +39640,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if this @@ -39745,7 +39665,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -39764,9 +39684,8 @@ private constructor( conversionRate(conversionRate as Double?) /** The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** The per unit conversion rate of the price currency to the invoicing currency. */ fun conversionRate(conversionRate: JsonField) = apply { @@ -39779,7 +39698,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -39804,9 +39723,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -39822,7 +39740,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -39843,7 +39761,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are produced. @@ -39865,7 +39783,7 @@ private constructor( * by setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -41225,7 +41143,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -41253,9 +41171,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if this @@ -41279,7 +41196,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -41298,9 +41215,8 @@ private constructor( conversionRate(conversionRate as Double?) /** The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** The per unit conversion rate of the price currency to the invoicing currency. */ fun conversionRate(conversionRate: JsonField) = apply { @@ -41313,7 +41229,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -41338,9 +41254,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -41356,7 +41271,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -41377,7 +41292,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are produced. @@ -41399,7 +41314,7 @@ private constructor( * by setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -42768,7 +42683,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -42796,9 +42711,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if this @@ -42822,7 +42736,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -42841,9 +42755,8 @@ private constructor( conversionRate(conversionRate as Double?) /** The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** The per unit conversion rate of the price currency to the invoicing currency. */ fun conversionRate(conversionRate: JsonField) = apply { @@ -42856,7 +42769,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -42881,9 +42794,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -42899,7 +42811,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -42920,7 +42832,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are produced. @@ -42942,7 +42854,7 @@ private constructor( * by setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed @@ -44295,7 +44207,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -44323,9 +44235,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if this @@ -44349,7 +44260,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -44368,9 +44279,8 @@ private constructor( conversionRate(conversionRate as Double?) /** The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** The per unit conversion rate of the price currency to the invoicing currency. */ fun conversionRate(conversionRate: JsonField) = apply { @@ -44383,7 +44293,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -44408,9 +44318,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -44426,7 +44335,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -44447,7 +44356,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are produced. @@ -44469,7 +44378,7 @@ private constructor( * by setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceEvaluateParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceEvaluateParams.kt index 01f137e5..fb22605d 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceEvaluateParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceEvaluateParams.kt @@ -21,6 +21,7 @@ import com.withorb.api.core.toImmutable import java.time.OffsetDateTime import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull /** * This endpoint is used to evaluate the output of a price for a given customer and time range. It @@ -287,7 +288,7 @@ private constructor( fun customerId(customerId: String?) = customerId(JsonField.ofNullable(customerId)) /** The ID of the customer to which this evaluation is scoped. */ - fun customerId(customerId: Optional) = customerId(customerId.orElse(null)) + fun customerId(customerId: Optional) = customerId(customerId.getOrNull()) /** The ID of the customer to which this evaluation is scoped. */ fun customerId(customerId: JsonField) = apply { this.customerId = customerId } @@ -298,7 +299,7 @@ private constructor( /** The external customer ID of the customer to which this evaluation is scoped. */ fun externalCustomerId(externalCustomerId: Optional) = - externalCustomerId(externalCustomerId.orElse(null)) + externalCustomerId(externalCustomerId.getOrNull()) /** The external customer ID of the customer to which this evaluation is scoped. */ fun externalCustomerId(externalCustomerId: JsonField) = apply { @@ -315,7 +316,7 @@ private constructor( * A boolean [computed property](/extensibility/advanced-metrics#computed-properties) * used to filter the underlying billable metric */ - fun filter(filter: Optional) = filter(filter.orElse(null)) + fun filter(filter: Optional) = filter(filter.getOrNull()) /** * A boolean [computed property](/extensibility/advanced-metrics#computed-properties) @@ -458,7 +459,7 @@ private constructor( fun customerId(customerId: String?) = apply { body.customerId(customerId) } /** The ID of the customer to which this evaluation is scoped. */ - fun customerId(customerId: Optional) = customerId(customerId.orElse(null)) + fun customerId(customerId: Optional) = customerId(customerId.getOrNull()) /** The ID of the customer to which this evaluation is scoped. */ fun customerId(customerId: JsonField) = apply { body.customerId(customerId) } @@ -470,7 +471,7 @@ private constructor( /** The external customer ID of the customer to which this evaluation is scoped. */ fun externalCustomerId(externalCustomerId: Optional) = - externalCustomerId(externalCustomerId.orElse(null)) + externalCustomerId(externalCustomerId.getOrNull()) /** The external customer ID of the customer to which this evaluation is scoped. */ fun externalCustomerId(externalCustomerId: JsonField) = apply { @@ -487,7 +488,7 @@ private constructor( * A boolean [computed property](/extensibility/advanced-metrics#computed-properties) used * to filter the underlying billable metric */ - fun filter(filter: Optional) = filter(filter.orElse(null)) + fun filter(filter: Optional) = filter(filter.getOrNull()) /** * A boolean [computed property](/extensibility/advanced-metrics#computed-properties) used diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceExternalPriceIdUpdateParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceExternalPriceIdUpdateParams.kt index b38b4a30..ac272de9 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceExternalPriceIdUpdateParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceExternalPriceIdUpdateParams.kt @@ -19,6 +19,7 @@ import com.withorb.api.core.immutableEmptyMap import com.withorb.api.core.toImmutable import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull /** * This endpoint allows you to update the `metadata` property on a price. If you pass null for the @@ -139,7 +140,7 @@ private constructor( * setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed by @@ -239,7 +240,7 @@ private constructor( * setting the value to `null`, and the entire metadata mapping can be cleared by setting * `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed by diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceListPage.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceListPage.kt index 03897dd9..be7bdc85 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceListPage.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceListPage.kt @@ -18,6 +18,7 @@ import java.util.Objects import java.util.Optional import java.util.stream.Stream import java.util.stream.StreamSupport +import kotlin.jvm.optionals.getOrNull /** * This endpoint is used to list all add-on prices created using the @@ -184,7 +185,7 @@ private constructor( while (index < page.data().size) { yield(page.data()[index++]) } - page = page.getNextPage().orElse(null) ?: break + page = page.getNextPage().getOrNull() ?: break index = 0 } } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceListParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceListParams.kt index c1a75a09..f562defd 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceListParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceListParams.kt @@ -8,6 +8,7 @@ import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull /** * This endpoint is used to list all add-on prices created using the @@ -81,7 +82,7 @@ private constructor( * Cursor for pagination. This can be populated by the `next_cursor` value returned from the * initial request. */ - fun cursor(cursor: Optional) = cursor(cursor.orElse(null)) + fun cursor(cursor: Optional) = cursor(cursor.getOrNull()) /** The number of items to fetch. Defaults to 20. */ fun limit(limit: Long?) = apply { this.limit = limit } @@ -90,8 +91,7 @@ private constructor( fun limit(limit: Long) = limit(limit as Long?) /** The number of items to fetch. Defaults to 20. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun limit(limit: Optional) = limit(limit.orElse(null) as Long?) + fun limit(limit: Optional) = limit(limit.getOrNull()) fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceUpdateParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceUpdateParams.kt index 9676e8a0..99f1bb7a 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceUpdateParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceUpdateParams.kt @@ -19,6 +19,7 @@ import com.withorb.api.core.immutableEmptyMap import com.withorb.api.core.toImmutable import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull /** * This endpoint allows you to update the `metadata` property on a price. If you pass null for the @@ -139,7 +140,7 @@ private constructor( * setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed by @@ -234,7 +235,7 @@ private constructor( * setting the value to `null`, and the entire metadata mapping can be cleared by setting * `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed by diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/Subscription.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/Subscription.kt index a0c8c1bc..d1401058 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/Subscription.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/Subscription.kt @@ -572,9 +572,8 @@ private constructor( activePlanPhaseOrder(activePlanPhaseOrder as Long?) /** The current plan phase that is active, only if the subscription's plan has phases. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun activePlanPhaseOrder(activePlanPhaseOrder: Optional) = - activePlanPhaseOrder(activePlanPhaseOrder.orElse(null) as Long?) + activePlanPhaseOrder(activePlanPhaseOrder.getOrNull()) /** The current plan phase that is active, only if the subscription's plan has phases. */ fun activePlanPhaseOrder(activePlanPhaseOrder: JsonField) = apply { @@ -627,9 +626,8 @@ private constructor( * with the saved payment method on the due date. This property defaults to the plan's * behavior. If null, defaults to the customer's setting. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun autoCollection(autoCollection: Optional) = - autoCollection(autoCollection.orElse(null) as Boolean?) + autoCollection(autoCollection.getOrNull()) /** * Determines whether issued invoices for this subscription will automatically be charged @@ -684,7 +682,7 @@ private constructor( * are not currently active. */ fun currentBillingPeriodEndDate(currentBillingPeriodEndDate: Optional) = - currentBillingPeriodEndDate(currentBillingPeriodEndDate.orElse(null)) + currentBillingPeriodEndDate(currentBillingPeriodEndDate.getOrNull()) /** * The end of the current billing period. This is an exclusive timestamp, such that the @@ -710,7 +708,7 @@ private constructor( * is not currently active. */ fun currentBillingPeriodStartDate(currentBillingPeriodStartDate: Optional) = - currentBillingPeriodStartDate(currentBillingPeriodStartDate.orElse(null)) + currentBillingPeriodStartDate(currentBillingPeriodStartDate.getOrNull()) /** * The start date of the current billing period. This is an inclusive timestamp; the instant @@ -773,7 +771,7 @@ private constructor( * provided, it is determined by the plan configuration. */ fun defaultInvoiceMemo(defaultInvoiceMemo: Optional) = - defaultInvoiceMemo(defaultInvoiceMemo.orElse(null)) + defaultInvoiceMemo(defaultInvoiceMemo.getOrNull()) /** * Determines the default memo on this subscriptions' invoices. Note that if this is not @@ -816,7 +814,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The date Orb stops billing for this subscription. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The date Orb stops billing for this subscription. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -842,7 +840,7 @@ private constructor( invoicingThreshold(JsonField.ofNullable(invoicingThreshold)) fun invoicingThreshold(invoicingThreshold: Optional) = - invoicingThreshold(invoicingThreshold.orElse(null)) + invoicingThreshold(invoicingThreshold.getOrNull()) fun invoicingThreshold(invoicingThreshold: JsonField) = apply { this.invoicingThreshold = invoicingThreshold @@ -945,7 +943,7 @@ private constructor( redeemedCoupon(JsonField.ofNullable(redeemedCoupon)) fun redeemedCoupon(redeemedCoupon: Optional) = - redeemedCoupon(redeemedCoupon.orElse(null)) + redeemedCoupon(redeemedCoupon.getOrNull()) fun redeemedCoupon(redeemedCoupon: JsonField) = apply { this.redeemedCoupon = redeemedCoupon @@ -1182,7 +1180,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The end date of the adjustment interval. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The end date of the adjustment interval. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -1731,9 +1729,8 @@ private constructor( planPhaseOrder(planPhaseOrder as Long?) /** The plan phase in which this adjustment is active. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) /** The plan phase in which this adjustment is active. */ fun planPhaseOrder(planPhaseOrder: JsonField) = apply { @@ -1744,7 +1741,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -2152,9 +2149,8 @@ private constructor( planPhaseOrder(planPhaseOrder as Long?) /** The plan phase in which this adjustment is active. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) /** The plan phase in which this adjustment is active. */ fun planPhaseOrder(planPhaseOrder: JsonField) = apply { @@ -2165,7 +2161,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -2561,9 +2557,8 @@ private constructor( planPhaseOrder(planPhaseOrder as Long?) /** The plan phase in which this adjustment is active. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) /** The plan phase in which this adjustment is active. */ fun planPhaseOrder(planPhaseOrder: JsonField) = apply { @@ -2574,7 +2569,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -2985,9 +2980,8 @@ private constructor( planPhaseOrder(planPhaseOrder as Long?) /** The plan phase in which this adjustment is active. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) /** The plan phase in which this adjustment is active. */ fun planPhaseOrder(planPhaseOrder: JsonField) = apply { @@ -2998,7 +2992,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -3391,9 +3385,8 @@ private constructor( planPhaseOrder(planPhaseOrder as Long?) /** The plan phase in which this adjustment is active. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) /** The plan phase in which this adjustment is active. */ fun planPhaseOrder(planPhaseOrder: JsonField) = apply { @@ -3404,7 +3397,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -3721,8 +3714,7 @@ private constructor( * The month on which the billing cycle is anchored (e.g. a quarterly price anchored in * February would have cycles starting February, May, August, and November). */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun month(month: Optional) = month(month.orElse(null) as Long?) + fun month(month: Optional) = month(month.getOrNull()) /** * The month on which the billing cycle is anchored (e.g. a quarterly price anchored in @@ -3746,8 +3738,7 @@ private constructor( * The year on which the billing cycle is anchored (e.g. a 2 year billing cycle anchored * on 2021 would have cycles starting on 2021, 2023, 2025, etc.). */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun year(year: Optional) = year(year.orElse(null) as Long?) + fun year(year: Optional) = year(year.getOrNull()) /** * The year on which the billing cycle is anchored (e.g. a 2 year billing cycle anchored @@ -4176,7 +4167,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The end date of the discount interval. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The end date of the discount interval. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -4536,7 +4527,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The end date of the discount interval. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The end date of the discount interval. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -4912,7 +4903,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The end date of the discount interval. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The end date of the discount interval. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -5194,7 +5185,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -5430,7 +5421,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The end date of the maximum interval. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The end date of the maximum interval. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -5762,7 +5753,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The end date of the minimum interval. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The end date of the minimum interval. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -6135,7 +6126,7 @@ private constructor( * interval is not currently active. */ fun currentBillingPeriodEndDate(currentBillingPeriodEndDate: Optional) = - currentBillingPeriodEndDate(currentBillingPeriodEndDate.orElse(null)) + currentBillingPeriodEndDate(currentBillingPeriodEndDate.getOrNull()) /** * The end of the current billing period. This is an exclusive timestamp, such that the @@ -6161,7 +6152,7 @@ private constructor( */ fun currentBillingPeriodStartDate( currentBillingPeriodStartDate: Optional - ) = currentBillingPeriodStartDate(currentBillingPeriodStartDate.orElse(null)) + ) = currentBillingPeriodStartDate(currentBillingPeriodStartDate.getOrNull()) /** * The start date of the current billing period. This is an inclusive timestamp; the @@ -6182,7 +6173,7 @@ private constructor( * The end date of the price interval. This is the date that Orb stops billing for this * price. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** * The end date of the price interval. This is the date that Orb stops billing for this @@ -6194,7 +6185,7 @@ private constructor( fun filter(filter: String?) = filter(JsonField.ofNullable(filter)) /** An additional filter to apply to usage queries. */ - fun filter(filter: Optional) = filter(filter.orElse(null)) + fun filter(filter: Optional) = filter(filter.getOrNull()) /** An additional filter to apply to usage queries. */ fun filter(filter: JsonField) = apply { this.filter = filter } @@ -6213,7 +6204,7 @@ private constructor( */ fun fixedFeeQuantityTransitions( fixedFeeQuantityTransitions: Optional> - ) = fixedFeeQuantityTransitions(fixedFeeQuantityTransitions.orElse(null)) + ) = fixedFeeQuantityTransitions(fixedFeeQuantityTransitions.getOrNull()) /** * The fixed fee quantity transitions for this price interval. This is only relevant for @@ -6706,7 +6697,7 @@ private constructor( * price interval. */ fun usageCustomerIds(usageCustomerIds: Optional>) = - usageCustomerIds(usageCustomerIds.orElse(null)) + usageCustomerIds(usageCustomerIds.getOrNull()) /** * A list of customer IDs whose usage events will be aggregated and billed under this @@ -7019,7 +7010,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -7240,7 +7231,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) fun endDate(endDate: JsonField) = apply { this.endDate = endDate } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionCancelParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionCancelParams.kt index 005344a3..965e1202 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionCancelParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionCancelParams.kt @@ -22,6 +22,7 @@ import com.withorb.api.errors.OrbInvalidDataException import java.time.OffsetDateTime import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull /** * This endpoint can be used to cancel an existing subscription. It returns the serialized @@ -271,9 +272,8 @@ private constructor( * credit note. Consider using this as a safety mechanism if you do not expect existing * invoices to be changed. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun allowInvoiceCreditOrVoid(allowInvoiceCreditOrVoid: Optional) = - allowInvoiceCreditOrVoid(allowInvoiceCreditOrVoid.orElse(null) as Boolean?) + allowInvoiceCreditOrVoid(allowInvoiceCreditOrVoid.getOrNull()) /** * If false, this request will fail if it would void an issued invoice or create a @@ -296,7 +296,7 @@ private constructor( * if the `cancel_option` is `requested_date`. */ fun cancellationDate(cancellationDate: Optional) = - cancellationDate(cancellationDate.orElse(null)) + cancellationDate(cancellationDate.getOrNull()) /** * The date that the cancellation should take effect. This parameter can only be passed @@ -417,9 +417,8 @@ private constructor( * note. Consider using this as a safety mechanism if you do not expect existing invoices to * be changed. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun allowInvoiceCreditOrVoid(allowInvoiceCreditOrVoid: Optional) = - allowInvoiceCreditOrVoid(allowInvoiceCreditOrVoid.orElse(null) as Boolean?) + allowInvoiceCreditOrVoid(allowInvoiceCreditOrVoid.getOrNull()) /** * If false, this request will fail if it would void an issued invoice or create a credit @@ -443,7 +442,7 @@ private constructor( * the `cancel_option` is `requested_date`. */ fun cancellationDate(cancellationDate: Optional) = - cancellationDate(cancellationDate.orElse(null)) + cancellationDate(cancellationDate.getOrNull()) /** * The date that the cancellation should take effect. This parameter can only be passed if diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionCancelResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionCancelResponse.kt index c18285f2..1f20cb23 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionCancelResponse.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionCancelResponse.kt @@ -560,9 +560,8 @@ private constructor( activePlanPhaseOrder(activePlanPhaseOrder as Long?) /** The current plan phase that is active, only if the subscription's plan has phases. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun activePlanPhaseOrder(activePlanPhaseOrder: Optional) = - activePlanPhaseOrder(activePlanPhaseOrder.orElse(null) as Long?) + activePlanPhaseOrder(activePlanPhaseOrder.getOrNull()) /** The current plan phase that is active, only if the subscription's plan has phases. */ fun activePlanPhaseOrder(activePlanPhaseOrder: JsonField) = apply { @@ -615,9 +614,8 @@ private constructor( * with the saved payment method on the due date. This property defaults to the plan's * behavior. If null, defaults to the customer's setting. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun autoCollection(autoCollection: Optional) = - autoCollection(autoCollection.orElse(null) as Boolean?) + autoCollection(autoCollection.getOrNull()) /** * Determines whether issued invoices for this subscription will automatically be charged @@ -672,7 +670,7 @@ private constructor( * are not currently active. */ fun currentBillingPeriodEndDate(currentBillingPeriodEndDate: Optional) = - currentBillingPeriodEndDate(currentBillingPeriodEndDate.orElse(null)) + currentBillingPeriodEndDate(currentBillingPeriodEndDate.getOrNull()) /** * The end of the current billing period. This is an exclusive timestamp, such that the @@ -698,7 +696,7 @@ private constructor( * is not currently active. */ fun currentBillingPeriodStartDate(currentBillingPeriodStartDate: Optional) = - currentBillingPeriodStartDate(currentBillingPeriodStartDate.orElse(null)) + currentBillingPeriodStartDate(currentBillingPeriodStartDate.getOrNull()) /** * The start date of the current billing period. This is an inclusive timestamp; the instant @@ -761,7 +759,7 @@ private constructor( * provided, it is determined by the plan configuration. */ fun defaultInvoiceMemo(defaultInvoiceMemo: Optional) = - defaultInvoiceMemo(defaultInvoiceMemo.orElse(null)) + defaultInvoiceMemo(defaultInvoiceMemo.getOrNull()) /** * Determines the default memo on this subscriptions' invoices. Note that if this is not @@ -804,7 +802,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The date Orb stops billing for this subscription. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The date Orb stops billing for this subscription. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -830,7 +828,7 @@ private constructor( invoicingThreshold(JsonField.ofNullable(invoicingThreshold)) fun invoicingThreshold(invoicingThreshold: Optional) = - invoicingThreshold(invoicingThreshold.orElse(null)) + invoicingThreshold(invoicingThreshold.getOrNull()) fun invoicingThreshold(invoicingThreshold: JsonField) = apply { this.invoicingThreshold = invoicingThreshold @@ -933,7 +931,7 @@ private constructor( redeemedCoupon(JsonField.ofNullable(redeemedCoupon)) fun redeemedCoupon(redeemedCoupon: Optional) = - redeemedCoupon(redeemedCoupon.orElse(null)) + redeemedCoupon(redeemedCoupon.getOrNull()) fun redeemedCoupon(redeemedCoupon: JsonField) = apply { this.redeemedCoupon = redeemedCoupon @@ -1170,7 +1168,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The end date of the adjustment interval. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The end date of the adjustment interval. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -1719,9 +1717,8 @@ private constructor( planPhaseOrder(planPhaseOrder as Long?) /** The plan phase in which this adjustment is active. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) /** The plan phase in which this adjustment is active. */ fun planPhaseOrder(planPhaseOrder: JsonField) = apply { @@ -1732,7 +1729,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -2140,9 +2137,8 @@ private constructor( planPhaseOrder(planPhaseOrder as Long?) /** The plan phase in which this adjustment is active. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) /** The plan phase in which this adjustment is active. */ fun planPhaseOrder(planPhaseOrder: JsonField) = apply { @@ -2153,7 +2149,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -2549,9 +2545,8 @@ private constructor( planPhaseOrder(planPhaseOrder as Long?) /** The plan phase in which this adjustment is active. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) /** The plan phase in which this adjustment is active. */ fun planPhaseOrder(planPhaseOrder: JsonField) = apply { @@ -2562,7 +2557,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -2973,9 +2968,8 @@ private constructor( planPhaseOrder(planPhaseOrder as Long?) /** The plan phase in which this adjustment is active. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) /** The plan phase in which this adjustment is active. */ fun planPhaseOrder(planPhaseOrder: JsonField) = apply { @@ -2986,7 +2980,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -3379,9 +3373,8 @@ private constructor( planPhaseOrder(planPhaseOrder as Long?) /** The plan phase in which this adjustment is active. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) /** The plan phase in which this adjustment is active. */ fun planPhaseOrder(planPhaseOrder: JsonField) = apply { @@ -3392,7 +3385,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -3709,8 +3702,7 @@ private constructor( * The month on which the billing cycle is anchored (e.g. a quarterly price anchored in * February would have cycles starting February, May, August, and November). */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun month(month: Optional) = month(month.orElse(null) as Long?) + fun month(month: Optional) = month(month.getOrNull()) /** * The month on which the billing cycle is anchored (e.g. a quarterly price anchored in @@ -3734,8 +3726,7 @@ private constructor( * The year on which the billing cycle is anchored (e.g. a 2 year billing cycle anchored * on 2021 would have cycles starting on 2021, 2023, 2025, etc.). */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun year(year: Optional) = year(year.orElse(null) as Long?) + fun year(year: Optional) = year(year.getOrNull()) /** * The year on which the billing cycle is anchored (e.g. a 2 year billing cycle anchored @@ -4164,7 +4155,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The end date of the discount interval. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The end date of the discount interval. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -4524,7 +4515,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The end date of the discount interval. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The end date of the discount interval. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -4900,7 +4891,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The end date of the discount interval. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The end date of the discount interval. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -5182,7 +5173,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -5418,7 +5409,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The end date of the maximum interval. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The end date of the maximum interval. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -5750,7 +5741,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The end date of the minimum interval. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The end date of the minimum interval. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -6123,7 +6114,7 @@ private constructor( * interval is not currently active. */ fun currentBillingPeriodEndDate(currentBillingPeriodEndDate: Optional) = - currentBillingPeriodEndDate(currentBillingPeriodEndDate.orElse(null)) + currentBillingPeriodEndDate(currentBillingPeriodEndDate.getOrNull()) /** * The end of the current billing period. This is an exclusive timestamp, such that the @@ -6149,7 +6140,7 @@ private constructor( */ fun currentBillingPeriodStartDate( currentBillingPeriodStartDate: Optional - ) = currentBillingPeriodStartDate(currentBillingPeriodStartDate.orElse(null)) + ) = currentBillingPeriodStartDate(currentBillingPeriodStartDate.getOrNull()) /** * The start date of the current billing period. This is an inclusive timestamp; the @@ -6170,7 +6161,7 @@ private constructor( * The end date of the price interval. This is the date that Orb stops billing for this * price. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** * The end date of the price interval. This is the date that Orb stops billing for this @@ -6182,7 +6173,7 @@ private constructor( fun filter(filter: String?) = filter(JsonField.ofNullable(filter)) /** An additional filter to apply to usage queries. */ - fun filter(filter: Optional) = filter(filter.orElse(null)) + fun filter(filter: Optional) = filter(filter.getOrNull()) /** An additional filter to apply to usage queries. */ fun filter(filter: JsonField) = apply { this.filter = filter } @@ -6201,7 +6192,7 @@ private constructor( */ fun fixedFeeQuantityTransitions( fixedFeeQuantityTransitions: Optional> - ) = fixedFeeQuantityTransitions(fixedFeeQuantityTransitions.orElse(null)) + ) = fixedFeeQuantityTransitions(fixedFeeQuantityTransitions.getOrNull()) /** * The fixed fee quantity transitions for this price interval. This is only relevant for @@ -6694,7 +6685,7 @@ private constructor( * price interval. */ fun usageCustomerIds(usageCustomerIds: Optional>) = - usageCustomerIds(usageCustomerIds.orElse(null)) + usageCustomerIds(usageCustomerIds.getOrNull()) /** * A list of customer IDs whose usage events will be aggregated and billed under this @@ -7007,7 +6998,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -7228,7 +7219,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) fun endDate(endDate: JsonField) = apply { this.endDate = endDate } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionCreateParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionCreateParams.kt index 4c5fe282..45a5c6bf 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionCreateParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionCreateParams.kt @@ -1223,7 +1223,7 @@ private constructor( * that have migrated off of legacy subscription overrides) */ fun addAdjustments(addAdjustments: Optional>) = - addAdjustments(addAdjustments.orElse(null)) + addAdjustments(addAdjustments.getOrNull()) /** * Additional adjustments to be added to the subscription. (Only available for accounts @@ -1254,7 +1254,7 @@ private constructor( * Additional prices to be added to the subscription. (Only available for accounts that * have migrated off of legacy subscription overrides) */ - fun addPrices(addPrices: Optional>) = addPrices(addPrices.orElse(null)) + fun addPrices(addPrices: Optional>) = addPrices(addPrices.getOrNull()) /** * Additional prices to be added to the subscription. (Only available for accounts that @@ -1308,9 +1308,8 @@ private constructor( * charged with the saved payment method on the due date. If not specified, this * defaults to the behavior configured for this customer. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun autoCollection(autoCollection: Optional) = - autoCollection(autoCollection.orElse(null) as Boolean?) + autoCollection(autoCollection.getOrNull()) /** * Determines whether issued invoices for this subscription will automatically be @@ -1325,7 +1324,7 @@ private constructor( fun awsRegion(awsRegion: String?) = awsRegion(JsonField.ofNullable(awsRegion)) @Deprecated("deprecated") - fun awsRegion(awsRegion: Optional) = awsRegion(awsRegion.orElse(null)) + fun awsRegion(awsRegion: Optional) = awsRegion(awsRegion.getOrNull()) @Deprecated("deprecated") fun awsRegion(awsRegion: JsonField) = apply { this.awsRegion = awsRegion } @@ -1339,7 +1338,7 @@ private constructor( fun billingCycleAnchorConfiguration( billingCycleAnchorConfiguration: Optional - ) = billingCycleAnchorConfiguration(billingCycleAnchorConfiguration.orElse(null)) + ) = billingCycleAnchorConfiguration(billingCycleAnchorConfiguration.getOrNull()) fun billingCycleAnchorConfiguration( billingCycleAnchorConfiguration: JsonField @@ -1359,7 +1358,7 @@ private constructor( * the subscription creation or plan change will not be scheduled. */ fun couponRedemptionCode(couponRedemptionCode: Optional) = - couponRedemptionCode(couponRedemptionCode.orElse(null)) + couponRedemptionCode(couponRedemptionCode.getOrNull()) /** * Redemption code to be used for this subscription. If the coupon cannot be found by @@ -1379,9 +1378,8 @@ private constructor( creditsOverageRate(creditsOverageRate as Double?) @Deprecated("deprecated") - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun creditsOverageRate(creditsOverageRate: Optional) = - creditsOverageRate(creditsOverageRate.orElse(null) as Double?) + creditsOverageRate(creditsOverageRate.getOrNull()) @Deprecated("deprecated") fun creditsOverageRate(creditsOverageRate: JsonField) = apply { @@ -1390,7 +1388,7 @@ private constructor( fun customerId(customerId: String?) = customerId(JsonField.ofNullable(customerId)) - fun customerId(customerId: Optional) = customerId(customerId.orElse(null)) + fun customerId(customerId: Optional) = customerId(customerId.getOrNull()) fun customerId(customerId: JsonField) = apply { this.customerId = customerId } @@ -1406,7 +1404,7 @@ private constructor( * provided, it is determined by the plan configuration. */ fun defaultInvoiceMemo(defaultInvoiceMemo: Optional) = - defaultInvoiceMemo(defaultInvoiceMemo.orElse(null)) + defaultInvoiceMemo(defaultInvoiceMemo.getOrNull()) /** * Determines the default memo on this subscription's invoices. Note that if this is not @@ -1418,7 +1416,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -1426,7 +1424,7 @@ private constructor( externalCustomerId(JsonField.ofNullable(externalCustomerId)) fun externalCustomerId(externalCustomerId: Optional) = - externalCustomerId(externalCustomerId.orElse(null)) + externalCustomerId(externalCustomerId.getOrNull()) fun externalCustomerId(externalCustomerId: JsonField) = apply { this.externalCustomerId = externalCustomerId @@ -1438,7 +1436,7 @@ private constructor( @Deprecated("deprecated") fun externalMarketplace(externalMarketplace: Optional) = - externalMarketplace(externalMarketplace.orElse(null)) + externalMarketplace(externalMarketplace.getOrNull()) @Deprecated("deprecated") fun externalMarketplace(externalMarketplace: JsonField) = apply { @@ -1451,7 +1449,7 @@ private constructor( @Deprecated("deprecated") fun externalMarketplaceReportingId(externalMarketplaceReportingId: Optional) = - externalMarketplaceReportingId(externalMarketplaceReportingId.orElse(null)) + externalMarketplaceReportingId(externalMarketplaceReportingId.getOrNull()) @Deprecated("deprecated") fun externalMarketplaceReportingId(externalMarketplaceReportingId: JsonField) = @@ -1471,7 +1469,7 @@ private constructor( * Note that either this property or `plan_id` must be specified. */ fun externalPlanId(externalPlanId: Optional) = - externalPlanId(externalPlanId.orElse(null)) + externalPlanId(externalPlanId.getOrNull()) /** * The external_plan_id of the plan that the given subscription should be switched to. @@ -1493,7 +1491,7 @@ private constructor( * boolean [computed property](/extensibility/advanced-metrics#computed-properties). If * null, usage queries will not include any additional filter. */ - fun filter(filter: Optional) = filter(filter.orElse(null)) + fun filter(filter: Optional) = filter(filter.getOrNull()) /** * An additional filter to apply to usage queries. This filter must be expressed as a @@ -1511,9 +1509,8 @@ private constructor( initialPhaseOrder(initialPhaseOrder as Long?) /** The phase of the plan to start with */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun initialPhaseOrder(initialPhaseOrder: Optional) = - initialPhaseOrder(initialPhaseOrder.orElse(null) as Long?) + initialPhaseOrder(initialPhaseOrder.getOrNull()) /** The phase of the plan to start with */ fun initialPhaseOrder(initialPhaseOrder: JsonField) = apply { @@ -1534,7 +1531,7 @@ private constructor( * end of the billing period. */ fun invoicingThreshold(invoicingThreshold: Optional) = - invoicingThreshold(invoicingThreshold.orElse(null)) + invoicingThreshold(invoicingThreshold.getOrNull()) /** * When this subscription's accrued usage reaches this threshold, an invoice will be @@ -1557,7 +1554,7 @@ private constructor( * setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed by @@ -1585,8 +1582,7 @@ private constructor( * for the invoice. If you intend the invoice to be due on issue, set this to 0. If not * provided, this defaults to the value specified in the plan. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun netTerms(netTerms: Optional) = netTerms(netTerms.orElse(null) as Long?) + fun netTerms(netTerms: Optional) = netTerms(netTerms.getOrNull()) /** * The net terms determines the difference between the invoice date and the issue date @@ -1604,9 +1600,8 @@ private constructor( perCreditOverageAmount(perCreditOverageAmount as Double?) @Deprecated("deprecated") - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun perCreditOverageAmount(perCreditOverageAmount: Optional) = - perCreditOverageAmount(perCreditOverageAmount.orElse(null) as Double?) + perCreditOverageAmount(perCreditOverageAmount.getOrNull()) @Deprecated("deprecated") fun perCreditOverageAmount(perCreditOverageAmount: JsonField) = apply { @@ -1623,7 +1618,7 @@ private constructor( * The plan that the given subscription should be switched to. Note that either this * property or `external_plan_id` must be specified. */ - fun planId(planId: Optional) = planId(planId.orElse(null)) + fun planId(planId: Optional) = planId(planId.getOrNull()) /** * The plan that the given subscription should be switched to. Note that either this @@ -1649,9 +1644,8 @@ private constructor( * Specifies which version of the plan to subscribe to. If null, the default version * will be used. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planVersionNumber(planVersionNumber: Optional) = - planVersionNumber(planVersionNumber.orElse(null) as Long?) + planVersionNumber(planVersionNumber.getOrNull()) /** * Specifies which version of the plan to subscribe to. If null, the default version @@ -1669,7 +1663,7 @@ private constructor( /** Optionally provide a list of overrides for prices on the plan */ @Deprecated("deprecated") fun priceOverrides(priceOverrides: Optional>) = - priceOverrides(priceOverrides.orElse(null)) + priceOverrides(priceOverrides.getOrNull()) /** Optionally provide a list of overrides for prices on the plan */ @Deprecated("deprecated") @@ -1698,7 +1692,7 @@ private constructor( * that have migrated off of legacy subscription overrides) */ fun removeAdjustments(removeAdjustments: Optional>) = - removeAdjustments(removeAdjustments.orElse(null)) + removeAdjustments(removeAdjustments.getOrNull()) /** * Plan adjustments to be removed from the subscription. (Only available for accounts @@ -1731,7 +1725,7 @@ private constructor( * have migrated off of legacy subscription overrides) */ fun removePrices(removePrices: Optional>) = - removePrices(removePrices.orElse(null)) + removePrices(removePrices.getOrNull()) /** * Plan prices to be removed from the subscription. (Only available for accounts that @@ -1764,7 +1758,7 @@ private constructor( * (Only available for accounts that have migrated off of legacy subscription overrides) */ fun replaceAdjustments(replaceAdjustments: Optional>) = - replaceAdjustments(replaceAdjustments.orElse(null)) + replaceAdjustments(replaceAdjustments.getOrNull()) /** * Plan adjustments to be replaced with additional adjustments on the subscription. @@ -1797,7 +1791,7 @@ private constructor( * available for accounts that have migrated off of legacy subscription overrides) */ fun replacePrices(replacePrices: Optional>) = - replacePrices(replacePrices.orElse(null)) + replacePrices(replacePrices.getOrNull()) /** * Plan prices to be replaced with additional prices on the subscription. (Only @@ -1820,7 +1814,7 @@ private constructor( fun startDate(startDate: OffsetDateTime?) = startDate(JsonField.ofNullable(startDate)) - fun startDate(startDate: Optional) = startDate(startDate.orElse(null)) + fun startDate(startDate: Optional) = startDate(startDate.getOrNull()) fun startDate(startDate: JsonField) = apply { this.startDate = startDate @@ -1844,9 +1838,8 @@ private constructor( * The duration of the trial period in days. If not provided, this defaults to the value * specified in the plan. If `0` is provided, the trial on the plan will be skipped. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun trialDurationDays(trialDurationDays: Optional) = - trialDurationDays(trialDurationDays.orElse(null) as Long?) + trialDurationDays(trialDurationDays.getOrNull()) /** * The duration of the trial period in days. If not provided, this defaults to the value @@ -1876,7 +1869,7 @@ private constructor( * of that customer's children. */ fun usageCustomerIds(usageCustomerIds: Optional>) = - usageCustomerIds(usageCustomerIds.orElse(null)) + usageCustomerIds(usageCustomerIds.getOrNull()) /** * A list of customer IDs whose usage events will be aggregated and billed under this @@ -2015,7 +2008,7 @@ private constructor( * have migrated off of legacy subscription overrides) */ fun addAdjustments(addAdjustments: Optional>) = - addAdjustments(addAdjustments.orElse(null)) + addAdjustments(addAdjustments.getOrNull()) /** * Additional adjustments to be added to the subscription. (Only available for accounts that @@ -2043,7 +2036,7 @@ private constructor( * Additional prices to be added to the subscription. (Only available for accounts that have * migrated off of legacy subscription overrides) */ - fun addPrices(addPrices: Optional>) = addPrices(addPrices.orElse(null)) + fun addPrices(addPrices: Optional>) = addPrices(addPrices.getOrNull()) /** * Additional prices to be added to the subscription. (Only available for accounts that have @@ -2087,9 +2080,8 @@ private constructor( * with the saved payment method on the due date. If not specified, this defaults to the * behavior configured for this customer. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun autoCollection(autoCollection: Optional) = - autoCollection(autoCollection.orElse(null) as Boolean?) + autoCollection(autoCollection.getOrNull()) /** * Determines whether issued invoices for this subscription will automatically be charged @@ -2104,7 +2096,7 @@ private constructor( fun awsRegion(awsRegion: String?) = apply { body.awsRegion(awsRegion) } @Deprecated("deprecated") - fun awsRegion(awsRegion: Optional) = awsRegion(awsRegion.orElse(null)) + fun awsRegion(awsRegion: Optional) = awsRegion(awsRegion.getOrNull()) @Deprecated("deprecated") fun awsRegion(awsRegion: JsonField) = apply { body.awsRegion(awsRegion) } @@ -2115,7 +2107,7 @@ private constructor( fun billingCycleAnchorConfiguration( billingCycleAnchorConfiguration: Optional - ) = billingCycleAnchorConfiguration(billingCycleAnchorConfiguration.orElse(null)) + ) = billingCycleAnchorConfiguration(billingCycleAnchorConfiguration.getOrNull()) fun billingCycleAnchorConfiguration( billingCycleAnchorConfiguration: JsonField @@ -2136,7 +2128,7 @@ private constructor( * subscription creation or plan change will not be scheduled. */ fun couponRedemptionCode(couponRedemptionCode: Optional) = - couponRedemptionCode(couponRedemptionCode.orElse(null)) + couponRedemptionCode(couponRedemptionCode.getOrNull()) /** * Redemption code to be used for this subscription. If the coupon cannot be found by its @@ -2157,9 +2149,8 @@ private constructor( creditsOverageRate(creditsOverageRate as Double?) @Deprecated("deprecated") - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun creditsOverageRate(creditsOverageRate: Optional) = - creditsOverageRate(creditsOverageRate.orElse(null) as Double?) + creditsOverageRate(creditsOverageRate.getOrNull()) @Deprecated("deprecated") fun creditsOverageRate(creditsOverageRate: JsonField) = apply { @@ -2168,7 +2159,7 @@ private constructor( fun customerId(customerId: String?) = apply { body.customerId(customerId) } - fun customerId(customerId: Optional) = customerId(customerId.orElse(null)) + fun customerId(customerId: Optional) = customerId(customerId.getOrNull()) fun customerId(customerId: JsonField) = apply { body.customerId(customerId) } @@ -2185,7 +2176,7 @@ private constructor( * provided, it is determined by the plan configuration. */ fun defaultInvoiceMemo(defaultInvoiceMemo: Optional) = - defaultInvoiceMemo(defaultInvoiceMemo.orElse(null)) + defaultInvoiceMemo(defaultInvoiceMemo.getOrNull()) /** * Determines the default memo on this subscription's invoices. Note that if this is not @@ -2197,7 +2188,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = apply { body.endDate(endDate) } - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) fun endDate(endDate: JsonField) = apply { body.endDate(endDate) } @@ -2206,7 +2197,7 @@ private constructor( } fun externalCustomerId(externalCustomerId: Optional) = - externalCustomerId(externalCustomerId.orElse(null)) + externalCustomerId(externalCustomerId.getOrNull()) fun externalCustomerId(externalCustomerId: JsonField) = apply { body.externalCustomerId(externalCustomerId) @@ -2219,7 +2210,7 @@ private constructor( @Deprecated("deprecated") fun externalMarketplace(externalMarketplace: Optional) = - externalMarketplace(externalMarketplace.orElse(null)) + externalMarketplace(externalMarketplace.getOrNull()) @Deprecated("deprecated") fun externalMarketplace(externalMarketplace: JsonField) = apply { @@ -2233,7 +2224,7 @@ private constructor( @Deprecated("deprecated") fun externalMarketplaceReportingId(externalMarketplaceReportingId: Optional) = - externalMarketplaceReportingId(externalMarketplaceReportingId.orElse(null)) + externalMarketplaceReportingId(externalMarketplaceReportingId.getOrNull()) @Deprecated("deprecated") fun externalMarketplaceReportingId(externalMarketplaceReportingId: JsonField) = @@ -2252,7 +2243,7 @@ private constructor( * that either this property or `plan_id` must be specified. */ fun externalPlanId(externalPlanId: Optional) = - externalPlanId(externalPlanId.orElse(null)) + externalPlanId(externalPlanId.getOrNull()) /** * The external_plan_id of the plan that the given subscription should be switched to. Note @@ -2274,7 +2265,7 @@ private constructor( * boolean [computed property](/extensibility/advanced-metrics#computed-properties). If * null, usage queries will not include any additional filter. */ - fun filter(filter: Optional) = filter(filter.orElse(null)) + fun filter(filter: Optional) = filter(filter.getOrNull()) /** * An additional filter to apply to usage queries. This filter must be expressed as a @@ -2293,9 +2284,8 @@ private constructor( initialPhaseOrder(initialPhaseOrder as Long?) /** The phase of the plan to start with */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun initialPhaseOrder(initialPhaseOrder: Optional) = - initialPhaseOrder(initialPhaseOrder.orElse(null) as Long?) + initialPhaseOrder(initialPhaseOrder.getOrNull()) /** The phase of the plan to start with */ fun initialPhaseOrder(initialPhaseOrder: JsonField) = apply { @@ -2317,7 +2307,7 @@ private constructor( * billing period. */ fun invoicingThreshold(invoicingThreshold: Optional) = - invoicingThreshold(invoicingThreshold.orElse(null)) + invoicingThreshold(invoicingThreshold.getOrNull()) /** * When this subscription's accrued usage reaches this threshold, an invoice will be issued @@ -2340,7 +2330,7 @@ private constructor( * setting the value to `null`, and the entire metadata mapping can be cleared by setting * `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed by @@ -2368,8 +2358,7 @@ private constructor( * the invoice. If you intend the invoice to be due on issue, set this to 0. If not * provided, this defaults to the value specified in the plan. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun netTerms(netTerms: Optional) = netTerms(netTerms.orElse(null) as Long?) + fun netTerms(netTerms: Optional) = netTerms(netTerms.getOrNull()) /** * The net terms determines the difference between the invoice date and the issue date for @@ -2388,9 +2377,8 @@ private constructor( perCreditOverageAmount(perCreditOverageAmount as Double?) @Deprecated("deprecated") - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun perCreditOverageAmount(perCreditOverageAmount: Optional) = - perCreditOverageAmount(perCreditOverageAmount.orElse(null) as Double?) + perCreditOverageAmount(perCreditOverageAmount.getOrNull()) @Deprecated("deprecated") fun perCreditOverageAmount(perCreditOverageAmount: JsonField) = apply { @@ -2407,7 +2395,7 @@ private constructor( * The plan that the given subscription should be switched to. Note that either this * property or `external_plan_id` must be specified. */ - fun planId(planId: Optional) = planId(planId.orElse(null)) + fun planId(planId: Optional) = planId(planId.getOrNull()) /** * The plan that the given subscription should be switched to. Note that either this @@ -2434,9 +2422,8 @@ private constructor( * Specifies which version of the plan to subscribe to. If null, the default version will be * used. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planVersionNumber(planVersionNumber: Optional) = - planVersionNumber(planVersionNumber.orElse(null) as Long?) + planVersionNumber(planVersionNumber.getOrNull()) /** * Specifies which version of the plan to subscribe to. If null, the default version will be @@ -2455,7 +2442,7 @@ private constructor( /** Optionally provide a list of overrides for prices on the plan */ @Deprecated("deprecated") fun priceOverrides(priceOverrides: Optional>) = - priceOverrides(priceOverrides.orElse(null)) + priceOverrides(priceOverrides.getOrNull()) /** Optionally provide a list of overrides for prices on the plan */ @Deprecated("deprecated") @@ -2482,7 +2469,7 @@ private constructor( * have migrated off of legacy subscription overrides) */ fun removeAdjustments(removeAdjustments: Optional>) = - removeAdjustments(removeAdjustments.orElse(null)) + removeAdjustments(removeAdjustments.getOrNull()) /** * Plan adjustments to be removed from the subscription. (Only available for accounts that @@ -2513,7 +2500,7 @@ private constructor( * migrated off of legacy subscription overrides) */ fun removePrices(removePrices: Optional>) = - removePrices(removePrices.orElse(null)) + removePrices(removePrices.getOrNull()) /** * Plan prices to be removed from the subscription. (Only available for accounts that have @@ -2542,7 +2529,7 @@ private constructor( * available for accounts that have migrated off of legacy subscription overrides) */ fun replaceAdjustments(replaceAdjustments: Optional>) = - replaceAdjustments(replaceAdjustments.orElse(null)) + replaceAdjustments(replaceAdjustments.getOrNull()) /** * Plan adjustments to be replaced with additional adjustments on the subscription. (Only @@ -2573,7 +2560,7 @@ private constructor( * for accounts that have migrated off of legacy subscription overrides) */ fun replacePrices(replacePrices: Optional>) = - replacePrices(replacePrices.orElse(null)) + replacePrices(replacePrices.getOrNull()) /** * Plan prices to be replaced with additional prices on the subscription. (Only available @@ -2593,7 +2580,7 @@ private constructor( fun startDate(startDate: OffsetDateTime?) = apply { body.startDate(startDate) } - fun startDate(startDate: Optional) = startDate(startDate.orElse(null)) + fun startDate(startDate: Optional) = startDate(startDate.getOrNull()) fun startDate(startDate: JsonField) = apply { body.startDate(startDate) } @@ -2616,9 +2603,8 @@ private constructor( * The duration of the trial period in days. If not provided, this defaults to the value * specified in the plan. If `0` is provided, the trial on the plan will be skipped. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun trialDurationDays(trialDurationDays: Optional) = - trialDurationDays(trialDurationDays.orElse(null) as Long?) + trialDurationDays(trialDurationDays.getOrNull()) /** * The duration of the trial period in days. If not provided, this defaults to the value @@ -2647,7 +2633,7 @@ private constructor( * be either the customer for this subscription itself, or any of that customer's children. */ fun usageCustomerIds(usageCustomerIds: Optional>) = - usageCustomerIds(usageCustomerIds.orElse(null)) + usageCustomerIds(usageCustomerIds.getOrNull()) /** * A list of customer IDs whose usage events will be aggregated and billed under this @@ -2954,7 +2940,7 @@ private constructor( * The end date of the adjustment interval. This is the date that the adjustment will * stop affecting prices on the subscription. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** * The end date of the adjustment interval. This is the date that the adjustment will @@ -2970,9 +2956,8 @@ private constructor( fun planPhaseOrder(planPhaseOrder: Long) = planPhaseOrder(planPhaseOrder as Long?) /** The phase to add this adjustment to. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) /** The phase to add this adjustment to. */ fun planPhaseOrder(planPhaseOrder: JsonField) = apply { @@ -2991,7 +2976,7 @@ private constructor( * start affecting prices on the subscription. If null, the adjustment will start when * the phase or subscription starts. */ - fun startDate(startDate: Optional) = startDate(startDate.orElse(null)) + fun startDate(startDate: Optional) = startDate(startDate.getOrNull()) /** * The start date of the adjustment interval. This is the date that the adjustment will @@ -5090,7 +5075,7 @@ private constructor( /** The definition of a new allocation price to create and add to the subscription. */ fun allocationPrice(allocationPrice: Optional) = - allocationPrice(allocationPrice.orElse(null)) + allocationPrice(allocationPrice.getOrNull()) /** The definition of a new allocation price to create and add to the subscription. */ fun allocationPrice(allocationPrice: JsonField) = apply { @@ -5109,7 +5094,7 @@ private constructor( * price. */ @Deprecated("deprecated") - fun discounts(discounts: Optional>) = discounts(discounts.orElse(null)) + fun discounts(discounts: Optional>) = discounts(discounts.getOrNull()) /** * [DEPRECATED] Use add_adjustments instead. The subscription's discounts for this @@ -5142,7 +5127,7 @@ private constructor( * The end date of the price interval. This is the date that the price will stop billing * on the subscription. If null, billing will end when the phase or subscription ends. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** * The end date of the price interval. This is the date that the price will stop billing @@ -5156,7 +5141,7 @@ private constructor( /** The external price id of the price to add to the subscription. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** The external price id of the price to add to the subscription. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -5177,7 +5162,7 @@ private constructor( */ @Deprecated("deprecated") fun maximumAmount(maximumAmount: Optional) = - maximumAmount(maximumAmount.orElse(null)) + maximumAmount(maximumAmount.getOrNull()) /** * [DEPRECATED] Use add_adjustments instead. The subscription's maximum amount for this @@ -5202,7 +5187,7 @@ private constructor( */ @Deprecated("deprecated") fun minimumAmount(minimumAmount: Optional) = - minimumAmount(minimumAmount.orElse(null)) + minimumAmount(minimumAmount.getOrNull()) /** * [DEPRECATED] Use add_adjustments instead. The subscription's minimum amount for this @@ -5221,9 +5206,8 @@ private constructor( fun planPhaseOrder(planPhaseOrder: Long) = planPhaseOrder(planPhaseOrder as Long?) /** The phase to add this price to. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) /** The phase to add this price to. */ fun planPhaseOrder(planPhaseOrder: JsonField) = apply { @@ -5234,7 +5218,7 @@ private constructor( fun price(price: Price?) = price(JsonField.ofNullable(price)) /** The definition of a new price to create and add to the subscription. */ - fun price(price: Optional) = price(price.orElse(null)) + fun price(price: Optional) = price(price.getOrNull()) /** The definition of a new price to create and add to the subscription. */ fun price(price: JsonField) = apply { this.price = price } @@ -5412,7 +5396,7 @@ private constructor( fun priceId(priceId: String?) = priceId(JsonField.ofNullable(priceId)) /** The id of the price to add to the subscription. */ - fun priceId(priceId: Optional) = priceId(priceId.orElse(null)) + fun priceId(priceId: Optional) = priceId(priceId.getOrNull()) /** The id of the price to add to the subscription. */ fun priceId(priceId: JsonField) = apply { this.priceId = priceId } @@ -5429,7 +5413,7 @@ private constructor( * billing on the subscription. If null, billing will start when the phase or * subscription starts. */ - fun startDate(startDate: Optional) = startDate(startDate.orElse(null)) + fun startDate(startDate: Optional) = startDate(startDate.getOrNull()) /** * The start date of the price interval. This is the date that the price will start @@ -5938,7 +5922,7 @@ private constructor( /** Only available if discount_type is `amount`. */ fun amountDiscount(amountDiscount: Optional) = - amountDiscount(amountDiscount.orElse(null)) + amountDiscount(amountDiscount.getOrNull()) /** Only available if discount_type is `amount`. */ fun amountDiscount(amountDiscount: JsonField) = apply { @@ -5963,9 +5947,8 @@ private constructor( * Only available if discount_type is `percentage`. This is a number between 0 * and 1. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun percentageDiscount(percentageDiscount: Optional) = - percentageDiscount(percentageDiscount.orElse(null) as Double?) + percentageDiscount(percentageDiscount.getOrNull()) /** * Only available if discount_type is `percentage`. This is a number between 0 @@ -5992,9 +5975,8 @@ private constructor( * Only available if discount_type is `usage`. Number of usage units that this * discount is for */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun usageDiscount(usageDiscount: Optional) = - usageDiscount(usageDiscount.orElse(null) as Double?) + usageDiscount(usageDiscount.getOrNull()) /** * Only available if discount_type is `usage`. Number of usage units that this @@ -7840,7 +7822,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -7868,9 +7850,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -7894,7 +7875,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -7919,9 +7900,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -7940,7 +7920,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -7954,7 +7934,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -7979,9 +7959,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -7997,7 +7976,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -8021,7 +8000,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -8043,7 +8022,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -8064,7 +8043,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -9475,7 +9454,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -9503,9 +9482,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -9529,7 +9507,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -9554,9 +9532,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -9575,7 +9552,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -9589,7 +9566,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -9614,9 +9591,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -9632,7 +9608,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -9656,7 +9632,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -9678,7 +9654,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -9699,7 +9675,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -11148,7 +11124,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -11176,9 +11152,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -11202,7 +11177,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -11227,9 +11202,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -11248,7 +11222,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -11262,7 +11236,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -11287,9 +11261,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -11305,7 +11278,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -11329,7 +11302,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -11351,7 +11324,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -11372,7 +11345,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -13044,7 +13017,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -13072,9 +13045,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -13098,7 +13070,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -13123,9 +13095,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -13144,7 +13115,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -13158,7 +13129,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -13183,9 +13154,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -13201,7 +13171,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -13225,7 +13195,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -13247,7 +13217,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -13268,7 +13238,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -13798,11 +13768,8 @@ private constructor( * Exclusive tier ending value. If null, this is treated as the last * tier */ - @Suppress( - "USELESS_CAST" - ) // See https://youtrack.jetbrains.com/issue/KT-74228 fun lastUnit(lastUnit: Optional) = - lastUnit(lastUnit.orElse(null) as Double?) + lastUnit(lastUnit.getOrNull()) /** * Exclusive tier ending value. If null, this is treated as the last @@ -14889,7 +14856,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -14917,9 +14884,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -14943,7 +14909,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -14968,9 +14934,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -14989,7 +14954,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -15003,7 +14968,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -15028,9 +14993,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -15046,7 +15010,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -15070,7 +15034,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -15092,7 +15056,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -15113,7 +15077,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -15650,7 +15614,7 @@ private constructor( /** Exclusive tier ending value */ fun maximumAmount(maximumAmount: Optional) = - maximumAmount(maximumAmount.orElse(null)) + maximumAmount(maximumAmount.getOrNull()) /** Exclusive tier ending value */ fun maximumAmount(maximumAmount: JsonField) = apply { @@ -15663,7 +15627,7 @@ private constructor( /** Per unit maximum to charge */ fun perUnitMaximum(perUnitMaximum: Optional) = - perUnitMaximum(perUnitMaximum.orElse(null)) + perUnitMaximum(perUnitMaximum.getOrNull()) /** Per unit maximum to charge */ fun perUnitMaximum(perUnitMaximum: JsonField) = apply { @@ -16744,7 +16708,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -16772,9 +16736,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -16798,7 +16761,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -16823,9 +16786,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -16844,7 +16806,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -16858,7 +16820,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -16883,9 +16845,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -16901,7 +16862,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -16925,7 +16886,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -16947,7 +16908,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -16968,7 +16929,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -17109,7 +17070,7 @@ private constructor( /** Optional currency amount maximum to cap spend per event */ fun perUnitMaximum(perUnitMaximum: Optional) = - perUnitMaximum(perUnitMaximum.orElse(null)) + perUnitMaximum(perUnitMaximum.getOrNull()) /** Optional currency amount maximum to cap spend per event */ fun perUnitMaximum(perUnitMaximum: JsonField) = apply { @@ -18404,7 +18365,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -18432,9 +18393,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -18458,7 +18418,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -18483,9 +18443,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -18504,7 +18463,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -18518,7 +18477,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -18543,9 +18502,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -18561,7 +18519,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -18585,7 +18543,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -18607,7 +18565,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -18628,7 +18586,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -18908,7 +18866,7 @@ private constructor( /** Upper bound for tier */ fun maximumAmount(maximumAmount: Optional) = - maximumAmount(maximumAmount.orElse(null)) + maximumAmount(maximumAmount.getOrNull()) /** Upper bound for tier */ fun maximumAmount(maximumAmount: JsonField) = apply { @@ -18921,7 +18879,7 @@ private constructor( /** The maximum amount to charge for any one event */ fun perUnitMaximum(perUnitMaximum: Optional) = - perUnitMaximum(perUnitMaximum.orElse(null)) + perUnitMaximum(perUnitMaximum.getOrNull()) /** The maximum amount to charge for any one event */ fun perUnitMaximum(perUnitMaximum: JsonField) = apply { @@ -20233,7 +20191,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -20261,9 +20219,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -20287,7 +20244,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -20312,9 +20269,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -20333,7 +20289,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -20347,7 +20303,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -20372,9 +20328,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -20390,7 +20345,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -20414,7 +20369,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -20436,7 +20391,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -20457,7 +20412,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -20714,11 +20669,8 @@ private constructor( maximumUnits(maximumUnits as Double?) /** Upper bound for this tier */ - @Suppress( - "USELESS_CAST" - ) // See https://youtrack.jetbrains.com/issue/KT-74228 fun maximumUnits(maximumUnits: Optional) = - maximumUnits(maximumUnits.orElse(null) as Double?) + maximumUnits(maximumUnits.getOrNull()) /** Upper bound for this tier */ fun maximumUnits(maximumUnits: JsonField) = apply { @@ -22042,7 +21994,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -22070,9 +22022,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -22096,7 +22047,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -22121,9 +22072,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -22142,7 +22092,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -22156,7 +22106,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -22181,9 +22131,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -22199,7 +22148,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -22223,7 +22172,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -22245,7 +22194,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -22266,7 +22215,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -23653,7 +23602,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -23681,9 +23630,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -23707,7 +23655,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -23732,9 +23680,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -23753,7 +23700,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -23767,7 +23714,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -23792,9 +23739,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -23810,7 +23756,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -23834,7 +23780,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -23856,7 +23802,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -23877,7 +23823,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -25268,7 +25214,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -25296,9 +25242,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -25322,7 +25267,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -25347,9 +25292,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -25368,7 +25312,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -25382,7 +25326,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -25407,9 +25351,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -25425,7 +25368,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -25449,7 +25392,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -25471,7 +25414,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -25492,7 +25435,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -26881,7 +26824,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -26909,9 +26852,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -26935,7 +26877,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -26960,9 +26902,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -26981,7 +26922,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -26995,7 +26936,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -27020,9 +26961,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -27038,7 +26978,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -27062,7 +27002,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -27084,7 +27024,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -27105,7 +27045,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -28501,7 +28441,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -28529,9 +28469,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -28555,7 +28494,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -28580,9 +28519,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -28601,7 +28539,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -28615,7 +28553,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -28640,9 +28578,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -28658,7 +28595,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -28682,7 +28619,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -28704,7 +28641,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -28725,7 +28662,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -30123,7 +30060,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -30151,9 +30088,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -30177,7 +30113,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -30202,9 +30138,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -30223,7 +30158,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -30237,7 +30172,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -30262,9 +30197,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -30280,7 +30214,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -30304,7 +30238,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -30326,7 +30260,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -30347,7 +30281,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -31739,7 +31673,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -31767,9 +31701,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -31793,7 +31726,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -31818,9 +31751,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -31839,7 +31771,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -31853,7 +31785,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -31878,9 +31810,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -31896,7 +31827,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -31920,7 +31851,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -31942,7 +31873,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -31963,7 +31894,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -33355,7 +33286,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -33383,9 +33314,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -33409,7 +33339,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -33434,9 +33364,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -33455,7 +33384,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -33469,7 +33398,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -33494,9 +33423,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -33512,7 +33440,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -33536,7 +33464,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -33558,7 +33486,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -33579,7 +33507,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -34990,7 +34918,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -35018,9 +34946,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -35044,7 +34971,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -35069,9 +34996,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -35090,7 +35016,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -35104,7 +35030,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -35129,9 +35055,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -35147,7 +35072,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -35171,7 +35096,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -35193,7 +35118,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -35214,7 +35139,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -36611,7 +36536,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -36639,9 +36564,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -36665,7 +36589,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -36690,9 +36614,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -36711,7 +36634,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -36725,7 +36648,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -36750,9 +36673,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -36768,7 +36690,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -36792,7 +36714,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -36814,7 +36736,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -36835,7 +36757,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -38249,7 +38171,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -38277,9 +38199,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -38303,7 +38224,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -38328,9 +38249,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -38349,7 +38269,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -38363,7 +38283,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -38388,9 +38308,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -38406,7 +38325,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -38430,7 +38349,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -38452,7 +38371,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -38473,7 +38392,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -39897,7 +39816,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -39925,9 +39844,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -39951,7 +39869,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -39976,9 +39894,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -39997,7 +39914,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -40011,7 +39928,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -40036,9 +39953,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -40054,7 +39970,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -40078,7 +39994,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -40100,7 +40016,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -40121,7 +40037,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -41530,7 +41446,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -41558,9 +41474,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -41584,7 +41499,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -41609,9 +41524,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -41630,7 +41544,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -41644,7 +41558,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -41669,9 +41583,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -41687,7 +41600,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -41711,7 +41624,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -41733,7 +41646,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -41754,7 +41667,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -43155,7 +43068,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -43183,9 +43096,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -43209,7 +43121,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -43234,9 +43146,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -43255,7 +43166,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -43269,7 +43180,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -43294,9 +43205,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -43312,7 +43222,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -43336,7 +43246,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -43358,7 +43268,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -43379,7 +43289,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -44793,7 +44703,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -44821,9 +44731,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -44847,7 +44756,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -44872,9 +44781,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -44893,7 +44801,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -44907,7 +44815,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -44932,9 +44840,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -44950,7 +44857,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -44974,7 +44881,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -44996,7 +44903,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -45017,7 +44924,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -46419,7 +46326,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -46447,9 +46354,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -46473,7 +46379,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -46498,9 +46404,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -46519,7 +46424,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -46533,7 +46438,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -46558,9 +46463,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -46576,7 +46480,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -46600,7 +46504,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -46622,7 +46526,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -46643,7 +46547,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -48042,7 +47946,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -48070,9 +47974,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -48096,7 +47999,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -48121,9 +48024,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -48142,7 +48044,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -48156,7 +48058,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -48181,9 +48083,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -48199,7 +48100,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -48223,7 +48124,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -48245,7 +48146,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -48266,7 +48167,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -49418,8 +49319,7 @@ private constructor( * The month on which the billing cycle is anchored (e.g. a quarterly price anchored in * February would have cycles starting February, May, August, and November). */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun month(month: Optional) = month(month.orElse(null) as Long?) + fun month(month: Optional) = month(month.getOrNull()) /** * The month on which the billing cycle is anchored (e.g. a quarterly price anchored in @@ -49443,8 +49343,7 @@ private constructor( * The year on which the billing cycle is anchored (e.g. a 2 year billing cycle anchored * on 2021 would have cycles starting on 2021, 2023, 2025, etc.). */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun year(year: Optional) = year(year.orElse(null) as Long?) + fun year(year: Optional) = year(year.getOrNull()) /** * The year on which the billing cycle is anchored (e.g. a 2 year billing cycle anchored @@ -49877,7 +49776,7 @@ private constructor( /** The external price id of the price to remove on the subscription. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** The external price id of the price to remove on the subscription. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -49888,7 +49787,7 @@ private constructor( fun priceId(priceId: String?) = priceId(JsonField.ofNullable(priceId)) /** The id of the price to remove on the subscription. */ - fun priceId(priceId: Optional) = priceId(priceId.orElse(null)) + fun priceId(priceId: Optional) = priceId(priceId.getOrNull()) /** The id of the price to remove on the subscription. */ fun priceId(priceId: JsonField) = apply { this.priceId = priceId } @@ -52124,7 +52023,7 @@ private constructor( /** The definition of a new allocation price to create and add to the subscription. */ fun allocationPrice(allocationPrice: Optional) = - allocationPrice(allocationPrice.orElse(null)) + allocationPrice(allocationPrice.getOrNull()) /** The definition of a new allocation price to create and add to the subscription. */ fun allocationPrice(allocationPrice: JsonField) = apply { @@ -52143,7 +52042,7 @@ private constructor( * replacement price. */ @Deprecated("deprecated") - fun discounts(discounts: Optional>) = discounts(discounts.orElse(null)) + fun discounts(discounts: Optional>) = discounts(discounts.getOrNull()) /** * [DEPRECATED] Use add_adjustments instead. The subscription's discounts for the @@ -52172,7 +52071,7 @@ private constructor( /** The external price id of the price to add to the subscription. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** The external price id of the price to add to the subscription. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -52188,9 +52087,8 @@ private constructor( fixedPriceQuantity(fixedPriceQuantity as Double?) /** The new quantity of the price, if the price is a fixed price. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** The new quantity of the price, if the price is a fixed price. */ fun fixedPriceQuantity(fixedPriceQuantity: JsonField) = apply { @@ -52211,7 +52109,7 @@ private constructor( */ @Deprecated("deprecated") fun maximumAmount(maximumAmount: Optional) = - maximumAmount(maximumAmount.orElse(null)) + maximumAmount(maximumAmount.getOrNull()) /** * [DEPRECATED] Use add_adjustments instead. The subscription's maximum amount for the @@ -52236,7 +52134,7 @@ private constructor( */ @Deprecated("deprecated") fun minimumAmount(minimumAmount: Optional) = - minimumAmount(minimumAmount.orElse(null)) + minimumAmount(minimumAmount.getOrNull()) /** * [DEPRECATED] Use add_adjustments instead. The subscription's minimum amount for the @@ -52251,7 +52149,7 @@ private constructor( fun price(price: Price?) = price(JsonField.ofNullable(price)) /** The definition of a new price to create and add to the subscription. */ - fun price(price: Optional) = price(price.orElse(null)) + fun price(price: Optional) = price(price.getOrNull()) /** The definition of a new price to create and add to the subscription. */ fun price(price: JsonField) = apply { this.price = price } @@ -52429,7 +52327,7 @@ private constructor( fun priceId(priceId: String?) = priceId(JsonField.ofNullable(priceId)) /** The id of the price to add to the subscription. */ - fun priceId(priceId: Optional) = priceId(priceId.orElse(null)) + fun priceId(priceId: Optional) = priceId(priceId.getOrNull()) /** The id of the price to add to the subscription. */ fun priceId(priceId: JsonField) = apply { this.priceId = priceId } @@ -52931,7 +52829,7 @@ private constructor( /** Only available if discount_type is `amount`. */ fun amountDiscount(amountDiscount: Optional) = - amountDiscount(amountDiscount.orElse(null)) + amountDiscount(amountDiscount.getOrNull()) /** Only available if discount_type is `amount`. */ fun amountDiscount(amountDiscount: JsonField) = apply { @@ -52956,9 +52854,8 @@ private constructor( * Only available if discount_type is `percentage`. This is a number between 0 * and 1. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun percentageDiscount(percentageDiscount: Optional) = - percentageDiscount(percentageDiscount.orElse(null) as Double?) + percentageDiscount(percentageDiscount.getOrNull()) /** * Only available if discount_type is `percentage`. This is a number between 0 @@ -52985,9 +52882,8 @@ private constructor( * Only available if discount_type is `usage`. Number of usage units that this * discount is for */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun usageDiscount(usageDiscount: Optional) = - usageDiscount(usageDiscount.orElse(null) as Double?) + usageDiscount(usageDiscount.getOrNull()) /** * Only available if discount_type is `usage`. Number of usage units that this @@ -54833,7 +54729,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -54861,9 +54757,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -54887,7 +54782,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -54912,9 +54807,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -54933,7 +54827,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -54947,7 +54841,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -54972,9 +54866,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -54990,7 +54883,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -55014,7 +54907,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -55036,7 +54929,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -55057,7 +54950,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -56468,7 +56361,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -56496,9 +56389,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -56522,7 +56414,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -56547,9 +56439,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -56568,7 +56459,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -56582,7 +56473,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -56607,9 +56498,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -56625,7 +56515,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -56649,7 +56539,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -56671,7 +56561,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -56692,7 +56582,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -58141,7 +58031,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -58169,9 +58059,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -58195,7 +58084,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -58220,9 +58109,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -58241,7 +58129,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -58255,7 +58143,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -58280,9 +58168,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -58298,7 +58185,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -58322,7 +58209,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -58344,7 +58231,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -58365,7 +58252,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -60037,7 +59924,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -60065,9 +59952,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -60091,7 +59977,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -60116,9 +60002,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -60137,7 +60022,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -60151,7 +60036,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -60176,9 +60061,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -60194,7 +60078,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -60218,7 +60102,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -60240,7 +60124,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -60261,7 +60145,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -60791,11 +60675,8 @@ private constructor( * Exclusive tier ending value. If null, this is treated as the last * tier */ - @Suppress( - "USELESS_CAST" - ) // See https://youtrack.jetbrains.com/issue/KT-74228 fun lastUnit(lastUnit: Optional) = - lastUnit(lastUnit.orElse(null) as Double?) + lastUnit(lastUnit.getOrNull()) /** * Exclusive tier ending value. If null, this is treated as the last @@ -61882,7 +61763,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -61910,9 +61791,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -61936,7 +61816,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -61961,9 +61841,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -61982,7 +61861,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -61996,7 +61875,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -62021,9 +61900,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -62039,7 +61917,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -62063,7 +61941,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -62085,7 +61963,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -62106,7 +61984,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -62643,7 +62521,7 @@ private constructor( /** Exclusive tier ending value */ fun maximumAmount(maximumAmount: Optional) = - maximumAmount(maximumAmount.orElse(null)) + maximumAmount(maximumAmount.getOrNull()) /** Exclusive tier ending value */ fun maximumAmount(maximumAmount: JsonField) = apply { @@ -62656,7 +62534,7 @@ private constructor( /** Per unit maximum to charge */ fun perUnitMaximum(perUnitMaximum: Optional) = - perUnitMaximum(perUnitMaximum.orElse(null)) + perUnitMaximum(perUnitMaximum.getOrNull()) /** Per unit maximum to charge */ fun perUnitMaximum(perUnitMaximum: JsonField) = apply { @@ -63737,7 +63615,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -63765,9 +63643,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -63791,7 +63668,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -63816,9 +63693,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -63837,7 +63713,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -63851,7 +63727,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -63876,9 +63752,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -63894,7 +63769,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -63918,7 +63793,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -63940,7 +63815,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -63961,7 +63836,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -64102,7 +63977,7 @@ private constructor( /** Optional currency amount maximum to cap spend per event */ fun perUnitMaximum(perUnitMaximum: Optional) = - perUnitMaximum(perUnitMaximum.orElse(null)) + perUnitMaximum(perUnitMaximum.getOrNull()) /** Optional currency amount maximum to cap spend per event */ fun perUnitMaximum(perUnitMaximum: JsonField) = apply { @@ -65397,7 +65272,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -65425,9 +65300,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -65451,7 +65325,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -65476,9 +65350,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -65497,7 +65370,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -65511,7 +65384,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -65536,9 +65409,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -65554,7 +65426,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -65578,7 +65450,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -65600,7 +65472,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -65621,7 +65493,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -65901,7 +65773,7 @@ private constructor( /** Upper bound for tier */ fun maximumAmount(maximumAmount: Optional) = - maximumAmount(maximumAmount.orElse(null)) + maximumAmount(maximumAmount.getOrNull()) /** Upper bound for tier */ fun maximumAmount(maximumAmount: JsonField) = apply { @@ -65914,7 +65786,7 @@ private constructor( /** The maximum amount to charge for any one event */ fun perUnitMaximum(perUnitMaximum: Optional) = - perUnitMaximum(perUnitMaximum.orElse(null)) + perUnitMaximum(perUnitMaximum.getOrNull()) /** The maximum amount to charge for any one event */ fun perUnitMaximum(perUnitMaximum: JsonField) = apply { @@ -67226,7 +67098,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -67254,9 +67126,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -67280,7 +67151,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -67305,9 +67176,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -67326,7 +67196,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -67340,7 +67210,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -67365,9 +67235,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -67383,7 +67252,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -67407,7 +67276,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -67429,7 +67298,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -67450,7 +67319,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -67707,11 +67576,8 @@ private constructor( maximumUnits(maximumUnits as Double?) /** Upper bound for this tier */ - @Suppress( - "USELESS_CAST" - ) // See https://youtrack.jetbrains.com/issue/KT-74228 fun maximumUnits(maximumUnits: Optional) = - maximumUnits(maximumUnits.orElse(null) as Double?) + maximumUnits(maximumUnits.getOrNull()) /** Upper bound for this tier */ fun maximumUnits(maximumUnits: JsonField) = apply { @@ -69035,7 +68901,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -69063,9 +68929,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -69089,7 +68954,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -69114,9 +68979,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -69135,7 +68999,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -69149,7 +69013,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -69174,9 +69038,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -69192,7 +69055,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -69216,7 +69079,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -69238,7 +69101,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -69259,7 +69122,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -70646,7 +70509,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -70674,9 +70537,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -70700,7 +70562,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -70725,9 +70587,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -70746,7 +70607,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -70760,7 +70621,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -70785,9 +70646,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -70803,7 +70663,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -70827,7 +70687,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -70849,7 +70709,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -70870,7 +70730,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -72261,7 +72121,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -72289,9 +72149,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -72315,7 +72174,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -72340,9 +72199,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -72361,7 +72219,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -72375,7 +72233,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -72400,9 +72258,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -72418,7 +72275,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -72442,7 +72299,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -72464,7 +72321,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -72485,7 +72342,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -73874,7 +73731,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -73902,9 +73759,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -73928,7 +73784,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -73953,9 +73809,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -73974,7 +73829,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -73988,7 +73843,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -74013,9 +73868,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -74031,7 +73885,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -74055,7 +73909,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -74077,7 +73931,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -74098,7 +73952,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -75494,7 +75348,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -75522,9 +75376,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -75548,7 +75401,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -75573,9 +75426,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -75594,7 +75446,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -75608,7 +75460,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -75633,9 +75485,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -75651,7 +75502,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -75675,7 +75526,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -75697,7 +75548,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -75718,7 +75569,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -77116,7 +76967,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -77144,9 +76995,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -77170,7 +77020,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -77195,9 +77045,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -77216,7 +77065,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -77230,7 +77079,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -77255,9 +77104,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -77273,7 +77121,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -77297,7 +77145,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -77319,7 +77167,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -77340,7 +77188,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -78732,7 +78580,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -78760,9 +78608,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -78786,7 +78633,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -78811,9 +78658,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -78832,7 +78678,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -78846,7 +78692,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -78871,9 +78717,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -78889,7 +78734,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -78913,7 +78758,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -78935,7 +78780,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -78956,7 +78801,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -80348,7 +80193,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -80376,9 +80221,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -80402,7 +80246,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -80427,9 +80271,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -80448,7 +80291,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -80462,7 +80305,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -80487,9 +80330,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -80505,7 +80347,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -80529,7 +80371,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -80551,7 +80393,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -80572,7 +80414,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -81983,7 +81825,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -82011,9 +81853,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -82037,7 +81878,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -82062,9 +81903,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -82083,7 +81923,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -82097,7 +81937,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -82122,9 +81962,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -82140,7 +81979,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -82164,7 +82003,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -82186,7 +82025,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -82207,7 +82046,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -83604,7 +83443,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -83632,9 +83471,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -83658,7 +83496,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -83683,9 +83521,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -83704,7 +83541,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -83718,7 +83555,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -83743,9 +83580,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -83761,7 +83597,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -83785,7 +83621,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -83807,7 +83643,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -83828,7 +83664,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -85242,7 +85078,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -85270,9 +85106,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -85296,7 +85131,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -85321,9 +85156,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -85342,7 +85176,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -85356,7 +85190,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -85381,9 +85215,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -85399,7 +85232,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -85423,7 +85256,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -85445,7 +85278,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -85466,7 +85299,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -86890,7 +86723,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -86918,9 +86751,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -86944,7 +86776,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -86969,9 +86801,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -86990,7 +86821,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -87004,7 +86835,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -87029,9 +86860,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -87047,7 +86877,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -87071,7 +86901,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -87093,7 +86923,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -87114,7 +86944,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -88523,7 +88353,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -88551,9 +88381,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -88577,7 +88406,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -88602,9 +88431,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -88623,7 +88451,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -88637,7 +88465,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -88662,9 +88490,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -88680,7 +88507,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -88704,7 +88531,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -88726,7 +88553,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -88747,7 +88574,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -90148,7 +89975,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -90176,9 +90003,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -90202,7 +90028,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -90227,9 +90053,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -90248,7 +90073,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -90262,7 +90087,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -90287,9 +90112,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -90305,7 +90129,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -90329,7 +90153,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -90351,7 +90175,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -90372,7 +90196,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -91786,7 +91610,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -91814,9 +91638,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -91840,7 +91663,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -91865,9 +91688,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -91886,7 +91708,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -91900,7 +91722,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -91925,9 +91747,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -91943,7 +91764,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -91967,7 +91788,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -91989,7 +91810,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -92010,7 +91831,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -93412,7 +93233,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -93440,9 +93261,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -93466,7 +93286,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -93491,9 +93311,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -93512,7 +93331,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -93526,7 +93345,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -93551,9 +93370,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -93569,7 +93387,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -93593,7 +93411,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -93615,7 +93433,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -93636,7 +93454,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -95035,7 +94853,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -95063,9 +94881,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -95089,7 +94906,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -95114,9 +94931,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -95135,7 +94951,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -95149,7 +94965,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -95174,9 +94990,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -95192,7 +95007,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -95216,7 +95031,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -95238,7 +95053,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -95259,7 +95074,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionCreateResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionCreateResponse.kt index 367e0f62..1cf8ae49 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionCreateResponse.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionCreateResponse.kt @@ -560,9 +560,8 @@ private constructor( activePlanPhaseOrder(activePlanPhaseOrder as Long?) /** The current plan phase that is active, only if the subscription's plan has phases. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun activePlanPhaseOrder(activePlanPhaseOrder: Optional) = - activePlanPhaseOrder(activePlanPhaseOrder.orElse(null) as Long?) + activePlanPhaseOrder(activePlanPhaseOrder.getOrNull()) /** The current plan phase that is active, only if the subscription's plan has phases. */ fun activePlanPhaseOrder(activePlanPhaseOrder: JsonField) = apply { @@ -615,9 +614,8 @@ private constructor( * with the saved payment method on the due date. This property defaults to the plan's * behavior. If null, defaults to the customer's setting. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun autoCollection(autoCollection: Optional) = - autoCollection(autoCollection.orElse(null) as Boolean?) + autoCollection(autoCollection.getOrNull()) /** * Determines whether issued invoices for this subscription will automatically be charged @@ -672,7 +670,7 @@ private constructor( * are not currently active. */ fun currentBillingPeriodEndDate(currentBillingPeriodEndDate: Optional) = - currentBillingPeriodEndDate(currentBillingPeriodEndDate.orElse(null)) + currentBillingPeriodEndDate(currentBillingPeriodEndDate.getOrNull()) /** * The end of the current billing period. This is an exclusive timestamp, such that the @@ -698,7 +696,7 @@ private constructor( * is not currently active. */ fun currentBillingPeriodStartDate(currentBillingPeriodStartDate: Optional) = - currentBillingPeriodStartDate(currentBillingPeriodStartDate.orElse(null)) + currentBillingPeriodStartDate(currentBillingPeriodStartDate.getOrNull()) /** * The start date of the current billing period. This is an inclusive timestamp; the instant @@ -761,7 +759,7 @@ private constructor( * provided, it is determined by the plan configuration. */ fun defaultInvoiceMemo(defaultInvoiceMemo: Optional) = - defaultInvoiceMemo(defaultInvoiceMemo.orElse(null)) + defaultInvoiceMemo(defaultInvoiceMemo.getOrNull()) /** * Determines the default memo on this subscriptions' invoices. Note that if this is not @@ -804,7 +802,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The date Orb stops billing for this subscription. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The date Orb stops billing for this subscription. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -830,7 +828,7 @@ private constructor( invoicingThreshold(JsonField.ofNullable(invoicingThreshold)) fun invoicingThreshold(invoicingThreshold: Optional) = - invoicingThreshold(invoicingThreshold.orElse(null)) + invoicingThreshold(invoicingThreshold.getOrNull()) fun invoicingThreshold(invoicingThreshold: JsonField) = apply { this.invoicingThreshold = invoicingThreshold @@ -933,7 +931,7 @@ private constructor( redeemedCoupon(JsonField.ofNullable(redeemedCoupon)) fun redeemedCoupon(redeemedCoupon: Optional) = - redeemedCoupon(redeemedCoupon.orElse(null)) + redeemedCoupon(redeemedCoupon.getOrNull()) fun redeemedCoupon(redeemedCoupon: JsonField) = apply { this.redeemedCoupon = redeemedCoupon @@ -1170,7 +1168,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The end date of the adjustment interval. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The end date of the adjustment interval. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -1719,9 +1717,8 @@ private constructor( planPhaseOrder(planPhaseOrder as Long?) /** The plan phase in which this adjustment is active. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) /** The plan phase in which this adjustment is active. */ fun planPhaseOrder(planPhaseOrder: JsonField) = apply { @@ -1732,7 +1729,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -2140,9 +2137,8 @@ private constructor( planPhaseOrder(planPhaseOrder as Long?) /** The plan phase in which this adjustment is active. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) /** The plan phase in which this adjustment is active. */ fun planPhaseOrder(planPhaseOrder: JsonField) = apply { @@ -2153,7 +2149,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -2549,9 +2545,8 @@ private constructor( planPhaseOrder(planPhaseOrder as Long?) /** The plan phase in which this adjustment is active. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) /** The plan phase in which this adjustment is active. */ fun planPhaseOrder(planPhaseOrder: JsonField) = apply { @@ -2562,7 +2557,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -2973,9 +2968,8 @@ private constructor( planPhaseOrder(planPhaseOrder as Long?) /** The plan phase in which this adjustment is active. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) /** The plan phase in which this adjustment is active. */ fun planPhaseOrder(planPhaseOrder: JsonField) = apply { @@ -2986,7 +2980,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -3379,9 +3373,8 @@ private constructor( planPhaseOrder(planPhaseOrder as Long?) /** The plan phase in which this adjustment is active. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) /** The plan phase in which this adjustment is active. */ fun planPhaseOrder(planPhaseOrder: JsonField) = apply { @@ -3392,7 +3385,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -3709,8 +3702,7 @@ private constructor( * The month on which the billing cycle is anchored (e.g. a quarterly price anchored in * February would have cycles starting February, May, August, and November). */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun month(month: Optional) = month(month.orElse(null) as Long?) + fun month(month: Optional) = month(month.getOrNull()) /** * The month on which the billing cycle is anchored (e.g. a quarterly price anchored in @@ -3734,8 +3726,7 @@ private constructor( * The year on which the billing cycle is anchored (e.g. a 2 year billing cycle anchored * on 2021 would have cycles starting on 2021, 2023, 2025, etc.). */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun year(year: Optional) = year(year.orElse(null) as Long?) + fun year(year: Optional) = year(year.getOrNull()) /** * The year on which the billing cycle is anchored (e.g. a 2 year billing cycle anchored @@ -4164,7 +4155,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The end date of the discount interval. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The end date of the discount interval. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -4524,7 +4515,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The end date of the discount interval. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The end date of the discount interval. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -4900,7 +4891,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The end date of the discount interval. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The end date of the discount interval. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -5182,7 +5173,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -5418,7 +5409,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The end date of the maximum interval. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The end date of the maximum interval. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -5750,7 +5741,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The end date of the minimum interval. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The end date of the minimum interval. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -6123,7 +6114,7 @@ private constructor( * interval is not currently active. */ fun currentBillingPeriodEndDate(currentBillingPeriodEndDate: Optional) = - currentBillingPeriodEndDate(currentBillingPeriodEndDate.orElse(null)) + currentBillingPeriodEndDate(currentBillingPeriodEndDate.getOrNull()) /** * The end of the current billing period. This is an exclusive timestamp, such that the @@ -6149,7 +6140,7 @@ private constructor( */ fun currentBillingPeriodStartDate( currentBillingPeriodStartDate: Optional - ) = currentBillingPeriodStartDate(currentBillingPeriodStartDate.orElse(null)) + ) = currentBillingPeriodStartDate(currentBillingPeriodStartDate.getOrNull()) /** * The start date of the current billing period. This is an inclusive timestamp; the @@ -6170,7 +6161,7 @@ private constructor( * The end date of the price interval. This is the date that Orb stops billing for this * price. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** * The end date of the price interval. This is the date that Orb stops billing for this @@ -6182,7 +6173,7 @@ private constructor( fun filter(filter: String?) = filter(JsonField.ofNullable(filter)) /** An additional filter to apply to usage queries. */ - fun filter(filter: Optional) = filter(filter.orElse(null)) + fun filter(filter: Optional) = filter(filter.getOrNull()) /** An additional filter to apply to usage queries. */ fun filter(filter: JsonField) = apply { this.filter = filter } @@ -6201,7 +6192,7 @@ private constructor( */ fun fixedFeeQuantityTransitions( fixedFeeQuantityTransitions: Optional> - ) = fixedFeeQuantityTransitions(fixedFeeQuantityTransitions.orElse(null)) + ) = fixedFeeQuantityTransitions(fixedFeeQuantityTransitions.getOrNull()) /** * The fixed fee quantity transitions for this price interval. This is only relevant for @@ -6694,7 +6685,7 @@ private constructor( * price interval. */ fun usageCustomerIds(usageCustomerIds: Optional>) = - usageCustomerIds(usageCustomerIds.orElse(null)) + usageCustomerIds(usageCustomerIds.getOrNull()) /** * A list of customer IDs whose usage events will be aggregated and billed under this @@ -7007,7 +6998,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -7228,7 +7219,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) fun endDate(endDate: JsonField) = apply { this.endDate = endDate } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionFetchCostsParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionFetchCostsParams.kt index fbfbb12a..8198db08 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionFetchCostsParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionFetchCostsParams.kt @@ -15,6 +15,7 @@ import java.time.OffsetDateTime import java.time.format.DateTimeFormatter import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull /** * This endpoint is used to fetch a day-by-day snapshot of a subscription's costs in Orb, calculated @@ -133,14 +134,14 @@ private constructor( fun currency(currency: String?) = apply { this.currency = currency } /** The currency or custom pricing unit to use. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** Costs returned are exclusive of `timeframe_end`. */ fun timeframeEnd(timeframeEnd: OffsetDateTime?) = apply { this.timeframeEnd = timeframeEnd } /** Costs returned are exclusive of `timeframe_end`. */ fun timeframeEnd(timeframeEnd: Optional) = - timeframeEnd(timeframeEnd.orElse(null)) + timeframeEnd(timeframeEnd.getOrNull()) /** Costs returned are inclusive of `timeframe_start`. */ fun timeframeStart(timeframeStart: OffsetDateTime?) = apply { @@ -149,7 +150,7 @@ private constructor( /** Costs returned are inclusive of `timeframe_start`. */ fun timeframeStart(timeframeStart: Optional) = - timeframeStart(timeframeStart.orElse(null)) + timeframeStart(timeframeStart.getOrNull()) /** * Controls whether Orb returns cumulative costs since the start of the billing period, or @@ -163,7 +164,7 @@ private constructor( * incremental day-by-day costs. If your customer has minimums or discounts, it's strongly * recommended that you use the default cumulative behavior. */ - fun viewMode(viewMode: Optional) = viewMode(viewMode.orElse(null)) + fun viewMode(viewMode: Optional) = viewMode(viewMode.getOrNull()) fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionFetchCostsResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionFetchCostsResponse.kt index c2fb2e30..cdb7e855 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionFetchCostsResponse.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionFetchCostsResponse.kt @@ -18,6 +18,7 @@ import com.withorb.api.core.toImmutable import java.time.OffsetDateTime import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull @NoAutoDetect class SubscriptionFetchCostsResponse @@ -548,9 +549,7 @@ private constructor( fun quantity(quantity: Double) = quantity(quantity as Double?) /** The price's quantity for the timeframe */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun quantity(quantity: Optional) = - quantity(quantity.orElse(null) as Double?) + fun quantity(quantity: Optional) = quantity(quantity.getOrNull()) /** The price's quantity for the timeframe */ fun quantity(quantity: JsonField) = apply { this.quantity = quantity } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionFetchSchedulePage.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionFetchSchedulePage.kt index 199aad8a..b78c755a 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionFetchSchedulePage.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionFetchSchedulePage.kt @@ -18,6 +18,7 @@ import java.util.Objects import java.util.Optional import java.util.stream.Stream import java.util.stream.StreamSupport +import kotlin.jvm.optionals.getOrNull /** * This endpoint returns a [paginated](/api-reference/pagination) list of all plans associated with @@ -196,7 +197,7 @@ private constructor( while (index < page.data().size) { yield(page.data()[index++]) } - page = page.getNextPage().orElse(null) ?: break + page = page.getNextPage().getOrNull() ?: break index = 0 } } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionFetchScheduleParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionFetchScheduleParams.kt index c373fd89..47e8312f 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionFetchScheduleParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionFetchScheduleParams.kt @@ -11,6 +11,7 @@ import java.time.OffsetDateTime import java.time.format.DateTimeFormatter import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull /** * This endpoint returns a [paginated](/api-reference/pagination) list of all plans associated with @@ -151,7 +152,7 @@ private constructor( * Cursor for pagination. This can be populated by the `next_cursor` value returned from the * initial request. */ - fun cursor(cursor: Optional) = cursor(cursor.orElse(null)) + fun cursor(cursor: Optional) = cursor(cursor.getOrNull()) /** The number of items to fetch. Defaults to 20. */ fun limit(limit: Long?) = apply { this.limit = limit } @@ -160,28 +161,27 @@ private constructor( fun limit(limit: Long) = limit(limit as Long?) /** The number of items to fetch. Defaults to 20. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun limit(limit: Optional) = limit(limit.orElse(null) as Long?) + fun limit(limit: Optional) = limit(limit.getOrNull()) fun startDateGt(startDateGt: OffsetDateTime?) = apply { this.startDateGt = startDateGt } fun startDateGt(startDateGt: Optional) = - startDateGt(startDateGt.orElse(null)) + startDateGt(startDateGt.getOrNull()) fun startDateGte(startDateGte: OffsetDateTime?) = apply { this.startDateGte = startDateGte } fun startDateGte(startDateGte: Optional) = - startDateGte(startDateGte.orElse(null)) + startDateGte(startDateGte.getOrNull()) fun startDateLt(startDateLt: OffsetDateTime?) = apply { this.startDateLt = startDateLt } fun startDateLt(startDateLt: Optional) = - startDateLt(startDateLt.orElse(null)) + startDateLt(startDateLt.getOrNull()) fun startDateLte(startDateLte: OffsetDateTime?) = apply { this.startDateLte = startDateLte } fun startDateLte(startDateLte: Optional) = - startDateLte(startDateLte.orElse(null)) + startDateLte(startDateLte.getOrNull()) fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionFetchScheduleResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionFetchScheduleResponse.kt index bcdcd2fc..bab61caf 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionFetchScheduleResponse.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionFetchScheduleResponse.kt @@ -17,6 +17,7 @@ import com.withorb.api.core.toImmutable import java.time.OffsetDateTime import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull @NoAutoDetect class SubscriptionFetchScheduleResponse @@ -118,7 +119,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -251,7 +252,7 @@ private constructor( fun id(id: String?) = id(JsonField.ofNullable(id)) - fun id(id: Optional) = id(id.orElse(null)) + fun id(id: Optional) = id(id.getOrNull()) fun id(id: JsonField) = apply { this.id = id } @@ -269,7 +270,7 @@ private constructor( * your system. */ fun externalPlanId(externalPlanId: Optional) = - externalPlanId(externalPlanId.orElse(null)) + externalPlanId(externalPlanId.getOrNull()) /** * An optional user-defined ID for this plan resource, used throughout the system as an @@ -282,7 +283,7 @@ private constructor( fun name(name: String?) = name(JsonField.ofNullable(name)) - fun name(name: Optional) = name(name.orElse(null)) + fun name(name: Optional) = name(name.getOrNull()) fun name(name: JsonField) = apply { this.name = name } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionFetchUsageParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionFetchUsageParams.kt index feafc475..4b2bacce 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionFetchUsageParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionFetchUsageParams.kt @@ -15,6 +15,7 @@ import java.time.OffsetDateTime import java.time.format.DateTimeFormatter import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull /** * This endpoint is used to fetch a subscription's usage in Orb. Especially when combined with @@ -359,54 +360,54 @@ private constructor( * together. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) fun firstDimensionKey(firstDimensionKey: String?) = apply { this.firstDimensionKey = firstDimensionKey } fun firstDimensionKey(firstDimensionKey: Optional) = - firstDimensionKey(firstDimensionKey.orElse(null)) + firstDimensionKey(firstDimensionKey.getOrNull()) fun firstDimensionValue(firstDimensionValue: String?) = apply { this.firstDimensionValue = firstDimensionValue } fun firstDimensionValue(firstDimensionValue: Optional) = - firstDimensionValue(firstDimensionValue.orElse(null)) + firstDimensionValue(firstDimensionValue.getOrNull()) /** This determines the windowing of usage reporting. */ fun granularity(granularity: Granularity?) = apply { this.granularity = granularity } /** This determines the windowing of usage reporting. */ - fun granularity(granularity: Optional) = granularity(granularity.orElse(null)) + fun granularity(granularity: Optional) = granularity(granularity.getOrNull()) /** Groups per-price usage by the key provided. */ fun groupBy(groupBy: String?) = apply { this.groupBy = groupBy } /** Groups per-price usage by the key provided. */ - fun groupBy(groupBy: Optional) = groupBy(groupBy.orElse(null)) + fun groupBy(groupBy: Optional) = groupBy(groupBy.getOrNull()) fun secondDimensionKey(secondDimensionKey: String?) = apply { this.secondDimensionKey = secondDimensionKey } fun secondDimensionKey(secondDimensionKey: Optional) = - secondDimensionKey(secondDimensionKey.orElse(null)) + secondDimensionKey(secondDimensionKey.getOrNull()) fun secondDimensionValue(secondDimensionValue: String?) = apply { this.secondDimensionValue = secondDimensionValue } fun secondDimensionValue(secondDimensionValue: Optional) = - secondDimensionValue(secondDimensionValue.orElse(null)) + secondDimensionValue(secondDimensionValue.getOrNull()) /** Usage returned is exclusive of `timeframe_end`. */ fun timeframeEnd(timeframeEnd: OffsetDateTime?) = apply { this.timeframeEnd = timeframeEnd } /** Usage returned is exclusive of `timeframe_end`. */ fun timeframeEnd(timeframeEnd: Optional) = - timeframeEnd(timeframeEnd.orElse(null)) + timeframeEnd(timeframeEnd.getOrNull()) /** Usage returned is inclusive of `timeframe_start`. */ fun timeframeStart(timeframeStart: OffsetDateTime?) = apply { @@ -415,7 +416,7 @@ private constructor( /** Usage returned is inclusive of `timeframe_start`. */ fun timeframeStart(timeframeStart: Optional) = - timeframeStart(timeframeStart.orElse(null)) + timeframeStart(timeframeStart.getOrNull()) /** * Controls whether Orb returns cumulative usage since the start of the billing period, or @@ -429,7 +430,7 @@ private constructor( * incremental day-by-day usage. If your customer has minimums or discounts, it's strongly * recommended that you use the default cumulative behavior. */ - fun viewMode(viewMode: Optional) = viewMode(viewMode.orElse(null)) + fun viewMode(viewMode: Optional) = viewMode(viewMode.getOrNull()) fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionListPage.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionListPage.kt index 9f961da6..d6dc49c3 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionListPage.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionListPage.kt @@ -18,6 +18,7 @@ import java.util.Objects import java.util.Optional import java.util.stream.Stream import java.util.stream.StreamSupport +import kotlin.jvm.optionals.getOrNull /** * This endpoint returns a list of all subscriptions for an account as a @@ -193,7 +194,7 @@ private constructor( while (index < page.data().size) { yield(page.data()[index++]) } - page = page.getNextPage().orElse(null) ?: break + page = page.getNextPage().getOrNull() ?: break index = 0 } } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionListParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionListParams.kt index c82f0e4a..16371547 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionListParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionListParams.kt @@ -15,6 +15,7 @@ import java.time.OffsetDateTime import java.time.format.DateTimeFormatter import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull /** * This endpoint returns a list of all subscriptions for an account as a @@ -151,22 +152,22 @@ private constructor( fun createdAtGt(createdAtGt: OffsetDateTime?) = apply { this.createdAtGt = createdAtGt } fun createdAtGt(createdAtGt: Optional) = - createdAtGt(createdAtGt.orElse(null)) + createdAtGt(createdAtGt.getOrNull()) fun createdAtGte(createdAtGte: OffsetDateTime?) = apply { this.createdAtGte = createdAtGte } fun createdAtGte(createdAtGte: Optional) = - createdAtGte(createdAtGte.orElse(null)) + createdAtGte(createdAtGte.getOrNull()) fun createdAtLt(createdAtLt: OffsetDateTime?) = apply { this.createdAtLt = createdAtLt } fun createdAtLt(createdAtLt: Optional) = - createdAtLt(createdAtLt.orElse(null)) + createdAtLt(createdAtLt.getOrNull()) fun createdAtLte(createdAtLte: OffsetDateTime?) = apply { this.createdAtLte = createdAtLte } fun createdAtLte(createdAtLte: Optional) = - createdAtLte(createdAtLte.orElse(null)) + createdAtLte(createdAtLte.getOrNull()) /** * Cursor for pagination. This can be populated by the `next_cursor` value returned from the @@ -178,13 +179,13 @@ private constructor( * Cursor for pagination. This can be populated by the `next_cursor` value returned from the * initial request. */ - fun cursor(cursor: Optional) = cursor(cursor.orElse(null)) + fun cursor(cursor: Optional) = cursor(cursor.getOrNull()) fun customerId(customerId: List?) = apply { this.customerId = customerId?.toMutableList() } - fun customerId(customerId: Optional>) = customerId(customerId.orElse(null)) + fun customerId(customerId: Optional>) = customerId(customerId.getOrNull()) fun addCustomerId(customerId: String) = apply { this.customerId = (this.customerId ?: mutableListOf()).apply { add(customerId) } @@ -195,7 +196,7 @@ private constructor( } fun externalCustomerId(externalCustomerId: Optional) = - externalCustomerId(externalCustomerId.orElse(null)) + externalCustomerId(externalCustomerId.getOrNull()) /** The number of items to fetch. Defaults to 20. */ fun limit(limit: Long?) = apply { this.limit = limit } @@ -204,12 +205,11 @@ private constructor( fun limit(limit: Long) = limit(limit as Long?) /** The number of items to fetch. Defaults to 20. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun limit(limit: Optional) = limit(limit.orElse(null) as Long?) + fun limit(limit: Optional) = limit(limit.getOrNull()) fun status(status: Status?) = apply { this.status = status } - fun status(status: Optional) = status(status.orElse(null)) + fun status(status: Optional) = status(status.getOrNull()) fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionPriceIntervalsParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionPriceIntervalsParams.kt index 44d844a1..3c47565b 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionPriceIntervalsParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionPriceIntervalsParams.kt @@ -338,9 +338,8 @@ private constructor( * credit note. Consider using this as a safety mechanism if you do not expect existing * invoices to be changed. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun allowInvoiceCreditOrVoid(allowInvoiceCreditOrVoid: Optional) = - allowInvoiceCreditOrVoid(allowInvoiceCreditOrVoid.orElse(null) as Boolean?) + allowInvoiceCreditOrVoid(allowInvoiceCreditOrVoid.getOrNull()) /** * If false, this request will fail if it would void an issued invoice or create a @@ -515,9 +514,8 @@ private constructor( * note. Consider using this as a safety mechanism if you do not expect existing invoices to * be changed. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun allowInvoiceCreditOrVoid(allowInvoiceCreditOrVoid: Optional) = - allowInvoiceCreditOrVoid(allowInvoiceCreditOrVoid.orElse(null) as Boolean?) + allowInvoiceCreditOrVoid(allowInvoiceCreditOrVoid.getOrNull()) /** * If false, this request will fail if it would void an issued invoice or create a credit @@ -974,7 +972,7 @@ private constructor( /** The definition of a new allocation price to create and add to the subscription. */ fun allocationPrice(allocationPrice: Optional) = - allocationPrice(allocationPrice.orElse(null)) + allocationPrice(allocationPrice.getOrNull()) /** The definition of a new allocation price to create and add to the subscription. */ fun allocationPrice(allocationPrice: JsonField) = apply { @@ -985,7 +983,7 @@ private constructor( fun discounts(discounts: List?) = discounts(JsonField.ofNullable(discounts)) /** A list of discounts to initialize on the price interval. */ - fun discounts(discounts: Optional>) = discounts(discounts.orElse(null)) + fun discounts(discounts: Optional>) = discounts(discounts.getOrNull()) /** A list of discounts to initialize on the price interval. */ fun discounts(discounts: JsonField>) = apply { @@ -1068,7 +1066,7 @@ private constructor( * The end date of the price interval. This is the date that the price will stop billing * on the subscription. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** * The end date of the price interval. This is the date that the price will stop billing @@ -1095,7 +1093,7 @@ private constructor( /** The external price id of the price to add to the subscription. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** The external price id of the price to add to the subscription. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -1114,7 +1112,7 @@ private constructor( * boolean [computed property](/extensibility/advanced-metrics#computed-properties). If * null, usage queries will not include any additional filter. */ - fun filter(filter: Optional) = filter(filter.orElse(null)) + fun filter(filter: Optional) = filter(filter.getOrNull()) /** * An additional filter to apply to usage queries. This filter must be expressed as a @@ -1131,7 +1129,7 @@ private constructor( /** A list of fixed fee quantity transitions to initialize on the price interval. */ fun fixedFeeQuantityTransitions( fixedFeeQuantityTransitions: Optional> - ) = fixedFeeQuantityTransitions(fixedFeeQuantityTransitions.orElse(null)) + ) = fixedFeeQuantityTransitions(fixedFeeQuantityTransitions.getOrNull()) /** A list of fixed fee quantity transitions to initialize on the price interval. */ fun fixedFeeQuantityTransitions( @@ -1169,9 +1167,8 @@ private constructor( * The maximum amount that will be billed for this price interval for a given billing * period. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun maximumAmount(maximumAmount: Optional) = - maximumAmount(maximumAmount.orElse(null) as Double?) + maximumAmount(maximumAmount.getOrNull()) /** * The maximum amount that will be billed for this price interval for a given billing @@ -1198,9 +1195,8 @@ private constructor( * The minimum amount that will be billed for this price interval for a given billing * period. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun minimumAmount(minimumAmount: Optional) = - minimumAmount(minimumAmount.orElse(null) as Double?) + minimumAmount(minimumAmount.getOrNull()) /** * The minimum amount that will be billed for this price interval for a given billing @@ -1214,7 +1210,7 @@ private constructor( fun price(price: Price?) = price(JsonField.ofNullable(price)) /** The definition of a new price to create and add to the subscription. */ - fun price(price: Optional) = price(price.orElse(null)) + fun price(price: Optional) = price(price.getOrNull()) /** The definition of a new price to create and add to the subscription. */ fun price(price: JsonField) = apply { this.price = price } @@ -1371,7 +1367,7 @@ private constructor( fun priceId(priceId: String?) = priceId(JsonField.ofNullable(priceId)) /** The id of the price to add to the subscription. */ - fun priceId(priceId: Optional) = priceId(priceId.orElse(null)) + fun priceId(priceId: Optional) = priceId(priceId.getOrNull()) /** The id of the price to add to the subscription. */ fun priceId(priceId: JsonField) = apply { this.priceId = priceId } @@ -1396,7 +1392,7 @@ private constructor( * of that customer's children. */ fun usageCustomerIds(usageCustomerIds: Optional>) = - usageCustomerIds(usageCustomerIds.orElse(null)) + usageCustomerIds(usageCustomerIds.getOrNull()) /** * A list of customer IDs whose usage events will be aggregated and billed under this @@ -4865,7 +4861,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -4893,9 +4889,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -4919,7 +4914,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -4944,9 +4939,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -4961,7 +4955,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -4986,9 +4980,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -5004,7 +4997,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -5028,7 +5021,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -5050,7 +5043,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -6437,7 +6430,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -6465,9 +6458,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -6491,7 +6483,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -6516,9 +6508,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -6533,7 +6524,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -6558,9 +6549,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -6576,7 +6566,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -6600,7 +6590,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -6622,7 +6612,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -8046,7 +8036,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -8074,9 +8064,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -8100,7 +8089,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -8125,9 +8114,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -8142,7 +8130,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -8167,9 +8155,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -8185,7 +8172,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -8209,7 +8196,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -8231,7 +8218,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -9887,7 +9874,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -9915,9 +9902,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -9941,7 +9927,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -9966,9 +9952,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -9983,7 +9968,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -10008,9 +9993,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -10026,7 +10010,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -10050,7 +10034,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -10072,7 +10056,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -11750,7 +11734,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -11778,9 +11762,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -11804,7 +11787,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -11829,9 +11812,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -11846,7 +11828,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -11871,9 +11853,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -11889,7 +11870,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -11913,7 +11894,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -11935,7 +11916,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -12463,11 +12444,8 @@ private constructor( * Exclusive tier ending value. If null, this is treated as the last * tier */ - @Suppress( - "USELESS_CAST" - ) // See https://youtrack.jetbrains.com/issue/KT-74228 fun lastUnit(lastUnit: Optional) = - lastUnit(lastUnit.orElse(null) as Double?) + lastUnit(lastUnit.getOrNull()) /** * Exclusive tier ending value. If null, this is treated as the last @@ -13532,7 +13510,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -13560,9 +13538,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -13586,7 +13563,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -13611,9 +13588,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -13628,7 +13604,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -13653,9 +13629,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -13671,7 +13646,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -13695,7 +13670,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -13717,7 +13692,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -14252,7 +14227,7 @@ private constructor( /** Exclusive tier ending value */ fun maximumAmount(maximumAmount: Optional) = - maximumAmount(maximumAmount.orElse(null)) + maximumAmount(maximumAmount.getOrNull()) /** Exclusive tier ending value */ fun maximumAmount(maximumAmount: JsonField) = apply { @@ -14265,7 +14240,7 @@ private constructor( /** Per unit maximum to charge */ fun perUnitMaximum(perUnitMaximum: Optional) = - perUnitMaximum(perUnitMaximum.orElse(null)) + perUnitMaximum(perUnitMaximum.getOrNull()) /** Per unit maximum to charge */ fun perUnitMaximum(perUnitMaximum: JsonField) = apply { @@ -15324,7 +15299,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -15352,9 +15327,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -15378,7 +15352,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -15403,9 +15377,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -15420,7 +15393,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -15445,9 +15418,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -15463,7 +15435,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -15487,7 +15459,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -15509,7 +15481,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -15648,7 +15620,7 @@ private constructor( /** Optional currency amount maximum to cap spend per event */ fun perUnitMaximum(perUnitMaximum: Optional) = - perUnitMaximum(perUnitMaximum.orElse(null)) + perUnitMaximum(perUnitMaximum.getOrNull()) /** Optional currency amount maximum to cap spend per event */ fun perUnitMaximum(perUnitMaximum: JsonField) = apply { @@ -16921,7 +16893,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -16949,9 +16921,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -16975,7 +16946,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -17000,9 +16971,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -17017,7 +16987,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -17042,9 +17012,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -17060,7 +17029,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -17084,7 +17053,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -17106,7 +17075,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -17384,7 +17353,7 @@ private constructor( /** Upper bound for tier */ fun maximumAmount(maximumAmount: Optional) = - maximumAmount(maximumAmount.orElse(null)) + maximumAmount(maximumAmount.getOrNull()) /** Upper bound for tier */ fun maximumAmount(maximumAmount: JsonField) = apply { @@ -17397,7 +17366,7 @@ private constructor( /** The maximum amount to charge for any one event */ fun perUnitMaximum(perUnitMaximum: Optional) = - perUnitMaximum(perUnitMaximum.orElse(null)) + perUnitMaximum(perUnitMaximum.getOrNull()) /** The maximum amount to charge for any one event */ fun perUnitMaximum(perUnitMaximum: JsonField) = apply { @@ -18687,7 +18656,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -18715,9 +18684,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -18741,7 +18709,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -18766,9 +18734,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -18783,7 +18750,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -18808,9 +18775,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -18826,7 +18792,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -18850,7 +18816,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -18872,7 +18838,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -19127,11 +19093,8 @@ private constructor( maximumUnits(maximumUnits as Double?) /** Upper bound for this tier */ - @Suppress( - "USELESS_CAST" - ) // See https://youtrack.jetbrains.com/issue/KT-74228 fun maximumUnits(maximumUnits: Optional) = - maximumUnits(maximumUnits.orElse(null) as Double?) + maximumUnits(maximumUnits.getOrNull()) /** Upper bound for this tier */ fun maximumUnits(maximumUnits: JsonField) = apply { @@ -20430,7 +20393,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -20458,9 +20421,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -20484,7 +20446,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -20509,9 +20471,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -20526,7 +20487,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -20551,9 +20512,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -20569,7 +20529,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -20593,7 +20553,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -20615,7 +20575,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -21979,7 +21939,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -22007,9 +21967,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -22033,7 +21992,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -22058,9 +22017,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -22075,7 +22033,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -22100,9 +22058,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -22118,7 +22075,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -22142,7 +22099,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -22164,7 +22121,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -23527,7 +23484,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -23555,9 +23512,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -23581,7 +23537,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -23606,9 +23562,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -23623,7 +23578,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -23648,9 +23603,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -23666,7 +23620,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -23690,7 +23644,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -23712,7 +23666,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -25083,7 +25037,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -25111,9 +25065,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -25137,7 +25090,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -25162,9 +25115,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -25179,7 +25131,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -25204,9 +25156,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -25222,7 +25173,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -25246,7 +25197,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -25268,7 +25219,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -26638,7 +26589,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -26666,9 +26617,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -26692,7 +26642,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -26717,9 +26667,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -26734,7 +26683,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -26759,9 +26708,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -26777,7 +26725,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -26801,7 +26749,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -26823,7 +26771,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -28195,7 +28143,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -28223,9 +28171,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -28249,7 +28196,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -28274,9 +28221,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -28291,7 +28237,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -28316,9 +28262,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -28334,7 +28279,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -28358,7 +28303,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -28380,7 +28325,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -29760,7 +29705,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -29788,9 +29733,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -29814,7 +29758,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -29839,9 +29783,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -29856,7 +29799,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -29881,9 +29824,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -29899,7 +29841,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -29923,7 +29865,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -29945,7 +29887,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -31316,7 +31258,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -31344,9 +31286,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -31370,7 +31311,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -31395,9 +31336,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -31412,7 +31352,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -31437,9 +31377,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -31455,7 +31394,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -31479,7 +31418,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -31501,7 +31440,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -32868,7 +32807,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -32896,9 +32835,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -32922,7 +32860,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -32947,9 +32885,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -32964,7 +32901,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -32989,9 +32926,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -33007,7 +32943,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -33031,7 +32967,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -33053,7 +32989,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -34419,7 +34355,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -34447,9 +34383,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -34473,7 +34408,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -34498,9 +34433,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -34515,7 +34449,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -34540,9 +34474,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -34558,7 +34491,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -34582,7 +34515,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -34604,7 +34537,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -35970,7 +35903,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -35998,9 +35931,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -36024,7 +35956,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -36049,9 +35981,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -36066,7 +35997,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -36091,9 +36022,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -36109,7 +36039,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -36133,7 +36063,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -36155,7 +36085,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -37539,7 +37469,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -37567,9 +37497,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -37593,7 +37522,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -37618,9 +37547,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -37635,7 +37563,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -37660,9 +37588,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -37678,7 +37605,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -37702,7 +37629,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -37724,7 +37651,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -39112,7 +39039,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -39140,9 +39067,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -39166,7 +39092,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -39191,9 +39117,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -39208,7 +39133,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -39233,9 +39158,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -39251,7 +39175,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -39275,7 +39199,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -39297,7 +39221,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -40674,7 +40598,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -40702,9 +40626,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -40728,7 +40651,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -40753,9 +40676,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -40770,7 +40692,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -40795,9 +40717,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -40813,7 +40734,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -40837,7 +40758,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -40859,7 +40780,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -42229,7 +42150,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -42257,9 +42178,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -42283,7 +42203,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -42308,9 +42228,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -42325,7 +42244,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -42350,9 +42269,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -42368,7 +42286,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -42392,7 +42310,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -42414,7 +42332,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -43782,7 +43700,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -43810,9 +43728,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -43836,7 +43753,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -43861,9 +43778,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -43878,7 +43794,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -43903,9 +43819,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -43921,7 +43836,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -43945,7 +43860,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -43967,7 +43882,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -45357,7 +45272,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -45385,9 +45300,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -45411,7 +45325,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -45436,9 +45350,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -45453,7 +45366,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -45478,9 +45391,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -45496,7 +45408,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -45520,7 +45432,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -45542,7 +45454,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -46942,7 +46854,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -46970,9 +46882,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -46996,7 +46907,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -47021,9 +46932,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -47038,7 +46948,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -47063,9 +46973,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -47081,7 +46990,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -47105,7 +47014,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -47127,7 +47036,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -48511,7 +48420,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -48539,9 +48448,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -48565,7 +48473,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -48590,9 +48498,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -48607,7 +48514,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -48632,9 +48539,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -48650,7 +48556,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -48674,7 +48580,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -48696,7 +48602,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -49877,7 +49783,7 @@ private constructor( * The end date of the adjustment interval. This is the date that the adjustment will * stop affecting prices on the subscription. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** * The end date of the adjustment interval. This is the date that the adjustment will @@ -52276,9 +52182,8 @@ private constructor( * cycle day will not be updated. Note that overlapping price intervals must have the * same billing cycle day. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billingCycleDay(billingCycleDay: Optional) = - billingCycleDay(billingCycleDay.orElse(null) as Long?) + billingCycleDay(billingCycleDay.getOrNull()) /** * The updated billing cycle day for this price interval. If not specified, the billing @@ -52299,7 +52204,7 @@ private constructor( * The updated end date of this price interval. If not specified, the start date will * not be updated. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** * The updated end date of this price interval. If not specified, the start date will @@ -52332,7 +52237,7 @@ private constructor( * boolean [computed property](/extensibility/advanced-metrics#computed-properties). If * null, usage queries will not include any additional filter. */ - fun filter(filter: Optional) = filter(filter.orElse(null)) + fun filter(filter: Optional) = filter(filter.getOrNull()) /** * An additional filter to apply to usage queries. This filter must be expressed as a @@ -52357,7 +52262,7 @@ private constructor( */ fun fixedFeeQuantityTransitions( fixedFeeQuantityTransitions: Optional> - ) = fixedFeeQuantityTransitions(fixedFeeQuantityTransitions.orElse(null)) + ) = fixedFeeQuantityTransitions(fixedFeeQuantityTransitions.getOrNull()) /** * A list of fixed fee quantity transitions to use for this price interval. Note that @@ -52431,7 +52336,7 @@ private constructor( * of that customer's children. */ fun usageCustomerIds(usageCustomerIds: Optional>) = - usageCustomerIds(usageCustomerIds.orElse(null)) + usageCustomerIds(usageCustomerIds.getOrNull()) /** * A list of customer IDs whose usage events will be aggregated and billed under this @@ -53057,7 +52962,7 @@ private constructor( * The updated end date of this adjustment interval. If not specified, the start date * will not be updated. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** * The updated end date of this adjustment interval. If not specified, the start date diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionPriceIntervalsResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionPriceIntervalsResponse.kt index 7a3e8a78..e3b3b6cd 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionPriceIntervalsResponse.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionPriceIntervalsResponse.kt @@ -570,9 +570,8 @@ private constructor( activePlanPhaseOrder(activePlanPhaseOrder as Long?) /** The current plan phase that is active, only if the subscription's plan has phases. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun activePlanPhaseOrder(activePlanPhaseOrder: Optional) = - activePlanPhaseOrder(activePlanPhaseOrder.orElse(null) as Long?) + activePlanPhaseOrder(activePlanPhaseOrder.getOrNull()) /** The current plan phase that is active, only if the subscription's plan has phases. */ fun activePlanPhaseOrder(activePlanPhaseOrder: JsonField) = apply { @@ -625,9 +624,8 @@ private constructor( * with the saved payment method on the due date. This property defaults to the plan's * behavior. If null, defaults to the customer's setting. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun autoCollection(autoCollection: Optional) = - autoCollection(autoCollection.orElse(null) as Boolean?) + autoCollection(autoCollection.getOrNull()) /** * Determines whether issued invoices for this subscription will automatically be charged @@ -682,7 +680,7 @@ private constructor( * are not currently active. */ fun currentBillingPeriodEndDate(currentBillingPeriodEndDate: Optional) = - currentBillingPeriodEndDate(currentBillingPeriodEndDate.orElse(null)) + currentBillingPeriodEndDate(currentBillingPeriodEndDate.getOrNull()) /** * The end of the current billing period. This is an exclusive timestamp, such that the @@ -708,7 +706,7 @@ private constructor( * is not currently active. */ fun currentBillingPeriodStartDate(currentBillingPeriodStartDate: Optional) = - currentBillingPeriodStartDate(currentBillingPeriodStartDate.orElse(null)) + currentBillingPeriodStartDate(currentBillingPeriodStartDate.getOrNull()) /** * The start date of the current billing period. This is an inclusive timestamp; the instant @@ -771,7 +769,7 @@ private constructor( * provided, it is determined by the plan configuration. */ fun defaultInvoiceMemo(defaultInvoiceMemo: Optional) = - defaultInvoiceMemo(defaultInvoiceMemo.orElse(null)) + defaultInvoiceMemo(defaultInvoiceMemo.getOrNull()) /** * Determines the default memo on this subscriptions' invoices. Note that if this is not @@ -814,7 +812,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The date Orb stops billing for this subscription. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The date Orb stops billing for this subscription. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -840,7 +838,7 @@ private constructor( invoicingThreshold(JsonField.ofNullable(invoicingThreshold)) fun invoicingThreshold(invoicingThreshold: Optional) = - invoicingThreshold(invoicingThreshold.orElse(null)) + invoicingThreshold(invoicingThreshold.getOrNull()) fun invoicingThreshold(invoicingThreshold: JsonField) = apply { this.invoicingThreshold = invoicingThreshold @@ -943,7 +941,7 @@ private constructor( redeemedCoupon(JsonField.ofNullable(redeemedCoupon)) fun redeemedCoupon(redeemedCoupon: Optional) = - redeemedCoupon(redeemedCoupon.orElse(null)) + redeemedCoupon(redeemedCoupon.getOrNull()) fun redeemedCoupon(redeemedCoupon: JsonField) = apply { this.redeemedCoupon = redeemedCoupon @@ -1180,7 +1178,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The end date of the adjustment interval. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The end date of the adjustment interval. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -1729,9 +1727,8 @@ private constructor( planPhaseOrder(planPhaseOrder as Long?) /** The plan phase in which this adjustment is active. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) /** The plan phase in which this adjustment is active. */ fun planPhaseOrder(planPhaseOrder: JsonField) = apply { @@ -1742,7 +1739,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -2150,9 +2147,8 @@ private constructor( planPhaseOrder(planPhaseOrder as Long?) /** The plan phase in which this adjustment is active. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) /** The plan phase in which this adjustment is active. */ fun planPhaseOrder(planPhaseOrder: JsonField) = apply { @@ -2163,7 +2159,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -2559,9 +2555,8 @@ private constructor( planPhaseOrder(planPhaseOrder as Long?) /** The plan phase in which this adjustment is active. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) /** The plan phase in which this adjustment is active. */ fun planPhaseOrder(planPhaseOrder: JsonField) = apply { @@ -2572,7 +2567,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -2983,9 +2978,8 @@ private constructor( planPhaseOrder(planPhaseOrder as Long?) /** The plan phase in which this adjustment is active. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) /** The plan phase in which this adjustment is active. */ fun planPhaseOrder(planPhaseOrder: JsonField) = apply { @@ -2996,7 +2990,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -3389,9 +3383,8 @@ private constructor( planPhaseOrder(planPhaseOrder as Long?) /** The plan phase in which this adjustment is active. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) /** The plan phase in which this adjustment is active. */ fun planPhaseOrder(planPhaseOrder: JsonField) = apply { @@ -3402,7 +3395,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -3719,8 +3712,7 @@ private constructor( * The month on which the billing cycle is anchored (e.g. a quarterly price anchored in * February would have cycles starting February, May, August, and November). */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun month(month: Optional) = month(month.orElse(null) as Long?) + fun month(month: Optional) = month(month.getOrNull()) /** * The month on which the billing cycle is anchored (e.g. a quarterly price anchored in @@ -3744,8 +3736,7 @@ private constructor( * The year on which the billing cycle is anchored (e.g. a 2 year billing cycle anchored * on 2021 would have cycles starting on 2021, 2023, 2025, etc.). */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun year(year: Optional) = year(year.orElse(null) as Long?) + fun year(year: Optional) = year(year.getOrNull()) /** * The year on which the billing cycle is anchored (e.g. a 2 year billing cycle anchored @@ -4174,7 +4165,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The end date of the discount interval. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The end date of the discount interval. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -4534,7 +4525,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The end date of the discount interval. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The end date of the discount interval. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -4910,7 +4901,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The end date of the discount interval. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The end date of the discount interval. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -5192,7 +5183,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -5428,7 +5419,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The end date of the maximum interval. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The end date of the maximum interval. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -5760,7 +5751,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The end date of the minimum interval. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The end date of the minimum interval. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -6133,7 +6124,7 @@ private constructor( * interval is not currently active. */ fun currentBillingPeriodEndDate(currentBillingPeriodEndDate: Optional) = - currentBillingPeriodEndDate(currentBillingPeriodEndDate.orElse(null)) + currentBillingPeriodEndDate(currentBillingPeriodEndDate.getOrNull()) /** * The end of the current billing period. This is an exclusive timestamp, such that the @@ -6159,7 +6150,7 @@ private constructor( */ fun currentBillingPeriodStartDate( currentBillingPeriodStartDate: Optional - ) = currentBillingPeriodStartDate(currentBillingPeriodStartDate.orElse(null)) + ) = currentBillingPeriodStartDate(currentBillingPeriodStartDate.getOrNull()) /** * The start date of the current billing period. This is an inclusive timestamp; the @@ -6180,7 +6171,7 @@ private constructor( * The end date of the price interval. This is the date that Orb stops billing for this * price. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** * The end date of the price interval. This is the date that Orb stops billing for this @@ -6192,7 +6183,7 @@ private constructor( fun filter(filter: String?) = filter(JsonField.ofNullable(filter)) /** An additional filter to apply to usage queries. */ - fun filter(filter: Optional) = filter(filter.orElse(null)) + fun filter(filter: Optional) = filter(filter.getOrNull()) /** An additional filter to apply to usage queries. */ fun filter(filter: JsonField) = apply { this.filter = filter } @@ -6211,7 +6202,7 @@ private constructor( */ fun fixedFeeQuantityTransitions( fixedFeeQuantityTransitions: Optional> - ) = fixedFeeQuantityTransitions(fixedFeeQuantityTransitions.orElse(null)) + ) = fixedFeeQuantityTransitions(fixedFeeQuantityTransitions.getOrNull()) /** * The fixed fee quantity transitions for this price interval. This is only relevant for @@ -6704,7 +6695,7 @@ private constructor( * price interval. */ fun usageCustomerIds(usageCustomerIds: Optional>) = - usageCustomerIds(usageCustomerIds.orElse(null)) + usageCustomerIds(usageCustomerIds.getOrNull()) /** * A list of customer IDs whose usage events will be aggregated and billed under this @@ -7017,7 +7008,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -7238,7 +7229,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) fun endDate(endDate: JsonField) = apply { this.endDate = endDate } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionSchedulePlanChangeParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionSchedulePlanChangeParams.kt index b6f4e7d5..40e2ad5c 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionSchedulePlanChangeParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionSchedulePlanChangeParams.kt @@ -1107,7 +1107,7 @@ private constructor( * that have migrated off of legacy subscription overrides) */ fun addAdjustments(addAdjustments: Optional>) = - addAdjustments(addAdjustments.orElse(null)) + addAdjustments(addAdjustments.getOrNull()) /** * Additional adjustments to be added to the subscription. (Only available for accounts @@ -1138,7 +1138,7 @@ private constructor( * Additional prices to be added to the subscription. (Only available for accounts that * have migrated off of legacy subscription overrides) */ - fun addPrices(addPrices: Optional>) = addPrices(addPrices.orElse(null)) + fun addPrices(addPrices: Optional>) = addPrices(addPrices.getOrNull()) /** * Additional prices to be added to the subscription. (Only available for accounts that @@ -1177,11 +1177,8 @@ private constructor( * [DEPRECATED] Use billing_cycle_alignment instead. Reset billing periods to be aligned * with the plan change's effective date. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun alignBillingWithPlanChangeDate(alignBillingWithPlanChangeDate: Optional) = - alignBillingWithPlanChangeDate( - alignBillingWithPlanChangeDate.orElse(null) as Boolean? - ) + alignBillingWithPlanChangeDate(alignBillingWithPlanChangeDate.getOrNull()) /** * [DEPRECATED] Use billing_cycle_alignment instead. Reset billing periods to be aligned @@ -1212,9 +1209,8 @@ private constructor( * charged with the saved payment method on the due date. If not specified, this * defaults to the behavior configured for this customer. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun autoCollection(autoCollection: Optional) = - autoCollection(autoCollection.orElse(null) as Boolean?) + autoCollection(autoCollection.getOrNull()) /** * Determines whether issued invoices for this subscription will automatically be @@ -1239,7 +1235,7 @@ private constructor( * alignment. */ fun billingCycleAlignment(billingCycleAlignment: Optional) = - billingCycleAlignment(billingCycleAlignment.orElse(null)) + billingCycleAlignment(billingCycleAlignment.getOrNull()) /** * Reset billing periods to be aligned with the plan change's effective date or start of @@ -1260,7 +1256,7 @@ private constructor( fun billingCycleAnchorConfiguration( billingCycleAnchorConfiguration: Optional - ) = billingCycleAnchorConfiguration(billingCycleAnchorConfiguration.orElse(null)) + ) = billingCycleAnchorConfiguration(billingCycleAnchorConfiguration.getOrNull()) fun billingCycleAnchorConfiguration( billingCycleAnchorConfiguration: JsonField @@ -1280,7 +1276,7 @@ private constructor( * plan change will happen at midnight in the customer's timezone. */ fun changeDate(changeDate: Optional) = - changeDate(changeDate.orElse(null)) + changeDate(changeDate.getOrNull()) /** * The date that the plan change should take effect. This parameter can only be passed @@ -1305,7 +1301,7 @@ private constructor( * the subscription creation or plan change will not be scheduled. */ fun couponRedemptionCode(couponRedemptionCode: Optional) = - couponRedemptionCode(couponRedemptionCode.orElse(null)) + couponRedemptionCode(couponRedemptionCode.getOrNull()) /** * Redemption code to be used for this subscription. If the coupon cannot be found by @@ -1325,9 +1321,8 @@ private constructor( creditsOverageRate(creditsOverageRate as Double?) @Deprecated("deprecated") - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun creditsOverageRate(creditsOverageRate: Optional) = - creditsOverageRate(creditsOverageRate.orElse(null) as Double?) + creditsOverageRate(creditsOverageRate.getOrNull()) @Deprecated("deprecated") fun creditsOverageRate(creditsOverageRate: JsonField) = apply { @@ -1346,7 +1341,7 @@ private constructor( * provided, it is determined by the plan configuration. */ fun defaultInvoiceMemo(defaultInvoiceMemo: Optional) = - defaultInvoiceMemo(defaultInvoiceMemo.orElse(null)) + defaultInvoiceMemo(defaultInvoiceMemo.getOrNull()) /** * Determines the default memo on this subscription's invoices. Note that if this is not @@ -1368,7 +1363,7 @@ private constructor( * Note that either this property or `plan_id` must be specified. */ fun externalPlanId(externalPlanId: Optional) = - externalPlanId(externalPlanId.orElse(null)) + externalPlanId(externalPlanId.getOrNull()) /** * The external_plan_id of the plan that the given subscription should be switched to. @@ -1390,7 +1385,7 @@ private constructor( * boolean [computed property](/extensibility/advanced-metrics#computed-properties). If * null, usage queries will not include any additional filter. */ - fun filter(filter: Optional) = filter(filter.orElse(null)) + fun filter(filter: Optional) = filter(filter.getOrNull()) /** * An additional filter to apply to usage queries. This filter must be expressed as a @@ -1408,9 +1403,8 @@ private constructor( initialPhaseOrder(initialPhaseOrder as Long?) /** The phase of the plan to start with */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun initialPhaseOrder(initialPhaseOrder: Optional) = - initialPhaseOrder(initialPhaseOrder.orElse(null) as Long?) + initialPhaseOrder(initialPhaseOrder.getOrNull()) /** The phase of the plan to start with */ fun initialPhaseOrder(initialPhaseOrder: JsonField) = apply { @@ -1431,7 +1425,7 @@ private constructor( * end of the billing period. */ fun invoicingThreshold(invoicingThreshold: Optional) = - invoicingThreshold(invoicingThreshold.orElse(null)) + invoicingThreshold(invoicingThreshold.getOrNull()) /** * When this subscription's accrued usage reaches this threshold, an invoice will be @@ -1461,8 +1455,7 @@ private constructor( * for the invoice. If you intend the invoice to be due on issue, set this to 0. If not * provided, this defaults to the value specified in the plan. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun netTerms(netTerms: Optional) = netTerms(netTerms.orElse(null) as Long?) + fun netTerms(netTerms: Optional) = netTerms(netTerms.getOrNull()) /** * The net terms determines the difference between the invoice date and the issue date @@ -1480,9 +1473,8 @@ private constructor( perCreditOverageAmount(perCreditOverageAmount as Double?) @Deprecated("deprecated") - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun perCreditOverageAmount(perCreditOverageAmount: Optional) = - perCreditOverageAmount(perCreditOverageAmount.orElse(null) as Double?) + perCreditOverageAmount(perCreditOverageAmount.getOrNull()) @Deprecated("deprecated") fun perCreditOverageAmount(perCreditOverageAmount: JsonField) = apply { @@ -1499,7 +1491,7 @@ private constructor( * The plan that the given subscription should be switched to. Note that either this * property or `external_plan_id` must be specified. */ - fun planId(planId: Optional) = planId(planId.orElse(null)) + fun planId(planId: Optional) = planId(planId.getOrNull()) /** * The plan that the given subscription should be switched to. Note that either this @@ -1525,9 +1517,8 @@ private constructor( * Specifies which version of the plan to change to. If null, the default version will * be used. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planVersionNumber(planVersionNumber: Optional) = - planVersionNumber(planVersionNumber.orElse(null) as Long?) + planVersionNumber(planVersionNumber.getOrNull()) /** * Specifies which version of the plan to change to. If null, the default version will @@ -1545,7 +1536,7 @@ private constructor( /** Optionally provide a list of overrides for prices on the plan */ @Deprecated("deprecated") fun priceOverrides(priceOverrides: Optional>) = - priceOverrides(priceOverrides.orElse(null)) + priceOverrides(priceOverrides.getOrNull()) /** Optionally provide a list of overrides for prices on the plan */ @Deprecated("deprecated") @@ -1574,7 +1565,7 @@ private constructor( * that have migrated off of legacy subscription overrides) */ fun removeAdjustments(removeAdjustments: Optional>) = - removeAdjustments(removeAdjustments.orElse(null)) + removeAdjustments(removeAdjustments.getOrNull()) /** * Plan adjustments to be removed from the subscription. (Only available for accounts @@ -1607,7 +1598,7 @@ private constructor( * have migrated off of legacy subscription overrides) */ fun removePrices(removePrices: Optional>) = - removePrices(removePrices.orElse(null)) + removePrices(removePrices.getOrNull()) /** * Plan prices to be removed from the subscription. (Only available for accounts that @@ -1640,7 +1631,7 @@ private constructor( * (Only available for accounts that have migrated off of legacy subscription overrides) */ fun replaceAdjustments(replaceAdjustments: Optional>) = - replaceAdjustments(replaceAdjustments.orElse(null)) + replaceAdjustments(replaceAdjustments.getOrNull()) /** * Plan adjustments to be replaced with additional adjustments on the subscription. @@ -1673,7 +1664,7 @@ private constructor( * available for accounts that have migrated off of legacy subscription overrides) */ fun replacePrices(replacePrices: Optional>) = - replacePrices(replacePrices.orElse(null)) + replacePrices(replacePrices.getOrNull()) /** * Plan prices to be replaced with additional prices on the subscription. (Only @@ -1712,9 +1703,8 @@ private constructor( * The duration of the trial period in days. If not provided, this defaults to the value * specified in the plan. If `0` is provided, the trial on the plan will be skipped. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun trialDurationDays(trialDurationDays: Optional) = - trialDurationDays(trialDurationDays.orElse(null) as Long?) + trialDurationDays(trialDurationDays.getOrNull()) /** * The duration of the trial period in days. If not provided, this defaults to the value @@ -1744,7 +1734,7 @@ private constructor( * of that customer's children. */ fun usageCustomerIds(usageCustomerIds: Optional>) = - usageCustomerIds(usageCustomerIds.orElse(null)) + usageCustomerIds(usageCustomerIds.getOrNull()) /** * A list of customer IDs whose usage events will be aggregated and billed under this @@ -1900,7 +1890,7 @@ private constructor( * have migrated off of legacy subscription overrides) */ fun addAdjustments(addAdjustments: Optional>) = - addAdjustments(addAdjustments.orElse(null)) + addAdjustments(addAdjustments.getOrNull()) /** * Additional adjustments to be added to the subscription. (Only available for accounts that @@ -1928,7 +1918,7 @@ private constructor( * Additional prices to be added to the subscription. (Only available for accounts that have * migrated off of legacy subscription overrides) */ - fun addPrices(addPrices: Optional>) = addPrices(addPrices.orElse(null)) + fun addPrices(addPrices: Optional>) = addPrices(addPrices.getOrNull()) /** * Additional prices to be added to the subscription. (Only available for accounts that have @@ -1961,9 +1951,8 @@ private constructor( * [DEPRECATED] Use billing_cycle_alignment instead. Reset billing periods to be aligned * with the plan change's effective date. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun alignBillingWithPlanChangeDate(alignBillingWithPlanChangeDate: Optional) = - alignBillingWithPlanChangeDate(alignBillingWithPlanChangeDate.orElse(null) as Boolean?) + alignBillingWithPlanChangeDate(alignBillingWithPlanChangeDate.getOrNull()) /** * [DEPRECATED] Use billing_cycle_alignment instead. Reset billing periods to be aligned @@ -1993,9 +1982,8 @@ private constructor( * with the saved payment method on the due date. If not specified, this defaults to the * behavior configured for this customer. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun autoCollection(autoCollection: Optional) = - autoCollection(autoCollection.orElse(null) as Boolean?) + autoCollection(autoCollection.getOrNull()) /** * Determines whether issued invoices for this subscription will automatically be charged @@ -2021,7 +2009,7 @@ private constructor( * alignment. */ fun billingCycleAlignment(billingCycleAlignment: Optional) = - billingCycleAlignment(billingCycleAlignment.orElse(null)) + billingCycleAlignment(billingCycleAlignment.getOrNull()) /** * Reset billing periods to be aligned with the plan change's effective date or start of the @@ -2038,7 +2026,7 @@ private constructor( fun billingCycleAnchorConfiguration( billingCycleAnchorConfiguration: Optional - ) = billingCycleAnchorConfiguration(billingCycleAnchorConfiguration.orElse(null)) + ) = billingCycleAnchorConfiguration(billingCycleAnchorConfiguration.getOrNull()) fun billingCycleAnchorConfiguration( billingCycleAnchorConfiguration: JsonField @@ -2056,7 +2044,7 @@ private constructor( * the `change_option` is `requested_date`. If a date with no time is passed, the plan * change will happen at midnight in the customer's timezone. */ - fun changeDate(changeDate: Optional) = changeDate(changeDate.orElse(null)) + fun changeDate(changeDate: Optional) = changeDate(changeDate.getOrNull()) /** * The date that the plan change should take effect. This parameter can only be passed if @@ -2082,7 +2070,7 @@ private constructor( * subscription creation or plan change will not be scheduled. */ fun couponRedemptionCode(couponRedemptionCode: Optional) = - couponRedemptionCode(couponRedemptionCode.orElse(null)) + couponRedemptionCode(couponRedemptionCode.getOrNull()) /** * Redemption code to be used for this subscription. If the coupon cannot be found by its @@ -2103,9 +2091,8 @@ private constructor( creditsOverageRate(creditsOverageRate as Double?) @Deprecated("deprecated") - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun creditsOverageRate(creditsOverageRate: Optional) = - creditsOverageRate(creditsOverageRate.orElse(null) as Double?) + creditsOverageRate(creditsOverageRate.getOrNull()) @Deprecated("deprecated") fun creditsOverageRate(creditsOverageRate: JsonField) = apply { @@ -2125,7 +2112,7 @@ private constructor( * provided, it is determined by the plan configuration. */ fun defaultInvoiceMemo(defaultInvoiceMemo: Optional) = - defaultInvoiceMemo(defaultInvoiceMemo.orElse(null)) + defaultInvoiceMemo(defaultInvoiceMemo.getOrNull()) /** * Determines the default memo on this subscription's invoices. Note that if this is not @@ -2146,7 +2133,7 @@ private constructor( * that either this property or `plan_id` must be specified. */ fun externalPlanId(externalPlanId: Optional) = - externalPlanId(externalPlanId.orElse(null)) + externalPlanId(externalPlanId.getOrNull()) /** * The external_plan_id of the plan that the given subscription should be switched to. Note @@ -2168,7 +2155,7 @@ private constructor( * boolean [computed property](/extensibility/advanced-metrics#computed-properties). If * null, usage queries will not include any additional filter. */ - fun filter(filter: Optional) = filter(filter.orElse(null)) + fun filter(filter: Optional) = filter(filter.getOrNull()) /** * An additional filter to apply to usage queries. This filter must be expressed as a @@ -2187,9 +2174,8 @@ private constructor( initialPhaseOrder(initialPhaseOrder as Long?) /** The phase of the plan to start with */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun initialPhaseOrder(initialPhaseOrder: Optional) = - initialPhaseOrder(initialPhaseOrder.orElse(null) as Long?) + initialPhaseOrder(initialPhaseOrder.getOrNull()) /** The phase of the plan to start with */ fun initialPhaseOrder(initialPhaseOrder: JsonField) = apply { @@ -2211,7 +2197,7 @@ private constructor( * billing period. */ fun invoicingThreshold(invoicingThreshold: Optional) = - invoicingThreshold(invoicingThreshold.orElse(null)) + invoicingThreshold(invoicingThreshold.getOrNull()) /** * When this subscription's accrued usage reaches this threshold, an invoice will be issued @@ -2241,8 +2227,7 @@ private constructor( * the invoice. If you intend the invoice to be due on issue, set this to 0. If not * provided, this defaults to the value specified in the plan. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun netTerms(netTerms: Optional) = netTerms(netTerms.orElse(null) as Long?) + fun netTerms(netTerms: Optional) = netTerms(netTerms.getOrNull()) /** * The net terms determines the difference between the invoice date and the issue date for @@ -2261,9 +2246,8 @@ private constructor( perCreditOverageAmount(perCreditOverageAmount as Double?) @Deprecated("deprecated") - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun perCreditOverageAmount(perCreditOverageAmount: Optional) = - perCreditOverageAmount(perCreditOverageAmount.orElse(null) as Double?) + perCreditOverageAmount(perCreditOverageAmount.getOrNull()) @Deprecated("deprecated") fun perCreditOverageAmount(perCreditOverageAmount: JsonField) = apply { @@ -2280,7 +2264,7 @@ private constructor( * The plan that the given subscription should be switched to. Note that either this * property or `external_plan_id` must be specified. */ - fun planId(planId: Optional) = planId(planId.orElse(null)) + fun planId(planId: Optional) = planId(planId.getOrNull()) /** * The plan that the given subscription should be switched to. Note that either this @@ -2307,9 +2291,8 @@ private constructor( * Specifies which version of the plan to change to. If null, the default version will be * used. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planVersionNumber(planVersionNumber: Optional) = - planVersionNumber(planVersionNumber.orElse(null) as Long?) + planVersionNumber(planVersionNumber.getOrNull()) /** * Specifies which version of the plan to change to. If null, the default version will be @@ -2328,7 +2311,7 @@ private constructor( /** Optionally provide a list of overrides for prices on the plan */ @Deprecated("deprecated") fun priceOverrides(priceOverrides: Optional>) = - priceOverrides(priceOverrides.orElse(null)) + priceOverrides(priceOverrides.getOrNull()) /** Optionally provide a list of overrides for prices on the plan */ @Deprecated("deprecated") @@ -2355,7 +2338,7 @@ private constructor( * have migrated off of legacy subscription overrides) */ fun removeAdjustments(removeAdjustments: Optional>) = - removeAdjustments(removeAdjustments.orElse(null)) + removeAdjustments(removeAdjustments.getOrNull()) /** * Plan adjustments to be removed from the subscription. (Only available for accounts that @@ -2386,7 +2369,7 @@ private constructor( * migrated off of legacy subscription overrides) */ fun removePrices(removePrices: Optional>) = - removePrices(removePrices.orElse(null)) + removePrices(removePrices.getOrNull()) /** * Plan prices to be removed from the subscription. (Only available for accounts that have @@ -2415,7 +2398,7 @@ private constructor( * available for accounts that have migrated off of legacy subscription overrides) */ fun replaceAdjustments(replaceAdjustments: Optional>) = - replaceAdjustments(replaceAdjustments.orElse(null)) + replaceAdjustments(replaceAdjustments.getOrNull()) /** * Plan adjustments to be replaced with additional adjustments on the subscription. (Only @@ -2446,7 +2429,7 @@ private constructor( * for accounts that have migrated off of legacy subscription overrides) */ fun replacePrices(replacePrices: Optional>) = - replacePrices(replacePrices.orElse(null)) + replacePrices(replacePrices.getOrNull()) /** * Plan prices to be replaced with additional prices on the subscription. (Only available @@ -2483,9 +2466,8 @@ private constructor( * The duration of the trial period in days. If not provided, this defaults to the value * specified in the plan. If `0` is provided, the trial on the plan will be skipped. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun trialDurationDays(trialDurationDays: Optional) = - trialDurationDays(trialDurationDays.orElse(null) as Long?) + trialDurationDays(trialDurationDays.getOrNull()) /** * The duration of the trial period in days. If not provided, this defaults to the value @@ -2514,7 +2496,7 @@ private constructor( * be either the customer for this subscription itself, or any of that customer's children. */ fun usageCustomerIds(usageCustomerIds: Optional>) = - usageCustomerIds(usageCustomerIds.orElse(null)) + usageCustomerIds(usageCustomerIds.getOrNull()) /** * A list of customer IDs whose usage events will be aggregated and billed under this @@ -2928,7 +2910,7 @@ private constructor( * The end date of the adjustment interval. This is the date that the adjustment will * stop affecting prices on the subscription. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** * The end date of the adjustment interval. This is the date that the adjustment will @@ -2944,9 +2926,8 @@ private constructor( fun planPhaseOrder(planPhaseOrder: Long) = planPhaseOrder(planPhaseOrder as Long?) /** The phase to add this adjustment to. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) /** The phase to add this adjustment to. */ fun planPhaseOrder(planPhaseOrder: JsonField) = apply { @@ -2965,7 +2946,7 @@ private constructor( * start affecting prices on the subscription. If null, the adjustment will start when * the phase or subscription starts. */ - fun startDate(startDate: Optional) = startDate(startDate.orElse(null)) + fun startDate(startDate: Optional) = startDate(startDate.getOrNull()) /** * The start date of the adjustment interval. This is the date that the adjustment will @@ -5064,7 +5045,7 @@ private constructor( /** The definition of a new allocation price to create and add to the subscription. */ fun allocationPrice(allocationPrice: Optional) = - allocationPrice(allocationPrice.orElse(null)) + allocationPrice(allocationPrice.getOrNull()) /** The definition of a new allocation price to create and add to the subscription. */ fun allocationPrice(allocationPrice: JsonField) = apply { @@ -5083,7 +5064,7 @@ private constructor( * price. */ @Deprecated("deprecated") - fun discounts(discounts: Optional>) = discounts(discounts.orElse(null)) + fun discounts(discounts: Optional>) = discounts(discounts.getOrNull()) /** * [DEPRECATED] Use add_adjustments instead. The subscription's discounts for this @@ -5116,7 +5097,7 @@ private constructor( * The end date of the price interval. This is the date that the price will stop billing * on the subscription. If null, billing will end when the phase or subscription ends. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** * The end date of the price interval. This is the date that the price will stop billing @@ -5130,7 +5111,7 @@ private constructor( /** The external price id of the price to add to the subscription. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** The external price id of the price to add to the subscription. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -5151,7 +5132,7 @@ private constructor( */ @Deprecated("deprecated") fun maximumAmount(maximumAmount: Optional) = - maximumAmount(maximumAmount.orElse(null)) + maximumAmount(maximumAmount.getOrNull()) /** * [DEPRECATED] Use add_adjustments instead. The subscription's maximum amount for this @@ -5176,7 +5157,7 @@ private constructor( */ @Deprecated("deprecated") fun minimumAmount(minimumAmount: Optional) = - minimumAmount(minimumAmount.orElse(null)) + minimumAmount(minimumAmount.getOrNull()) /** * [DEPRECATED] Use add_adjustments instead. The subscription's minimum amount for this @@ -5195,9 +5176,8 @@ private constructor( fun planPhaseOrder(planPhaseOrder: Long) = planPhaseOrder(planPhaseOrder as Long?) /** The phase to add this price to. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) /** The phase to add this price to. */ fun planPhaseOrder(planPhaseOrder: JsonField) = apply { @@ -5208,7 +5188,7 @@ private constructor( fun price(price: Price?) = price(JsonField.ofNullable(price)) /** The definition of a new price to create and add to the subscription. */ - fun price(price: Optional) = price(price.orElse(null)) + fun price(price: Optional) = price(price.getOrNull()) /** The definition of a new price to create and add to the subscription. */ fun price(price: JsonField) = apply { this.price = price } @@ -5386,7 +5366,7 @@ private constructor( fun priceId(priceId: String?) = priceId(JsonField.ofNullable(priceId)) /** The id of the price to add to the subscription. */ - fun priceId(priceId: Optional) = priceId(priceId.orElse(null)) + fun priceId(priceId: Optional) = priceId(priceId.getOrNull()) /** The id of the price to add to the subscription. */ fun priceId(priceId: JsonField) = apply { this.priceId = priceId } @@ -5403,7 +5383,7 @@ private constructor( * billing on the subscription. If null, billing will start when the phase or * subscription starts. */ - fun startDate(startDate: Optional) = startDate(startDate.orElse(null)) + fun startDate(startDate: Optional) = startDate(startDate.getOrNull()) /** * The start date of the price interval. This is the date that the price will start @@ -5912,7 +5892,7 @@ private constructor( /** Only available if discount_type is `amount`. */ fun amountDiscount(amountDiscount: Optional) = - amountDiscount(amountDiscount.orElse(null)) + amountDiscount(amountDiscount.getOrNull()) /** Only available if discount_type is `amount`. */ fun amountDiscount(amountDiscount: JsonField) = apply { @@ -5937,9 +5917,8 @@ private constructor( * Only available if discount_type is `percentage`. This is a number between 0 * and 1. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun percentageDiscount(percentageDiscount: Optional) = - percentageDiscount(percentageDiscount.orElse(null) as Double?) + percentageDiscount(percentageDiscount.getOrNull()) /** * Only available if discount_type is `percentage`. This is a number between 0 @@ -5966,9 +5945,8 @@ private constructor( * Only available if discount_type is `usage`. Number of usage units that this * discount is for */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun usageDiscount(usageDiscount: Optional) = - usageDiscount(usageDiscount.orElse(null) as Double?) + usageDiscount(usageDiscount.getOrNull()) /** * Only available if discount_type is `usage`. Number of usage units that this @@ -7814,7 +7792,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -7842,9 +7820,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -7868,7 +7845,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -7893,9 +7870,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -7914,7 +7890,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -7928,7 +7904,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -7953,9 +7929,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -7971,7 +7946,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -7995,7 +7970,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -8017,7 +7992,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -8038,7 +8013,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -9449,7 +9424,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -9477,9 +9452,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -9503,7 +9477,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -9528,9 +9502,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -9549,7 +9522,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -9563,7 +9536,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -9588,9 +9561,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -9606,7 +9578,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -9630,7 +9602,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -9652,7 +9624,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -9673,7 +9645,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -11122,7 +11094,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -11150,9 +11122,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -11176,7 +11147,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -11201,9 +11172,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -11222,7 +11192,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -11236,7 +11206,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -11261,9 +11231,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -11279,7 +11248,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -11303,7 +11272,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -11325,7 +11294,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -11346,7 +11315,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -13018,7 +12987,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -13046,9 +13015,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -13072,7 +13040,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -13097,9 +13065,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -13118,7 +13085,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -13132,7 +13099,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -13157,9 +13124,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -13175,7 +13141,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -13199,7 +13165,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -13221,7 +13187,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -13242,7 +13208,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -13772,11 +13738,8 @@ private constructor( * Exclusive tier ending value. If null, this is treated as the last * tier */ - @Suppress( - "USELESS_CAST" - ) // See https://youtrack.jetbrains.com/issue/KT-74228 fun lastUnit(lastUnit: Optional) = - lastUnit(lastUnit.orElse(null) as Double?) + lastUnit(lastUnit.getOrNull()) /** * Exclusive tier ending value. If null, this is treated as the last @@ -14863,7 +14826,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -14891,9 +14854,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -14917,7 +14879,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -14942,9 +14904,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -14963,7 +14924,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -14977,7 +14938,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -15002,9 +14963,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -15020,7 +14980,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -15044,7 +15004,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -15066,7 +15026,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -15087,7 +15047,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -15624,7 +15584,7 @@ private constructor( /** Exclusive tier ending value */ fun maximumAmount(maximumAmount: Optional) = - maximumAmount(maximumAmount.orElse(null)) + maximumAmount(maximumAmount.getOrNull()) /** Exclusive tier ending value */ fun maximumAmount(maximumAmount: JsonField) = apply { @@ -15637,7 +15597,7 @@ private constructor( /** Per unit maximum to charge */ fun perUnitMaximum(perUnitMaximum: Optional) = - perUnitMaximum(perUnitMaximum.orElse(null)) + perUnitMaximum(perUnitMaximum.getOrNull()) /** Per unit maximum to charge */ fun perUnitMaximum(perUnitMaximum: JsonField) = apply { @@ -16718,7 +16678,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -16746,9 +16706,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -16772,7 +16731,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -16797,9 +16756,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -16818,7 +16776,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -16832,7 +16790,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -16857,9 +16815,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -16875,7 +16832,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -16899,7 +16856,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -16921,7 +16878,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -16942,7 +16899,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -17083,7 +17040,7 @@ private constructor( /** Optional currency amount maximum to cap spend per event */ fun perUnitMaximum(perUnitMaximum: Optional) = - perUnitMaximum(perUnitMaximum.orElse(null)) + perUnitMaximum(perUnitMaximum.getOrNull()) /** Optional currency amount maximum to cap spend per event */ fun perUnitMaximum(perUnitMaximum: JsonField) = apply { @@ -18378,7 +18335,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -18406,9 +18363,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -18432,7 +18388,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -18457,9 +18413,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -18478,7 +18433,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -18492,7 +18447,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -18517,9 +18472,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -18535,7 +18489,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -18559,7 +18513,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -18581,7 +18535,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -18602,7 +18556,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -18882,7 +18836,7 @@ private constructor( /** Upper bound for tier */ fun maximumAmount(maximumAmount: Optional) = - maximumAmount(maximumAmount.orElse(null)) + maximumAmount(maximumAmount.getOrNull()) /** Upper bound for tier */ fun maximumAmount(maximumAmount: JsonField) = apply { @@ -18895,7 +18849,7 @@ private constructor( /** The maximum amount to charge for any one event */ fun perUnitMaximum(perUnitMaximum: Optional) = - perUnitMaximum(perUnitMaximum.orElse(null)) + perUnitMaximum(perUnitMaximum.getOrNull()) /** The maximum amount to charge for any one event */ fun perUnitMaximum(perUnitMaximum: JsonField) = apply { @@ -20207,7 +20161,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -20235,9 +20189,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -20261,7 +20214,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -20286,9 +20239,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -20307,7 +20259,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -20321,7 +20273,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -20346,9 +20298,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -20364,7 +20315,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -20388,7 +20339,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -20410,7 +20361,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -20431,7 +20382,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -20688,11 +20639,8 @@ private constructor( maximumUnits(maximumUnits as Double?) /** Upper bound for this tier */ - @Suppress( - "USELESS_CAST" - ) // See https://youtrack.jetbrains.com/issue/KT-74228 fun maximumUnits(maximumUnits: Optional) = - maximumUnits(maximumUnits.orElse(null) as Double?) + maximumUnits(maximumUnits.getOrNull()) /** Upper bound for this tier */ fun maximumUnits(maximumUnits: JsonField) = apply { @@ -22016,7 +21964,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -22044,9 +21992,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -22070,7 +22017,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -22095,9 +22042,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -22116,7 +22062,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -22130,7 +22076,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -22155,9 +22101,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -22173,7 +22118,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -22197,7 +22142,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -22219,7 +22164,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -22240,7 +22185,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -23627,7 +23572,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -23655,9 +23600,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -23681,7 +23625,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -23706,9 +23650,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -23727,7 +23670,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -23741,7 +23684,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -23766,9 +23709,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -23784,7 +23726,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -23808,7 +23750,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -23830,7 +23772,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -23851,7 +23793,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -25242,7 +25184,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -25270,9 +25212,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -25296,7 +25237,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -25321,9 +25262,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -25342,7 +25282,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -25356,7 +25296,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -25381,9 +25321,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -25399,7 +25338,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -25423,7 +25362,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -25445,7 +25384,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -25466,7 +25405,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -26855,7 +26794,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -26883,9 +26822,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -26909,7 +26847,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -26934,9 +26872,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -26955,7 +26892,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -26969,7 +26906,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -26994,9 +26931,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -27012,7 +26948,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -27036,7 +26972,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -27058,7 +26994,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -27079,7 +27015,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -28475,7 +28411,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -28503,9 +28439,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -28529,7 +28464,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -28554,9 +28489,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -28575,7 +28509,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -28589,7 +28523,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -28614,9 +28548,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -28632,7 +28565,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -28656,7 +28589,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -28678,7 +28611,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -28699,7 +28632,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -30097,7 +30030,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -30125,9 +30058,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -30151,7 +30083,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -30176,9 +30108,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -30197,7 +30128,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -30211,7 +30142,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -30236,9 +30167,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -30254,7 +30184,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -30278,7 +30208,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -30300,7 +30230,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -30321,7 +30251,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -31713,7 +31643,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -31741,9 +31671,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -31767,7 +31696,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -31792,9 +31721,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -31813,7 +31741,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -31827,7 +31755,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -31852,9 +31780,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -31870,7 +31797,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -31894,7 +31821,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -31916,7 +31843,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -31937,7 +31864,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -33329,7 +33256,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -33357,9 +33284,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -33383,7 +33309,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -33408,9 +33334,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -33429,7 +33354,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -33443,7 +33368,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -33468,9 +33393,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -33486,7 +33410,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -33510,7 +33434,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -33532,7 +33456,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -33553,7 +33477,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -34964,7 +34888,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -34992,9 +34916,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -35018,7 +34941,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -35043,9 +34966,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -35064,7 +34986,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -35078,7 +35000,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -35103,9 +35025,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -35121,7 +35042,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -35145,7 +35066,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -35167,7 +35088,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -35188,7 +35109,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -36585,7 +36506,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -36613,9 +36534,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -36639,7 +36559,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -36664,9 +36584,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -36685,7 +36604,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -36699,7 +36618,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -36724,9 +36643,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -36742,7 +36660,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -36766,7 +36684,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -36788,7 +36706,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -36809,7 +36727,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -38223,7 +38141,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -38251,9 +38169,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -38277,7 +38194,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -38302,9 +38219,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -38323,7 +38239,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -38337,7 +38253,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -38362,9 +38278,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -38380,7 +38295,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -38404,7 +38319,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -38426,7 +38341,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -38447,7 +38362,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -39871,7 +39786,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -39899,9 +39814,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -39925,7 +39839,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -39950,9 +39864,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -39971,7 +39884,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -39985,7 +39898,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -40010,9 +39923,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -40028,7 +39940,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -40052,7 +39964,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -40074,7 +39986,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -40095,7 +40007,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -41504,7 +41416,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -41532,9 +41444,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -41558,7 +41469,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -41583,9 +41494,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -41604,7 +41514,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -41618,7 +41528,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -41643,9 +41553,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -41661,7 +41570,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -41685,7 +41594,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -41707,7 +41616,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -41728,7 +41637,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -43129,7 +43038,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -43157,9 +43066,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -43183,7 +43091,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -43208,9 +43116,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -43229,7 +43136,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -43243,7 +43150,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -43268,9 +43175,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -43286,7 +43192,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -43310,7 +43216,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -43332,7 +43238,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -43353,7 +43259,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -44767,7 +44673,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -44795,9 +44701,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -44821,7 +44726,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -44846,9 +44751,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -44867,7 +44771,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -44881,7 +44785,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -44906,9 +44810,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -44924,7 +44827,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -44948,7 +44851,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -44970,7 +44873,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -44991,7 +44894,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -46393,7 +46296,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -46421,9 +46324,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -46447,7 +46349,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -46472,9 +46374,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -46493,7 +46394,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -46507,7 +46408,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -46532,9 +46433,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -46550,7 +46450,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -46574,7 +46474,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -46596,7 +46496,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -46617,7 +46517,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -48016,7 +47916,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -48044,9 +47944,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -48070,7 +47969,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -48095,9 +47994,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -48116,7 +48014,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -48130,7 +48028,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -48155,9 +48053,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -48173,7 +48070,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -48197,7 +48094,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -48219,7 +48116,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -48240,7 +48137,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -49505,8 +49402,7 @@ private constructor( * The month on which the billing cycle is anchored (e.g. a quarterly price anchored in * February would have cycles starting February, May, August, and November). */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun month(month: Optional) = month(month.orElse(null) as Long?) + fun month(month: Optional) = month(month.getOrNull()) /** * The month on which the billing cycle is anchored (e.g. a quarterly price anchored in @@ -49530,8 +49426,7 @@ private constructor( * The year on which the billing cycle is anchored (e.g. a 2 year billing cycle anchored * on 2021 would have cycles starting on 2021, 2023, 2025, etc.). */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun year(year: Optional) = year(year.orElse(null) as Long?) + fun year(year: Optional) = year(year.getOrNull()) /** * The year on which the billing cycle is anchored (e.g. a 2 year billing cycle anchored @@ -49771,7 +49666,7 @@ private constructor( /** The external price id of the price to remove on the subscription. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** The external price id of the price to remove on the subscription. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -49782,7 +49677,7 @@ private constructor( fun priceId(priceId: String?) = priceId(JsonField.ofNullable(priceId)) /** The id of the price to remove on the subscription. */ - fun priceId(priceId: Optional) = priceId(priceId.orElse(null)) + fun priceId(priceId: Optional) = priceId(priceId.getOrNull()) /** The id of the price to remove on the subscription. */ fun priceId(priceId: JsonField) = apply { this.priceId = priceId } @@ -52018,7 +51913,7 @@ private constructor( /** The definition of a new allocation price to create and add to the subscription. */ fun allocationPrice(allocationPrice: Optional) = - allocationPrice(allocationPrice.orElse(null)) + allocationPrice(allocationPrice.getOrNull()) /** The definition of a new allocation price to create and add to the subscription. */ fun allocationPrice(allocationPrice: JsonField) = apply { @@ -52037,7 +51932,7 @@ private constructor( * replacement price. */ @Deprecated("deprecated") - fun discounts(discounts: Optional>) = discounts(discounts.orElse(null)) + fun discounts(discounts: Optional>) = discounts(discounts.getOrNull()) /** * [DEPRECATED] Use add_adjustments instead. The subscription's discounts for the @@ -52066,7 +51961,7 @@ private constructor( /** The external price id of the price to add to the subscription. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** The external price id of the price to add to the subscription. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -52082,9 +51977,8 @@ private constructor( fixedPriceQuantity(fixedPriceQuantity as Double?) /** The new quantity of the price, if the price is a fixed price. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** The new quantity of the price, if the price is a fixed price. */ fun fixedPriceQuantity(fixedPriceQuantity: JsonField) = apply { @@ -52105,7 +51999,7 @@ private constructor( */ @Deprecated("deprecated") fun maximumAmount(maximumAmount: Optional) = - maximumAmount(maximumAmount.orElse(null)) + maximumAmount(maximumAmount.getOrNull()) /** * [DEPRECATED] Use add_adjustments instead. The subscription's maximum amount for the @@ -52130,7 +52024,7 @@ private constructor( */ @Deprecated("deprecated") fun minimumAmount(minimumAmount: Optional) = - minimumAmount(minimumAmount.orElse(null)) + minimumAmount(minimumAmount.getOrNull()) /** * [DEPRECATED] Use add_adjustments instead. The subscription's minimum amount for the @@ -52145,7 +52039,7 @@ private constructor( fun price(price: Price?) = price(JsonField.ofNullable(price)) /** The definition of a new price to create and add to the subscription. */ - fun price(price: Optional) = price(price.orElse(null)) + fun price(price: Optional) = price(price.getOrNull()) /** The definition of a new price to create and add to the subscription. */ fun price(price: JsonField) = apply { this.price = price } @@ -52323,7 +52217,7 @@ private constructor( fun priceId(priceId: String?) = priceId(JsonField.ofNullable(priceId)) /** The id of the price to add to the subscription. */ - fun priceId(priceId: Optional) = priceId(priceId.orElse(null)) + fun priceId(priceId: Optional) = priceId(priceId.getOrNull()) /** The id of the price to add to the subscription. */ fun priceId(priceId: JsonField) = apply { this.priceId = priceId } @@ -52825,7 +52719,7 @@ private constructor( /** Only available if discount_type is `amount`. */ fun amountDiscount(amountDiscount: Optional) = - amountDiscount(amountDiscount.orElse(null)) + amountDiscount(amountDiscount.getOrNull()) /** Only available if discount_type is `amount`. */ fun amountDiscount(amountDiscount: JsonField) = apply { @@ -52850,9 +52744,8 @@ private constructor( * Only available if discount_type is `percentage`. This is a number between 0 * and 1. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun percentageDiscount(percentageDiscount: Optional) = - percentageDiscount(percentageDiscount.orElse(null) as Double?) + percentageDiscount(percentageDiscount.getOrNull()) /** * Only available if discount_type is `percentage`. This is a number between 0 @@ -52879,9 +52772,8 @@ private constructor( * Only available if discount_type is `usage`. Number of usage units that this * discount is for */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun usageDiscount(usageDiscount: Optional) = - usageDiscount(usageDiscount.orElse(null) as Double?) + usageDiscount(usageDiscount.getOrNull()) /** * Only available if discount_type is `usage`. Number of usage units that this @@ -54727,7 +54619,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -54755,9 +54647,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -54781,7 +54672,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -54806,9 +54697,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -54827,7 +54717,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -54841,7 +54731,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -54866,9 +54756,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -54884,7 +54773,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -54908,7 +54797,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -54930,7 +54819,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -54951,7 +54840,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -56362,7 +56251,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -56390,9 +56279,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -56416,7 +56304,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -56441,9 +56329,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -56462,7 +56349,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -56476,7 +56363,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -56501,9 +56388,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -56519,7 +56405,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -56543,7 +56429,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -56565,7 +56451,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -56586,7 +56472,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -58035,7 +57921,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -58063,9 +57949,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -58089,7 +57974,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -58114,9 +57999,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -58135,7 +58019,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -58149,7 +58033,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -58174,9 +58058,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -58192,7 +58075,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -58216,7 +58099,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -58238,7 +58121,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -58259,7 +58142,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -59931,7 +59814,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -59959,9 +59842,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -59985,7 +59867,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -60010,9 +59892,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -60031,7 +59912,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -60045,7 +59926,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -60070,9 +59951,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -60088,7 +59968,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -60112,7 +59992,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -60134,7 +60014,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -60155,7 +60035,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -60685,11 +60565,8 @@ private constructor( * Exclusive tier ending value. If null, this is treated as the last * tier */ - @Suppress( - "USELESS_CAST" - ) // See https://youtrack.jetbrains.com/issue/KT-74228 fun lastUnit(lastUnit: Optional) = - lastUnit(lastUnit.orElse(null) as Double?) + lastUnit(lastUnit.getOrNull()) /** * Exclusive tier ending value. If null, this is treated as the last @@ -61776,7 +61653,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -61804,9 +61681,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -61830,7 +61706,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -61855,9 +61731,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -61876,7 +61751,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -61890,7 +61765,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -61915,9 +61790,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -61933,7 +61807,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -61957,7 +61831,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -61979,7 +61853,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -62000,7 +61874,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -62537,7 +62411,7 @@ private constructor( /** Exclusive tier ending value */ fun maximumAmount(maximumAmount: Optional) = - maximumAmount(maximumAmount.orElse(null)) + maximumAmount(maximumAmount.getOrNull()) /** Exclusive tier ending value */ fun maximumAmount(maximumAmount: JsonField) = apply { @@ -62550,7 +62424,7 @@ private constructor( /** Per unit maximum to charge */ fun perUnitMaximum(perUnitMaximum: Optional) = - perUnitMaximum(perUnitMaximum.orElse(null)) + perUnitMaximum(perUnitMaximum.getOrNull()) /** Per unit maximum to charge */ fun perUnitMaximum(perUnitMaximum: JsonField) = apply { @@ -63631,7 +63505,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -63659,9 +63533,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -63685,7 +63558,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -63710,9 +63583,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -63731,7 +63603,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -63745,7 +63617,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -63770,9 +63642,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -63788,7 +63659,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -63812,7 +63683,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -63834,7 +63705,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -63855,7 +63726,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -63996,7 +63867,7 @@ private constructor( /** Optional currency amount maximum to cap spend per event */ fun perUnitMaximum(perUnitMaximum: Optional) = - perUnitMaximum(perUnitMaximum.orElse(null)) + perUnitMaximum(perUnitMaximum.getOrNull()) /** Optional currency amount maximum to cap spend per event */ fun perUnitMaximum(perUnitMaximum: JsonField) = apply { @@ -65291,7 +65162,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -65319,9 +65190,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -65345,7 +65215,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -65370,9 +65240,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -65391,7 +65260,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -65405,7 +65274,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -65430,9 +65299,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -65448,7 +65316,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -65472,7 +65340,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -65494,7 +65362,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -65515,7 +65383,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -65795,7 +65663,7 @@ private constructor( /** Upper bound for tier */ fun maximumAmount(maximumAmount: Optional) = - maximumAmount(maximumAmount.orElse(null)) + maximumAmount(maximumAmount.getOrNull()) /** Upper bound for tier */ fun maximumAmount(maximumAmount: JsonField) = apply { @@ -65808,7 +65676,7 @@ private constructor( /** The maximum amount to charge for any one event */ fun perUnitMaximum(perUnitMaximum: Optional) = - perUnitMaximum(perUnitMaximum.orElse(null)) + perUnitMaximum(perUnitMaximum.getOrNull()) /** The maximum amount to charge for any one event */ fun perUnitMaximum(perUnitMaximum: JsonField) = apply { @@ -67120,7 +66988,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -67148,9 +67016,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -67174,7 +67041,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -67199,9 +67066,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -67220,7 +67086,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -67234,7 +67100,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -67259,9 +67125,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -67277,7 +67142,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -67301,7 +67166,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -67323,7 +67188,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -67344,7 +67209,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -67601,11 +67466,8 @@ private constructor( maximumUnits(maximumUnits as Double?) /** Upper bound for this tier */ - @Suppress( - "USELESS_CAST" - ) // See https://youtrack.jetbrains.com/issue/KT-74228 fun maximumUnits(maximumUnits: Optional) = - maximumUnits(maximumUnits.orElse(null) as Double?) + maximumUnits(maximumUnits.getOrNull()) /** Upper bound for this tier */ fun maximumUnits(maximumUnits: JsonField) = apply { @@ -68929,7 +68791,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -68957,9 +68819,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -68983,7 +68844,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -69008,9 +68869,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -69029,7 +68889,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -69043,7 +68903,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -69068,9 +68928,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -69086,7 +68945,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -69110,7 +68969,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -69132,7 +68991,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -69153,7 +69012,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -70540,7 +70399,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -70568,9 +70427,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -70594,7 +70452,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -70619,9 +70477,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -70640,7 +70497,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -70654,7 +70511,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -70679,9 +70536,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -70697,7 +70553,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -70721,7 +70577,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -70743,7 +70599,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -70764,7 +70620,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -72155,7 +72011,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -72183,9 +72039,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -72209,7 +72064,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -72234,9 +72089,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -72255,7 +72109,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -72269,7 +72123,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -72294,9 +72148,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -72312,7 +72165,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -72336,7 +72189,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -72358,7 +72211,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -72379,7 +72232,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -73768,7 +73621,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -73796,9 +73649,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -73822,7 +73674,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -73847,9 +73699,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -73868,7 +73719,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -73882,7 +73733,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -73907,9 +73758,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -73925,7 +73775,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -73949,7 +73799,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -73971,7 +73821,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -73992,7 +73842,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -75388,7 +75238,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -75416,9 +75266,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -75442,7 +75291,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -75467,9 +75316,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -75488,7 +75336,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -75502,7 +75350,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -75527,9 +75375,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -75545,7 +75392,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -75569,7 +75416,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -75591,7 +75438,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -75612,7 +75459,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -77010,7 +76857,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -77038,9 +76885,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -77064,7 +76910,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -77089,9 +76935,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -77110,7 +76955,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -77124,7 +76969,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -77149,9 +76994,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -77167,7 +77011,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -77191,7 +77035,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -77213,7 +77057,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -77234,7 +77078,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -78626,7 +78470,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -78654,9 +78498,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -78680,7 +78523,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -78705,9 +78548,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -78726,7 +78568,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -78740,7 +78582,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -78765,9 +78607,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -78783,7 +78624,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -78807,7 +78648,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -78829,7 +78670,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -78850,7 +78691,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -80242,7 +80083,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -80270,9 +80111,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -80296,7 +80136,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -80321,9 +80161,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -80342,7 +80181,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -80356,7 +80195,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -80381,9 +80220,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -80399,7 +80237,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -80423,7 +80261,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -80445,7 +80283,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -80466,7 +80304,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -81877,7 +81715,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -81905,9 +81743,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -81931,7 +81768,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -81956,9 +81793,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -81977,7 +81813,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -81991,7 +81827,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -82016,9 +81852,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -82034,7 +81869,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -82058,7 +81893,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -82080,7 +81915,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -82101,7 +81936,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -83498,7 +83333,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -83526,9 +83361,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -83552,7 +83386,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -83577,9 +83411,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -83598,7 +83431,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -83612,7 +83445,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -83637,9 +83470,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -83655,7 +83487,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -83679,7 +83511,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -83701,7 +83533,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -83722,7 +83554,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -85136,7 +84968,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -85164,9 +84996,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -85190,7 +85021,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -85215,9 +85046,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -85236,7 +85066,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -85250,7 +85080,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -85275,9 +85105,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -85293,7 +85122,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -85317,7 +85146,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -85339,7 +85168,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -85360,7 +85189,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -86784,7 +86613,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -86812,9 +86641,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -86838,7 +86666,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -86863,9 +86691,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -86884,7 +86711,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -86898,7 +86725,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -86923,9 +86750,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -86941,7 +86767,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -86965,7 +86791,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -86987,7 +86813,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -87008,7 +86834,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -88417,7 +88243,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -88445,9 +88271,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -88471,7 +88296,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -88496,9 +88321,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -88517,7 +88341,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -88531,7 +88355,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -88556,9 +88380,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -88574,7 +88397,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -88598,7 +88421,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -88620,7 +88443,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -88641,7 +88464,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -90042,7 +89865,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -90070,9 +89893,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -90096,7 +89918,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -90121,9 +89943,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -90142,7 +89963,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -90156,7 +89977,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -90181,9 +90002,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -90199,7 +90019,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -90223,7 +90043,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -90245,7 +90065,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -90266,7 +90086,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -91680,7 +91500,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -91708,9 +91528,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -91734,7 +91553,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -91759,9 +91578,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -91780,7 +91598,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -91794,7 +91612,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -91819,9 +91637,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -91837,7 +91654,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -91861,7 +91678,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -91883,7 +91700,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -91904,7 +91721,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -93306,7 +93123,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -93334,9 +93151,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -93360,7 +93176,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -93385,9 +93201,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -93406,7 +93221,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -93420,7 +93235,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -93445,9 +93260,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -93463,7 +93277,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -93487,7 +93301,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -93509,7 +93323,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -93530,7 +93344,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding @@ -94929,7 +94743,7 @@ private constructor( * usage-based. */ fun billableMetricId(billableMetricId: Optional) = - billableMetricId(billableMetricId.orElse(null)) + billableMetricId(billableMetricId.getOrNull()) /** * The id of the billable metric for the price. Only needed if the price is @@ -94957,9 +94771,8 @@ private constructor( * 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. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun billedInAdvance(billedInAdvance: Optional) = - billedInAdvance(billedInAdvance.orElse(null) as Boolean?) + billedInAdvance(billedInAdvance.getOrNull()) /** * If the Price represents a fixed cost, the price will be billed in-advance if @@ -94983,7 +94796,7 @@ private constructor( */ fun billingCycleConfiguration( billingCycleConfiguration: Optional - ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null)) + ) = billingCycleConfiguration(billingCycleConfiguration.getOrNull()) /** * For custom cadence: specifies the duration of the billing period in days or @@ -95008,9 +94821,8 @@ private constructor( /** * The per unit conversion rate of the price currency to the invoicing currency. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) + conversionRate(conversionRate.getOrNull()) /** * The per unit conversion rate of the price currency to the invoicing currency. @@ -95029,7 +94841,7 @@ private constructor( * An ISO 4217 currency string, or custom pricing unit identifier, in which this * price is billed. */ - fun currency(currency: Optional) = currency(currency.orElse(null)) + fun currency(currency: Optional) = currency(currency.getOrNull()) /** * An ISO 4217 currency string, or custom pricing unit identifier, in which this @@ -95043,7 +94855,7 @@ private constructor( /** An alias for the price. */ fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) + externalPriceId(externalPriceId.getOrNull()) /** An alias for the price. */ fun externalPriceId(externalPriceId: JsonField) = apply { @@ -95068,9 +94880,8 @@ private constructor( * If the Price represents a fixed cost, this represents the quantity of units * applied. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) + fixedPriceQuantity(fixedPriceQuantity.getOrNull()) /** * If the Price represents a fixed cost, this represents the quantity of units @@ -95086,7 +94897,7 @@ private constructor( /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: Optional) = - invoiceGroupingKey(invoiceGroupingKey.orElse(null)) + invoiceGroupingKey(invoiceGroupingKey.getOrNull()) /** The property used to group this price on an invoice */ fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply { @@ -95110,7 +94921,7 @@ private constructor( */ fun invoicingCycleConfiguration( invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) + ) = invoicingCycleConfiguration(invoicingCycleConfiguration.getOrNull()) /** * Within each billing cycle, specifies the cadence at which invoices are @@ -95132,7 +94943,7 @@ private constructor( * removed by setting the value to `null`, and the entire metadata mapping can * be cleared by setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be @@ -95153,7 +94964,7 @@ private constructor( * adjustments in the same API call. */ fun referenceId(referenceId: Optional) = - referenceId(referenceId.orElse(null)) + referenceId(referenceId.getOrNull()) /** * A transient ID that can be used to reference this price when adding diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionSchedulePlanChangeResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionSchedulePlanChangeResponse.kt index 387ec142..aa07624f 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionSchedulePlanChangeResponse.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionSchedulePlanChangeResponse.kt @@ -571,9 +571,8 @@ private constructor( activePlanPhaseOrder(activePlanPhaseOrder as Long?) /** The current plan phase that is active, only if the subscription's plan has phases. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun activePlanPhaseOrder(activePlanPhaseOrder: Optional) = - activePlanPhaseOrder(activePlanPhaseOrder.orElse(null) as Long?) + activePlanPhaseOrder(activePlanPhaseOrder.getOrNull()) /** The current plan phase that is active, only if the subscription's plan has phases. */ fun activePlanPhaseOrder(activePlanPhaseOrder: JsonField) = apply { @@ -626,9 +625,8 @@ private constructor( * with the saved payment method on the due date. This property defaults to the plan's * behavior. If null, defaults to the customer's setting. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun autoCollection(autoCollection: Optional) = - autoCollection(autoCollection.orElse(null) as Boolean?) + autoCollection(autoCollection.getOrNull()) /** * Determines whether issued invoices for this subscription will automatically be charged @@ -683,7 +681,7 @@ private constructor( * are not currently active. */ fun currentBillingPeriodEndDate(currentBillingPeriodEndDate: Optional) = - currentBillingPeriodEndDate(currentBillingPeriodEndDate.orElse(null)) + currentBillingPeriodEndDate(currentBillingPeriodEndDate.getOrNull()) /** * The end of the current billing period. This is an exclusive timestamp, such that the @@ -709,7 +707,7 @@ private constructor( * is not currently active. */ fun currentBillingPeriodStartDate(currentBillingPeriodStartDate: Optional) = - currentBillingPeriodStartDate(currentBillingPeriodStartDate.orElse(null)) + currentBillingPeriodStartDate(currentBillingPeriodStartDate.getOrNull()) /** * The start date of the current billing period. This is an inclusive timestamp; the instant @@ -772,7 +770,7 @@ private constructor( * provided, it is determined by the plan configuration. */ fun defaultInvoiceMemo(defaultInvoiceMemo: Optional) = - defaultInvoiceMemo(defaultInvoiceMemo.orElse(null)) + defaultInvoiceMemo(defaultInvoiceMemo.getOrNull()) /** * Determines the default memo on this subscriptions' invoices. Note that if this is not @@ -815,7 +813,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The date Orb stops billing for this subscription. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The date Orb stops billing for this subscription. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -841,7 +839,7 @@ private constructor( invoicingThreshold(JsonField.ofNullable(invoicingThreshold)) fun invoicingThreshold(invoicingThreshold: Optional) = - invoicingThreshold(invoicingThreshold.orElse(null)) + invoicingThreshold(invoicingThreshold.getOrNull()) fun invoicingThreshold(invoicingThreshold: JsonField) = apply { this.invoicingThreshold = invoicingThreshold @@ -944,7 +942,7 @@ private constructor( redeemedCoupon(JsonField.ofNullable(redeemedCoupon)) fun redeemedCoupon(redeemedCoupon: Optional) = - redeemedCoupon(redeemedCoupon.orElse(null)) + redeemedCoupon(redeemedCoupon.getOrNull()) fun redeemedCoupon(redeemedCoupon: JsonField) = apply { this.redeemedCoupon = redeemedCoupon @@ -1181,7 +1179,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The end date of the adjustment interval. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The end date of the adjustment interval. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -1730,9 +1728,8 @@ private constructor( planPhaseOrder(planPhaseOrder as Long?) /** The plan phase in which this adjustment is active. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) /** The plan phase in which this adjustment is active. */ fun planPhaseOrder(planPhaseOrder: JsonField) = apply { @@ -1743,7 +1740,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -2151,9 +2148,8 @@ private constructor( planPhaseOrder(planPhaseOrder as Long?) /** The plan phase in which this adjustment is active. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) /** The plan phase in which this adjustment is active. */ fun planPhaseOrder(planPhaseOrder: JsonField) = apply { @@ -2164,7 +2160,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -2560,9 +2556,8 @@ private constructor( planPhaseOrder(planPhaseOrder as Long?) /** The plan phase in which this adjustment is active. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) /** The plan phase in which this adjustment is active. */ fun planPhaseOrder(planPhaseOrder: JsonField) = apply { @@ -2573,7 +2568,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -2984,9 +2979,8 @@ private constructor( planPhaseOrder(planPhaseOrder as Long?) /** The plan phase in which this adjustment is active. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) /** The plan phase in which this adjustment is active. */ fun planPhaseOrder(planPhaseOrder: JsonField) = apply { @@ -2997,7 +2991,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -3390,9 +3384,8 @@ private constructor( planPhaseOrder(planPhaseOrder as Long?) /** The plan phase in which this adjustment is active. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) /** The plan phase in which this adjustment is active. */ fun planPhaseOrder(planPhaseOrder: JsonField) = apply { @@ -3403,7 +3396,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -3720,8 +3713,7 @@ private constructor( * The month on which the billing cycle is anchored (e.g. a quarterly price anchored in * February would have cycles starting February, May, August, and November). */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun month(month: Optional) = month(month.orElse(null) as Long?) + fun month(month: Optional) = month(month.getOrNull()) /** * The month on which the billing cycle is anchored (e.g. a quarterly price anchored in @@ -3745,8 +3737,7 @@ private constructor( * The year on which the billing cycle is anchored (e.g. a 2 year billing cycle anchored * on 2021 would have cycles starting on 2021, 2023, 2025, etc.). */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun year(year: Optional) = year(year.orElse(null) as Long?) + fun year(year: Optional) = year(year.getOrNull()) /** * The year on which the billing cycle is anchored (e.g. a 2 year billing cycle anchored @@ -4175,7 +4166,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The end date of the discount interval. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The end date of the discount interval. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -4535,7 +4526,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The end date of the discount interval. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The end date of the discount interval. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -4911,7 +4902,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The end date of the discount interval. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The end date of the discount interval. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -5193,7 +5184,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -5429,7 +5420,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The end date of the maximum interval. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The end date of the maximum interval. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -5761,7 +5752,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The end date of the minimum interval. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The end date of the minimum interval. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -6134,7 +6125,7 @@ private constructor( * interval is not currently active. */ fun currentBillingPeriodEndDate(currentBillingPeriodEndDate: Optional) = - currentBillingPeriodEndDate(currentBillingPeriodEndDate.orElse(null)) + currentBillingPeriodEndDate(currentBillingPeriodEndDate.getOrNull()) /** * The end of the current billing period. This is an exclusive timestamp, such that the @@ -6160,7 +6151,7 @@ private constructor( */ fun currentBillingPeriodStartDate( currentBillingPeriodStartDate: Optional - ) = currentBillingPeriodStartDate(currentBillingPeriodStartDate.orElse(null)) + ) = currentBillingPeriodStartDate(currentBillingPeriodStartDate.getOrNull()) /** * The start date of the current billing period. This is an inclusive timestamp; the @@ -6181,7 +6172,7 @@ private constructor( * The end date of the price interval. This is the date that Orb stops billing for this * price. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** * The end date of the price interval. This is the date that Orb stops billing for this @@ -6193,7 +6184,7 @@ private constructor( fun filter(filter: String?) = filter(JsonField.ofNullable(filter)) /** An additional filter to apply to usage queries. */ - fun filter(filter: Optional) = filter(filter.orElse(null)) + fun filter(filter: Optional) = filter(filter.getOrNull()) /** An additional filter to apply to usage queries. */ fun filter(filter: JsonField) = apply { this.filter = filter } @@ -6212,7 +6203,7 @@ private constructor( */ fun fixedFeeQuantityTransitions( fixedFeeQuantityTransitions: Optional> - ) = fixedFeeQuantityTransitions(fixedFeeQuantityTransitions.orElse(null)) + ) = fixedFeeQuantityTransitions(fixedFeeQuantityTransitions.getOrNull()) /** * The fixed fee quantity transitions for this price interval. This is only relevant for @@ -6705,7 +6696,7 @@ private constructor( * price interval. */ fun usageCustomerIds(usageCustomerIds: Optional>) = - usageCustomerIds(usageCustomerIds.orElse(null)) + usageCustomerIds(usageCustomerIds.getOrNull()) /** * A list of customer IDs whose usage events will be aggregated and billed under this @@ -7018,7 +7009,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -7239,7 +7230,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) fun endDate(endDate: JsonField) = apply { this.endDate = endDate } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionTriggerPhaseParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionTriggerPhaseParams.kt index 476d9af4..f0de5d56 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionTriggerPhaseParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionTriggerPhaseParams.kt @@ -20,6 +20,7 @@ import com.withorb.api.core.toImmutable import java.time.LocalDate import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull /** Manually trigger a phase, effective the given date (or the current time, if not specified). */ class SubscriptionTriggerPhaseParams @@ -184,9 +185,8 @@ private constructor( * credit note. Consider using this as a safety mechanism if you do not expect existing * invoices to be changed. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun allowInvoiceCreditOrVoid(allowInvoiceCreditOrVoid: Optional) = - allowInvoiceCreditOrVoid(allowInvoiceCreditOrVoid.orElse(null) as Boolean?) + allowInvoiceCreditOrVoid(allowInvoiceCreditOrVoid.getOrNull()) /** * If false, this request will fail if it would void an issued invoice or create a @@ -209,7 +209,7 @@ private constructor( * today in the customer's timezone. */ fun effectiveDate(effectiveDate: Optional) = - effectiveDate(effectiveDate.orElse(null)) + effectiveDate(effectiveDate.getOrNull()) /** * The date on which the phase change should take effect. If not provided, defaults to @@ -317,9 +317,8 @@ private constructor( * note. Consider using this as a safety mechanism if you do not expect existing invoices to * be changed. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun allowInvoiceCreditOrVoid(allowInvoiceCreditOrVoid: Optional) = - allowInvoiceCreditOrVoid(allowInvoiceCreditOrVoid.orElse(null) as Boolean?) + allowInvoiceCreditOrVoid(allowInvoiceCreditOrVoid.getOrNull()) /** * If false, this request will fail if it would void an issued invoice or create a credit @@ -341,7 +340,7 @@ private constructor( * in the customer's timezone. */ fun effectiveDate(effectiveDate: Optional) = - effectiveDate(effectiveDate.orElse(null)) + effectiveDate(effectiveDate.getOrNull()) /** * The date on which the phase change should take effect. If not provided, defaults to today diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionTriggerPhaseResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionTriggerPhaseResponse.kt index f52ffc25..81788e05 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionTriggerPhaseResponse.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionTriggerPhaseResponse.kt @@ -568,9 +568,8 @@ private constructor( activePlanPhaseOrder(activePlanPhaseOrder as Long?) /** The current plan phase that is active, only if the subscription's plan has phases. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun activePlanPhaseOrder(activePlanPhaseOrder: Optional) = - activePlanPhaseOrder(activePlanPhaseOrder.orElse(null) as Long?) + activePlanPhaseOrder(activePlanPhaseOrder.getOrNull()) /** The current plan phase that is active, only if the subscription's plan has phases. */ fun activePlanPhaseOrder(activePlanPhaseOrder: JsonField) = apply { @@ -623,9 +622,8 @@ private constructor( * with the saved payment method on the due date. This property defaults to the plan's * behavior. If null, defaults to the customer's setting. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun autoCollection(autoCollection: Optional) = - autoCollection(autoCollection.orElse(null) as Boolean?) + autoCollection(autoCollection.getOrNull()) /** * Determines whether issued invoices for this subscription will automatically be charged @@ -680,7 +678,7 @@ private constructor( * are not currently active. */ fun currentBillingPeriodEndDate(currentBillingPeriodEndDate: Optional) = - currentBillingPeriodEndDate(currentBillingPeriodEndDate.orElse(null)) + currentBillingPeriodEndDate(currentBillingPeriodEndDate.getOrNull()) /** * The end of the current billing period. This is an exclusive timestamp, such that the @@ -706,7 +704,7 @@ private constructor( * is not currently active. */ fun currentBillingPeriodStartDate(currentBillingPeriodStartDate: Optional) = - currentBillingPeriodStartDate(currentBillingPeriodStartDate.orElse(null)) + currentBillingPeriodStartDate(currentBillingPeriodStartDate.getOrNull()) /** * The start date of the current billing period. This is an inclusive timestamp; the instant @@ -769,7 +767,7 @@ private constructor( * provided, it is determined by the plan configuration. */ fun defaultInvoiceMemo(defaultInvoiceMemo: Optional) = - defaultInvoiceMemo(defaultInvoiceMemo.orElse(null)) + defaultInvoiceMemo(defaultInvoiceMemo.getOrNull()) /** * Determines the default memo on this subscriptions' invoices. Note that if this is not @@ -812,7 +810,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The date Orb stops billing for this subscription. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The date Orb stops billing for this subscription. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -838,7 +836,7 @@ private constructor( invoicingThreshold(JsonField.ofNullable(invoicingThreshold)) fun invoicingThreshold(invoicingThreshold: Optional) = - invoicingThreshold(invoicingThreshold.orElse(null)) + invoicingThreshold(invoicingThreshold.getOrNull()) fun invoicingThreshold(invoicingThreshold: JsonField) = apply { this.invoicingThreshold = invoicingThreshold @@ -941,7 +939,7 @@ private constructor( redeemedCoupon(JsonField.ofNullable(redeemedCoupon)) fun redeemedCoupon(redeemedCoupon: Optional) = - redeemedCoupon(redeemedCoupon.orElse(null)) + redeemedCoupon(redeemedCoupon.getOrNull()) fun redeemedCoupon(redeemedCoupon: JsonField) = apply { this.redeemedCoupon = redeemedCoupon @@ -1178,7 +1176,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The end date of the adjustment interval. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The end date of the adjustment interval. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -1727,9 +1725,8 @@ private constructor( planPhaseOrder(planPhaseOrder as Long?) /** The plan phase in which this adjustment is active. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) /** The plan phase in which this adjustment is active. */ fun planPhaseOrder(planPhaseOrder: JsonField) = apply { @@ -1740,7 +1737,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -2148,9 +2145,8 @@ private constructor( planPhaseOrder(planPhaseOrder as Long?) /** The plan phase in which this adjustment is active. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) /** The plan phase in which this adjustment is active. */ fun planPhaseOrder(planPhaseOrder: JsonField) = apply { @@ -2161,7 +2157,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -2557,9 +2553,8 @@ private constructor( planPhaseOrder(planPhaseOrder as Long?) /** The plan phase in which this adjustment is active. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) /** The plan phase in which this adjustment is active. */ fun planPhaseOrder(planPhaseOrder: JsonField) = apply { @@ -2570,7 +2565,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -2981,9 +2976,8 @@ private constructor( planPhaseOrder(planPhaseOrder as Long?) /** The plan phase in which this adjustment is active. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) /** The plan phase in which this adjustment is active. */ fun planPhaseOrder(planPhaseOrder: JsonField) = apply { @@ -2994,7 +2988,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -3387,9 +3381,8 @@ private constructor( planPhaseOrder(planPhaseOrder as Long?) /** The plan phase in which this adjustment is active. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) /** The plan phase in which this adjustment is active. */ fun planPhaseOrder(planPhaseOrder: JsonField) = apply { @@ -3400,7 +3393,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -3717,8 +3710,7 @@ private constructor( * The month on which the billing cycle is anchored (e.g. a quarterly price anchored in * February would have cycles starting February, May, August, and November). */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun month(month: Optional) = month(month.orElse(null) as Long?) + fun month(month: Optional) = month(month.getOrNull()) /** * The month on which the billing cycle is anchored (e.g. a quarterly price anchored in @@ -3742,8 +3734,7 @@ private constructor( * The year on which the billing cycle is anchored (e.g. a 2 year billing cycle anchored * on 2021 would have cycles starting on 2021, 2023, 2025, etc.). */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun year(year: Optional) = year(year.orElse(null) as Long?) + fun year(year: Optional) = year(year.getOrNull()) /** * The year on which the billing cycle is anchored (e.g. a 2 year billing cycle anchored @@ -4172,7 +4163,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The end date of the discount interval. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The end date of the discount interval. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -4532,7 +4523,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The end date of the discount interval. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The end date of the discount interval. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -4908,7 +4899,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The end date of the discount interval. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The end date of the discount interval. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -5190,7 +5181,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -5426,7 +5417,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The end date of the maximum interval. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The end date of the maximum interval. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -5758,7 +5749,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The end date of the minimum interval. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The end date of the minimum interval. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -6131,7 +6122,7 @@ private constructor( * interval is not currently active. */ fun currentBillingPeriodEndDate(currentBillingPeriodEndDate: Optional) = - currentBillingPeriodEndDate(currentBillingPeriodEndDate.orElse(null)) + currentBillingPeriodEndDate(currentBillingPeriodEndDate.getOrNull()) /** * The end of the current billing period. This is an exclusive timestamp, such that the @@ -6157,7 +6148,7 @@ private constructor( */ fun currentBillingPeriodStartDate( currentBillingPeriodStartDate: Optional - ) = currentBillingPeriodStartDate(currentBillingPeriodStartDate.orElse(null)) + ) = currentBillingPeriodStartDate(currentBillingPeriodStartDate.getOrNull()) /** * The start date of the current billing period. This is an inclusive timestamp; the @@ -6178,7 +6169,7 @@ private constructor( * The end date of the price interval. This is the date that Orb stops billing for this * price. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** * The end date of the price interval. This is the date that Orb stops billing for this @@ -6190,7 +6181,7 @@ private constructor( fun filter(filter: String?) = filter(JsonField.ofNullable(filter)) /** An additional filter to apply to usage queries. */ - fun filter(filter: Optional) = filter(filter.orElse(null)) + fun filter(filter: Optional) = filter(filter.getOrNull()) /** An additional filter to apply to usage queries. */ fun filter(filter: JsonField) = apply { this.filter = filter } @@ -6209,7 +6200,7 @@ private constructor( */ fun fixedFeeQuantityTransitions( fixedFeeQuantityTransitions: Optional> - ) = fixedFeeQuantityTransitions(fixedFeeQuantityTransitions.orElse(null)) + ) = fixedFeeQuantityTransitions(fixedFeeQuantityTransitions.getOrNull()) /** * The fixed fee quantity transitions for this price interval. This is only relevant for @@ -6702,7 +6693,7 @@ private constructor( * price interval. */ fun usageCustomerIds(usageCustomerIds: Optional>) = - usageCustomerIds(usageCustomerIds.orElse(null)) + usageCustomerIds(usageCustomerIds.getOrNull()) /** * A list of customer IDs whose usage events will be aggregated and billed under this @@ -7015,7 +7006,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -7236,7 +7227,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) fun endDate(endDate: JsonField) = apply { this.endDate = endDate } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUnscheduleCancellationResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUnscheduleCancellationResponse.kt index 8004e95c..ee6867c8 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUnscheduleCancellationResponse.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUnscheduleCancellationResponse.kt @@ -577,9 +577,8 @@ private constructor( activePlanPhaseOrder(activePlanPhaseOrder as Long?) /** The current plan phase that is active, only if the subscription's plan has phases. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun activePlanPhaseOrder(activePlanPhaseOrder: Optional) = - activePlanPhaseOrder(activePlanPhaseOrder.orElse(null) as Long?) + activePlanPhaseOrder(activePlanPhaseOrder.getOrNull()) /** The current plan phase that is active, only if the subscription's plan has phases. */ fun activePlanPhaseOrder(activePlanPhaseOrder: JsonField) = apply { @@ -632,9 +631,8 @@ private constructor( * with the saved payment method on the due date. This property defaults to the plan's * behavior. If null, defaults to the customer's setting. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun autoCollection(autoCollection: Optional) = - autoCollection(autoCollection.orElse(null) as Boolean?) + autoCollection(autoCollection.getOrNull()) /** * Determines whether issued invoices for this subscription will automatically be charged @@ -689,7 +687,7 @@ private constructor( * are not currently active. */ fun currentBillingPeriodEndDate(currentBillingPeriodEndDate: Optional) = - currentBillingPeriodEndDate(currentBillingPeriodEndDate.orElse(null)) + currentBillingPeriodEndDate(currentBillingPeriodEndDate.getOrNull()) /** * The end of the current billing period. This is an exclusive timestamp, such that the @@ -715,7 +713,7 @@ private constructor( * is not currently active. */ fun currentBillingPeriodStartDate(currentBillingPeriodStartDate: Optional) = - currentBillingPeriodStartDate(currentBillingPeriodStartDate.orElse(null)) + currentBillingPeriodStartDate(currentBillingPeriodStartDate.getOrNull()) /** * The start date of the current billing period. This is an inclusive timestamp; the instant @@ -778,7 +776,7 @@ private constructor( * provided, it is determined by the plan configuration. */ fun defaultInvoiceMemo(defaultInvoiceMemo: Optional) = - defaultInvoiceMemo(defaultInvoiceMemo.orElse(null)) + defaultInvoiceMemo(defaultInvoiceMemo.getOrNull()) /** * Determines the default memo on this subscriptions' invoices. Note that if this is not @@ -821,7 +819,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The date Orb stops billing for this subscription. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The date Orb stops billing for this subscription. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -847,7 +845,7 @@ private constructor( invoicingThreshold(JsonField.ofNullable(invoicingThreshold)) fun invoicingThreshold(invoicingThreshold: Optional) = - invoicingThreshold(invoicingThreshold.orElse(null)) + invoicingThreshold(invoicingThreshold.getOrNull()) fun invoicingThreshold(invoicingThreshold: JsonField) = apply { this.invoicingThreshold = invoicingThreshold @@ -950,7 +948,7 @@ private constructor( redeemedCoupon(JsonField.ofNullable(redeemedCoupon)) fun redeemedCoupon(redeemedCoupon: Optional) = - redeemedCoupon(redeemedCoupon.orElse(null)) + redeemedCoupon(redeemedCoupon.getOrNull()) fun redeemedCoupon(redeemedCoupon: JsonField) = apply { this.redeemedCoupon = redeemedCoupon @@ -1187,7 +1185,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The end date of the adjustment interval. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The end date of the adjustment interval. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -1736,9 +1734,8 @@ private constructor( planPhaseOrder(planPhaseOrder as Long?) /** The plan phase in which this adjustment is active. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) /** The plan phase in which this adjustment is active. */ fun planPhaseOrder(planPhaseOrder: JsonField) = apply { @@ -1749,7 +1746,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -2157,9 +2154,8 @@ private constructor( planPhaseOrder(planPhaseOrder as Long?) /** The plan phase in which this adjustment is active. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) /** The plan phase in which this adjustment is active. */ fun planPhaseOrder(planPhaseOrder: JsonField) = apply { @@ -2170,7 +2166,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -2566,9 +2562,8 @@ private constructor( planPhaseOrder(planPhaseOrder as Long?) /** The plan phase in which this adjustment is active. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) /** The plan phase in which this adjustment is active. */ fun planPhaseOrder(planPhaseOrder: JsonField) = apply { @@ -2579,7 +2574,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -2990,9 +2985,8 @@ private constructor( planPhaseOrder(planPhaseOrder as Long?) /** The plan phase in which this adjustment is active. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) /** The plan phase in which this adjustment is active. */ fun planPhaseOrder(planPhaseOrder: JsonField) = apply { @@ -3003,7 +2997,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -3396,9 +3390,8 @@ private constructor( planPhaseOrder(planPhaseOrder as Long?) /** The plan phase in which this adjustment is active. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) /** The plan phase in which this adjustment is active. */ fun planPhaseOrder(planPhaseOrder: JsonField) = apply { @@ -3409,7 +3402,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -3726,8 +3719,7 @@ private constructor( * The month on which the billing cycle is anchored (e.g. a quarterly price anchored in * February would have cycles starting February, May, August, and November). */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun month(month: Optional) = month(month.orElse(null) as Long?) + fun month(month: Optional) = month(month.getOrNull()) /** * The month on which the billing cycle is anchored (e.g. a quarterly price anchored in @@ -3751,8 +3743,7 @@ private constructor( * The year on which the billing cycle is anchored (e.g. a 2 year billing cycle anchored * on 2021 would have cycles starting on 2021, 2023, 2025, etc.). */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun year(year: Optional) = year(year.orElse(null) as Long?) + fun year(year: Optional) = year(year.getOrNull()) /** * The year on which the billing cycle is anchored (e.g. a 2 year billing cycle anchored @@ -4181,7 +4172,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The end date of the discount interval. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The end date of the discount interval. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -4541,7 +4532,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The end date of the discount interval. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The end date of the discount interval. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -4917,7 +4908,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The end date of the discount interval. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The end date of the discount interval. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -5199,7 +5190,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -5435,7 +5426,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The end date of the maximum interval. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The end date of the maximum interval. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -5767,7 +5758,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The end date of the minimum interval. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The end date of the minimum interval. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -6140,7 +6131,7 @@ private constructor( * interval is not currently active. */ fun currentBillingPeriodEndDate(currentBillingPeriodEndDate: Optional) = - currentBillingPeriodEndDate(currentBillingPeriodEndDate.orElse(null)) + currentBillingPeriodEndDate(currentBillingPeriodEndDate.getOrNull()) /** * The end of the current billing period. This is an exclusive timestamp, such that the @@ -6166,7 +6157,7 @@ private constructor( */ fun currentBillingPeriodStartDate( currentBillingPeriodStartDate: Optional - ) = currentBillingPeriodStartDate(currentBillingPeriodStartDate.orElse(null)) + ) = currentBillingPeriodStartDate(currentBillingPeriodStartDate.getOrNull()) /** * The start date of the current billing period. This is an inclusive timestamp; the @@ -6187,7 +6178,7 @@ private constructor( * The end date of the price interval. This is the date that Orb stops billing for this * price. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** * The end date of the price interval. This is the date that Orb stops billing for this @@ -6199,7 +6190,7 @@ private constructor( fun filter(filter: String?) = filter(JsonField.ofNullable(filter)) /** An additional filter to apply to usage queries. */ - fun filter(filter: Optional) = filter(filter.orElse(null)) + fun filter(filter: Optional) = filter(filter.getOrNull()) /** An additional filter to apply to usage queries. */ fun filter(filter: JsonField) = apply { this.filter = filter } @@ -6218,7 +6209,7 @@ private constructor( */ fun fixedFeeQuantityTransitions( fixedFeeQuantityTransitions: Optional> - ) = fixedFeeQuantityTransitions(fixedFeeQuantityTransitions.orElse(null)) + ) = fixedFeeQuantityTransitions(fixedFeeQuantityTransitions.getOrNull()) /** * The fixed fee quantity transitions for this price interval. This is only relevant for @@ -6711,7 +6702,7 @@ private constructor( * price interval. */ fun usageCustomerIds(usageCustomerIds: Optional>) = - usageCustomerIds(usageCustomerIds.orElse(null)) + usageCustomerIds(usageCustomerIds.getOrNull()) /** * A list of customer IDs whose usage events will be aggregated and billed under this @@ -7024,7 +7015,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -7245,7 +7236,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) fun endDate(endDate: JsonField) = apply { this.endDate = endDate } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse.kt index 0fbf6fa9..f4bc910b 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse.kt @@ -585,9 +585,8 @@ private constructor( activePlanPhaseOrder(activePlanPhaseOrder as Long?) /** The current plan phase that is active, only if the subscription's plan has phases. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun activePlanPhaseOrder(activePlanPhaseOrder: Optional) = - activePlanPhaseOrder(activePlanPhaseOrder.orElse(null) as Long?) + activePlanPhaseOrder(activePlanPhaseOrder.getOrNull()) /** The current plan phase that is active, only if the subscription's plan has phases. */ fun activePlanPhaseOrder(activePlanPhaseOrder: JsonField) = apply { @@ -640,9 +639,8 @@ private constructor( * with the saved payment method on the due date. This property defaults to the plan's * behavior. If null, defaults to the customer's setting. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun autoCollection(autoCollection: Optional) = - autoCollection(autoCollection.orElse(null) as Boolean?) + autoCollection(autoCollection.getOrNull()) /** * Determines whether issued invoices for this subscription will automatically be charged @@ -697,7 +695,7 @@ private constructor( * are not currently active. */ fun currentBillingPeriodEndDate(currentBillingPeriodEndDate: Optional) = - currentBillingPeriodEndDate(currentBillingPeriodEndDate.orElse(null)) + currentBillingPeriodEndDate(currentBillingPeriodEndDate.getOrNull()) /** * The end of the current billing period. This is an exclusive timestamp, such that the @@ -723,7 +721,7 @@ private constructor( * is not currently active. */ fun currentBillingPeriodStartDate(currentBillingPeriodStartDate: Optional) = - currentBillingPeriodStartDate(currentBillingPeriodStartDate.orElse(null)) + currentBillingPeriodStartDate(currentBillingPeriodStartDate.getOrNull()) /** * The start date of the current billing period. This is an inclusive timestamp; the instant @@ -786,7 +784,7 @@ private constructor( * provided, it is determined by the plan configuration. */ fun defaultInvoiceMemo(defaultInvoiceMemo: Optional) = - defaultInvoiceMemo(defaultInvoiceMemo.orElse(null)) + defaultInvoiceMemo(defaultInvoiceMemo.getOrNull()) /** * Determines the default memo on this subscriptions' invoices. Note that if this is not @@ -829,7 +827,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The date Orb stops billing for this subscription. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The date Orb stops billing for this subscription. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -855,7 +853,7 @@ private constructor( invoicingThreshold(JsonField.ofNullable(invoicingThreshold)) fun invoicingThreshold(invoicingThreshold: Optional) = - invoicingThreshold(invoicingThreshold.orElse(null)) + invoicingThreshold(invoicingThreshold.getOrNull()) fun invoicingThreshold(invoicingThreshold: JsonField) = apply { this.invoicingThreshold = invoicingThreshold @@ -958,7 +956,7 @@ private constructor( redeemedCoupon(JsonField.ofNullable(redeemedCoupon)) fun redeemedCoupon(redeemedCoupon: Optional) = - redeemedCoupon(redeemedCoupon.orElse(null)) + redeemedCoupon(redeemedCoupon.getOrNull()) fun redeemedCoupon(redeemedCoupon: JsonField) = apply { this.redeemedCoupon = redeemedCoupon @@ -1195,7 +1193,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The end date of the adjustment interval. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The end date of the adjustment interval. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -1744,9 +1742,8 @@ private constructor( planPhaseOrder(planPhaseOrder as Long?) /** The plan phase in which this adjustment is active. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) /** The plan phase in which this adjustment is active. */ fun planPhaseOrder(planPhaseOrder: JsonField) = apply { @@ -1757,7 +1754,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -2165,9 +2162,8 @@ private constructor( planPhaseOrder(planPhaseOrder as Long?) /** The plan phase in which this adjustment is active. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) /** The plan phase in which this adjustment is active. */ fun planPhaseOrder(planPhaseOrder: JsonField) = apply { @@ -2178,7 +2174,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -2574,9 +2570,8 @@ private constructor( planPhaseOrder(planPhaseOrder as Long?) /** The plan phase in which this adjustment is active. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) /** The plan phase in which this adjustment is active. */ fun planPhaseOrder(planPhaseOrder: JsonField) = apply { @@ -2587,7 +2582,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -2998,9 +2993,8 @@ private constructor( planPhaseOrder(planPhaseOrder as Long?) /** The plan phase in which this adjustment is active. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) /** The plan phase in which this adjustment is active. */ fun planPhaseOrder(planPhaseOrder: JsonField) = apply { @@ -3011,7 +3005,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -3404,9 +3398,8 @@ private constructor( planPhaseOrder(planPhaseOrder as Long?) /** The plan phase in which this adjustment is active. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) /** The plan phase in which this adjustment is active. */ fun planPhaseOrder(planPhaseOrder: JsonField) = apply { @@ -3417,7 +3410,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -3734,8 +3727,7 @@ private constructor( * The month on which the billing cycle is anchored (e.g. a quarterly price anchored in * February would have cycles starting February, May, August, and November). */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun month(month: Optional) = month(month.orElse(null) as Long?) + fun month(month: Optional) = month(month.getOrNull()) /** * The month on which the billing cycle is anchored (e.g. a quarterly price anchored in @@ -3759,8 +3751,7 @@ private constructor( * The year on which the billing cycle is anchored (e.g. a 2 year billing cycle anchored * on 2021 would have cycles starting on 2021, 2023, 2025, etc.). */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun year(year: Optional) = year(year.orElse(null) as Long?) + fun year(year: Optional) = year(year.getOrNull()) /** * The year on which the billing cycle is anchored (e.g. a 2 year billing cycle anchored @@ -4189,7 +4180,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The end date of the discount interval. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The end date of the discount interval. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -4549,7 +4540,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The end date of the discount interval. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The end date of the discount interval. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -4925,7 +4916,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The end date of the discount interval. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The end date of the discount interval. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -5207,7 +5198,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -5443,7 +5434,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The end date of the maximum interval. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The end date of the maximum interval. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -5775,7 +5766,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The end date of the minimum interval. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The end date of the minimum interval. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -6148,7 +6139,7 @@ private constructor( * interval is not currently active. */ fun currentBillingPeriodEndDate(currentBillingPeriodEndDate: Optional) = - currentBillingPeriodEndDate(currentBillingPeriodEndDate.orElse(null)) + currentBillingPeriodEndDate(currentBillingPeriodEndDate.getOrNull()) /** * The end of the current billing period. This is an exclusive timestamp, such that the @@ -6174,7 +6165,7 @@ private constructor( */ fun currentBillingPeriodStartDate( currentBillingPeriodStartDate: Optional - ) = currentBillingPeriodStartDate(currentBillingPeriodStartDate.orElse(null)) + ) = currentBillingPeriodStartDate(currentBillingPeriodStartDate.getOrNull()) /** * The start date of the current billing period. This is an inclusive timestamp; the @@ -6195,7 +6186,7 @@ private constructor( * The end date of the price interval. This is the date that Orb stops billing for this * price. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** * The end date of the price interval. This is the date that Orb stops billing for this @@ -6207,7 +6198,7 @@ private constructor( fun filter(filter: String?) = filter(JsonField.ofNullable(filter)) /** An additional filter to apply to usage queries. */ - fun filter(filter: Optional) = filter(filter.orElse(null)) + fun filter(filter: Optional) = filter(filter.getOrNull()) /** An additional filter to apply to usage queries. */ fun filter(filter: JsonField) = apply { this.filter = filter } @@ -6226,7 +6217,7 @@ private constructor( */ fun fixedFeeQuantityTransitions( fixedFeeQuantityTransitions: Optional> - ) = fixedFeeQuantityTransitions(fixedFeeQuantityTransitions.orElse(null)) + ) = fixedFeeQuantityTransitions(fixedFeeQuantityTransitions.getOrNull()) /** * The fixed fee quantity transitions for this price interval. This is only relevant for @@ -6719,7 +6710,7 @@ private constructor( * price interval. */ fun usageCustomerIds(usageCustomerIds: Optional>) = - usageCustomerIds(usageCustomerIds.orElse(null)) + usageCustomerIds(usageCustomerIds.getOrNull()) /** * A list of customer IDs whose usage events will be aggregated and billed under this @@ -7032,7 +7023,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -7253,7 +7244,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) fun endDate(endDate: JsonField) = apply { this.endDate = endDate } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUnschedulePendingPlanChangesResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUnschedulePendingPlanChangesResponse.kt index 0e518af9..569c6155 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUnschedulePendingPlanChangesResponse.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUnschedulePendingPlanChangesResponse.kt @@ -581,9 +581,8 @@ private constructor( activePlanPhaseOrder(activePlanPhaseOrder as Long?) /** The current plan phase that is active, only if the subscription's plan has phases. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun activePlanPhaseOrder(activePlanPhaseOrder: Optional) = - activePlanPhaseOrder(activePlanPhaseOrder.orElse(null) as Long?) + activePlanPhaseOrder(activePlanPhaseOrder.getOrNull()) /** The current plan phase that is active, only if the subscription's plan has phases. */ fun activePlanPhaseOrder(activePlanPhaseOrder: JsonField) = apply { @@ -636,9 +635,8 @@ private constructor( * with the saved payment method on the due date. This property defaults to the plan's * behavior. If null, defaults to the customer's setting. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun autoCollection(autoCollection: Optional) = - autoCollection(autoCollection.orElse(null) as Boolean?) + autoCollection(autoCollection.getOrNull()) /** * Determines whether issued invoices for this subscription will automatically be charged @@ -693,7 +691,7 @@ private constructor( * are not currently active. */ fun currentBillingPeriodEndDate(currentBillingPeriodEndDate: Optional) = - currentBillingPeriodEndDate(currentBillingPeriodEndDate.orElse(null)) + currentBillingPeriodEndDate(currentBillingPeriodEndDate.getOrNull()) /** * The end of the current billing period. This is an exclusive timestamp, such that the @@ -719,7 +717,7 @@ private constructor( * is not currently active. */ fun currentBillingPeriodStartDate(currentBillingPeriodStartDate: Optional) = - currentBillingPeriodStartDate(currentBillingPeriodStartDate.orElse(null)) + currentBillingPeriodStartDate(currentBillingPeriodStartDate.getOrNull()) /** * The start date of the current billing period. This is an inclusive timestamp; the instant @@ -782,7 +780,7 @@ private constructor( * provided, it is determined by the plan configuration. */ fun defaultInvoiceMemo(defaultInvoiceMemo: Optional) = - defaultInvoiceMemo(defaultInvoiceMemo.orElse(null)) + defaultInvoiceMemo(defaultInvoiceMemo.getOrNull()) /** * Determines the default memo on this subscriptions' invoices. Note that if this is not @@ -825,7 +823,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The date Orb stops billing for this subscription. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The date Orb stops billing for this subscription. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -851,7 +849,7 @@ private constructor( invoicingThreshold(JsonField.ofNullable(invoicingThreshold)) fun invoicingThreshold(invoicingThreshold: Optional) = - invoicingThreshold(invoicingThreshold.orElse(null)) + invoicingThreshold(invoicingThreshold.getOrNull()) fun invoicingThreshold(invoicingThreshold: JsonField) = apply { this.invoicingThreshold = invoicingThreshold @@ -954,7 +952,7 @@ private constructor( redeemedCoupon(JsonField.ofNullable(redeemedCoupon)) fun redeemedCoupon(redeemedCoupon: Optional) = - redeemedCoupon(redeemedCoupon.orElse(null)) + redeemedCoupon(redeemedCoupon.getOrNull()) fun redeemedCoupon(redeemedCoupon: JsonField) = apply { this.redeemedCoupon = redeemedCoupon @@ -1191,7 +1189,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The end date of the adjustment interval. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The end date of the adjustment interval. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -1740,9 +1738,8 @@ private constructor( planPhaseOrder(planPhaseOrder as Long?) /** The plan phase in which this adjustment is active. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) /** The plan phase in which this adjustment is active. */ fun planPhaseOrder(planPhaseOrder: JsonField) = apply { @@ -1753,7 +1750,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -2161,9 +2158,8 @@ private constructor( planPhaseOrder(planPhaseOrder as Long?) /** The plan phase in which this adjustment is active. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) /** The plan phase in which this adjustment is active. */ fun planPhaseOrder(planPhaseOrder: JsonField) = apply { @@ -2174,7 +2170,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -2570,9 +2566,8 @@ private constructor( planPhaseOrder(planPhaseOrder as Long?) /** The plan phase in which this adjustment is active. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) /** The plan phase in which this adjustment is active. */ fun planPhaseOrder(planPhaseOrder: JsonField) = apply { @@ -2583,7 +2578,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -2994,9 +2989,8 @@ private constructor( planPhaseOrder(planPhaseOrder as Long?) /** The plan phase in which this adjustment is active. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) /** The plan phase in which this adjustment is active. */ fun planPhaseOrder(planPhaseOrder: JsonField) = apply { @@ -3007,7 +3001,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -3400,9 +3394,8 @@ private constructor( planPhaseOrder(planPhaseOrder as Long?) /** The plan phase in which this adjustment is active. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) /** The plan phase in which this adjustment is active. */ fun planPhaseOrder(planPhaseOrder: JsonField) = apply { @@ -3413,7 +3406,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -3730,8 +3723,7 @@ private constructor( * The month on which the billing cycle is anchored (e.g. a quarterly price anchored in * February would have cycles starting February, May, August, and November). */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun month(month: Optional) = month(month.orElse(null) as Long?) + fun month(month: Optional) = month(month.getOrNull()) /** * The month on which the billing cycle is anchored (e.g. a quarterly price anchored in @@ -3755,8 +3747,7 @@ private constructor( * The year on which the billing cycle is anchored (e.g. a 2 year billing cycle anchored * on 2021 would have cycles starting on 2021, 2023, 2025, etc.). */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun year(year: Optional) = year(year.orElse(null) as Long?) + fun year(year: Optional) = year(year.getOrNull()) /** * The year on which the billing cycle is anchored (e.g. a 2 year billing cycle anchored @@ -4185,7 +4176,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The end date of the discount interval. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The end date of the discount interval. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -4545,7 +4536,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The end date of the discount interval. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The end date of the discount interval. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -4921,7 +4912,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The end date of the discount interval. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The end date of the discount interval. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -5203,7 +5194,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -5439,7 +5430,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The end date of the maximum interval. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The end date of the maximum interval. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -5771,7 +5762,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The end date of the minimum interval. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The end date of the minimum interval. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -6144,7 +6135,7 @@ private constructor( * interval is not currently active. */ fun currentBillingPeriodEndDate(currentBillingPeriodEndDate: Optional) = - currentBillingPeriodEndDate(currentBillingPeriodEndDate.orElse(null)) + currentBillingPeriodEndDate(currentBillingPeriodEndDate.getOrNull()) /** * The end of the current billing period. This is an exclusive timestamp, such that the @@ -6170,7 +6161,7 @@ private constructor( */ fun currentBillingPeriodStartDate( currentBillingPeriodStartDate: Optional - ) = currentBillingPeriodStartDate(currentBillingPeriodStartDate.orElse(null)) + ) = currentBillingPeriodStartDate(currentBillingPeriodStartDate.getOrNull()) /** * The start date of the current billing period. This is an inclusive timestamp; the @@ -6191,7 +6182,7 @@ private constructor( * The end date of the price interval. This is the date that Orb stops billing for this * price. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** * The end date of the price interval. This is the date that Orb stops billing for this @@ -6203,7 +6194,7 @@ private constructor( fun filter(filter: String?) = filter(JsonField.ofNullable(filter)) /** An additional filter to apply to usage queries. */ - fun filter(filter: Optional) = filter(filter.orElse(null)) + fun filter(filter: Optional) = filter(filter.getOrNull()) /** An additional filter to apply to usage queries. */ fun filter(filter: JsonField) = apply { this.filter = filter } @@ -6222,7 +6213,7 @@ private constructor( */ fun fixedFeeQuantityTransitions( fixedFeeQuantityTransitions: Optional> - ) = fixedFeeQuantityTransitions(fixedFeeQuantityTransitions.orElse(null)) + ) = fixedFeeQuantityTransitions(fixedFeeQuantityTransitions.getOrNull()) /** * The fixed fee quantity transitions for this price interval. This is only relevant for @@ -6715,7 +6706,7 @@ private constructor( * price interval. */ fun usageCustomerIds(usageCustomerIds: Optional>) = - usageCustomerIds(usageCustomerIds.orElse(null)) + usageCustomerIds(usageCustomerIds.getOrNull()) /** * A list of customer IDs whose usage events will be aggregated and billed under this @@ -7028,7 +7019,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -7249,7 +7240,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) fun endDate(endDate: JsonField) = apply { this.endDate = endDate } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUpdateFixedFeeQuantityParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUpdateFixedFeeQuantityParams.kt index 7b1d0851..00eadf2d 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUpdateFixedFeeQuantityParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUpdateFixedFeeQuantityParams.kt @@ -22,6 +22,7 @@ import com.withorb.api.errors.OrbInvalidDataException import java.time.LocalDate import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull /** * This endpoint can be used to update the quantity for a fixed fee. @@ -290,9 +291,8 @@ private constructor( * credit note. Consider using this as a safety mechanism if you do not expect existing * invoices to be changed. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun allowInvoiceCreditOrVoid(allowInvoiceCreditOrVoid: Optional) = - allowInvoiceCreditOrVoid(allowInvoiceCreditOrVoid.orElse(null) as Boolean?) + allowInvoiceCreditOrVoid(allowInvoiceCreditOrVoid.getOrNull()) /** * If false, this request will fail if it would void an issued invoice or create a @@ -333,7 +333,7 @@ private constructor( * according to `change_option`. */ fun effectiveDate(effectiveDate: Optional) = - effectiveDate(effectiveDate.orElse(null)) + effectiveDate(effectiveDate.getOrNull()) /** * The date that the quantity change should take effect, localized to the customer's @@ -465,9 +465,8 @@ private constructor( * note. Consider using this as a safety mechanism if you do not expect existing invoices to * be changed. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun allowInvoiceCreditOrVoid(allowInvoiceCreditOrVoid: Optional) = - allowInvoiceCreditOrVoid(allowInvoiceCreditOrVoid.orElse(null) as Boolean?) + allowInvoiceCreditOrVoid(allowInvoiceCreditOrVoid.getOrNull()) /** * If false, this request will fail if it would void an issued invoice or create a credit @@ -507,7 +506,7 @@ private constructor( * to `change_option`. */ fun effectiveDate(effectiveDate: Optional) = - effectiveDate(effectiveDate.orElse(null)) + effectiveDate(effectiveDate.getOrNull()) /** * The date that the quantity change should take effect, localized to the customer's diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUpdateFixedFeeQuantityResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUpdateFixedFeeQuantityResponse.kt index 50d600e5..3e54b93d 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUpdateFixedFeeQuantityResponse.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUpdateFixedFeeQuantityResponse.kt @@ -577,9 +577,8 @@ private constructor( activePlanPhaseOrder(activePlanPhaseOrder as Long?) /** The current plan phase that is active, only if the subscription's plan has phases. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun activePlanPhaseOrder(activePlanPhaseOrder: Optional) = - activePlanPhaseOrder(activePlanPhaseOrder.orElse(null) as Long?) + activePlanPhaseOrder(activePlanPhaseOrder.getOrNull()) /** The current plan phase that is active, only if the subscription's plan has phases. */ fun activePlanPhaseOrder(activePlanPhaseOrder: JsonField) = apply { @@ -632,9 +631,8 @@ private constructor( * with the saved payment method on the due date. This property defaults to the plan's * behavior. If null, defaults to the customer's setting. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun autoCollection(autoCollection: Optional) = - autoCollection(autoCollection.orElse(null) as Boolean?) + autoCollection(autoCollection.getOrNull()) /** * Determines whether issued invoices for this subscription will automatically be charged @@ -689,7 +687,7 @@ private constructor( * are not currently active. */ fun currentBillingPeriodEndDate(currentBillingPeriodEndDate: Optional) = - currentBillingPeriodEndDate(currentBillingPeriodEndDate.orElse(null)) + currentBillingPeriodEndDate(currentBillingPeriodEndDate.getOrNull()) /** * The end of the current billing period. This is an exclusive timestamp, such that the @@ -715,7 +713,7 @@ private constructor( * is not currently active. */ fun currentBillingPeriodStartDate(currentBillingPeriodStartDate: Optional) = - currentBillingPeriodStartDate(currentBillingPeriodStartDate.orElse(null)) + currentBillingPeriodStartDate(currentBillingPeriodStartDate.getOrNull()) /** * The start date of the current billing period. This is an inclusive timestamp; the instant @@ -778,7 +776,7 @@ private constructor( * provided, it is determined by the plan configuration. */ fun defaultInvoiceMemo(defaultInvoiceMemo: Optional) = - defaultInvoiceMemo(defaultInvoiceMemo.orElse(null)) + defaultInvoiceMemo(defaultInvoiceMemo.getOrNull()) /** * Determines the default memo on this subscriptions' invoices. Note that if this is not @@ -821,7 +819,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The date Orb stops billing for this subscription. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The date Orb stops billing for this subscription. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -847,7 +845,7 @@ private constructor( invoicingThreshold(JsonField.ofNullable(invoicingThreshold)) fun invoicingThreshold(invoicingThreshold: Optional) = - invoicingThreshold(invoicingThreshold.orElse(null)) + invoicingThreshold(invoicingThreshold.getOrNull()) fun invoicingThreshold(invoicingThreshold: JsonField) = apply { this.invoicingThreshold = invoicingThreshold @@ -950,7 +948,7 @@ private constructor( redeemedCoupon(JsonField.ofNullable(redeemedCoupon)) fun redeemedCoupon(redeemedCoupon: Optional) = - redeemedCoupon(redeemedCoupon.orElse(null)) + redeemedCoupon(redeemedCoupon.getOrNull()) fun redeemedCoupon(redeemedCoupon: JsonField) = apply { this.redeemedCoupon = redeemedCoupon @@ -1187,7 +1185,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The end date of the adjustment interval. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The end date of the adjustment interval. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -1736,9 +1734,8 @@ private constructor( planPhaseOrder(planPhaseOrder as Long?) /** The plan phase in which this adjustment is active. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) /** The plan phase in which this adjustment is active. */ fun planPhaseOrder(planPhaseOrder: JsonField) = apply { @@ -1749,7 +1746,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -2157,9 +2154,8 @@ private constructor( planPhaseOrder(planPhaseOrder as Long?) /** The plan phase in which this adjustment is active. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) /** The plan phase in which this adjustment is active. */ fun planPhaseOrder(planPhaseOrder: JsonField) = apply { @@ -2170,7 +2166,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -2566,9 +2562,8 @@ private constructor( planPhaseOrder(planPhaseOrder as Long?) /** The plan phase in which this adjustment is active. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) /** The plan phase in which this adjustment is active. */ fun planPhaseOrder(planPhaseOrder: JsonField) = apply { @@ -2579,7 +2574,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -2990,9 +2985,8 @@ private constructor( planPhaseOrder(planPhaseOrder as Long?) /** The plan phase in which this adjustment is active. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) /** The plan phase in which this adjustment is active. */ fun planPhaseOrder(planPhaseOrder: JsonField) = apply { @@ -3003,7 +2997,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -3396,9 +3390,8 @@ private constructor( planPhaseOrder(planPhaseOrder as Long?) /** The plan phase in which this adjustment is active. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) /** The plan phase in which this adjustment is active. */ fun planPhaseOrder(planPhaseOrder: JsonField) = apply { @@ -3409,7 +3402,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -3726,8 +3719,7 @@ private constructor( * The month on which the billing cycle is anchored (e.g. a quarterly price anchored in * February would have cycles starting February, May, August, and November). */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun month(month: Optional) = month(month.orElse(null) as Long?) + fun month(month: Optional) = month(month.getOrNull()) /** * The month on which the billing cycle is anchored (e.g. a quarterly price anchored in @@ -3751,8 +3743,7 @@ private constructor( * The year on which the billing cycle is anchored (e.g. a 2 year billing cycle anchored * on 2021 would have cycles starting on 2021, 2023, 2025, etc.). */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun year(year: Optional) = year(year.orElse(null) as Long?) + fun year(year: Optional) = year(year.getOrNull()) /** * The year on which the billing cycle is anchored (e.g. a 2 year billing cycle anchored @@ -4181,7 +4172,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The end date of the discount interval. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The end date of the discount interval. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -4541,7 +4532,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The end date of the discount interval. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The end date of the discount interval. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -4917,7 +4908,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The end date of the discount interval. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The end date of the discount interval. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -5199,7 +5190,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -5435,7 +5426,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The end date of the maximum interval. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The end date of the maximum interval. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -5767,7 +5758,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The end date of the minimum interval. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The end date of the minimum interval. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -6140,7 +6131,7 @@ private constructor( * interval is not currently active. */ fun currentBillingPeriodEndDate(currentBillingPeriodEndDate: Optional) = - currentBillingPeriodEndDate(currentBillingPeriodEndDate.orElse(null)) + currentBillingPeriodEndDate(currentBillingPeriodEndDate.getOrNull()) /** * The end of the current billing period. This is an exclusive timestamp, such that the @@ -6166,7 +6157,7 @@ private constructor( */ fun currentBillingPeriodStartDate( currentBillingPeriodStartDate: Optional - ) = currentBillingPeriodStartDate(currentBillingPeriodStartDate.orElse(null)) + ) = currentBillingPeriodStartDate(currentBillingPeriodStartDate.getOrNull()) /** * The start date of the current billing period. This is an inclusive timestamp; the @@ -6187,7 +6178,7 @@ private constructor( * The end date of the price interval. This is the date that Orb stops billing for this * price. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** * The end date of the price interval. This is the date that Orb stops billing for this @@ -6199,7 +6190,7 @@ private constructor( fun filter(filter: String?) = filter(JsonField.ofNullable(filter)) /** An additional filter to apply to usage queries. */ - fun filter(filter: Optional) = filter(filter.orElse(null)) + fun filter(filter: Optional) = filter(filter.getOrNull()) /** An additional filter to apply to usage queries. */ fun filter(filter: JsonField) = apply { this.filter = filter } @@ -6218,7 +6209,7 @@ private constructor( */ fun fixedFeeQuantityTransitions( fixedFeeQuantityTransitions: Optional> - ) = fixedFeeQuantityTransitions(fixedFeeQuantityTransitions.orElse(null)) + ) = fixedFeeQuantityTransitions(fixedFeeQuantityTransitions.getOrNull()) /** * The fixed fee quantity transitions for this price interval. This is only relevant for @@ -6711,7 +6702,7 @@ private constructor( * price interval. */ fun usageCustomerIds(usageCustomerIds: Optional>) = - usageCustomerIds(usageCustomerIds.orElse(null)) + usageCustomerIds(usageCustomerIds.getOrNull()) /** * A list of customer IDs whose usage events will be aggregated and billed under this @@ -7024,7 +7015,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -7245,7 +7236,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) fun endDate(endDate: JsonField) = apply { this.endDate = endDate } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUpdateParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUpdateParams.kt index b9f8dd69..2f3e1f49 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUpdateParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUpdateParams.kt @@ -19,6 +19,7 @@ import com.withorb.api.core.immutableEmptyMap import com.withorb.api.core.toImmutable import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull /** * This endpoint can be used to update the `metadata`, `net terms`, `auto_collection`, @@ -286,9 +287,8 @@ private constructor( * charged with the saved payment method on the due date. This property defaults to the * plan's behavior. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun autoCollection(autoCollection: Optional) = - autoCollection(autoCollection.orElse(null) as Boolean?) + autoCollection(autoCollection.getOrNull()) /** * Determines whether issued invoices for this subscription will automatically be @@ -311,7 +311,7 @@ private constructor( * provided, it is determined by the plan configuration. */ fun defaultInvoiceMemo(defaultInvoiceMemo: Optional) = - defaultInvoiceMemo(defaultInvoiceMemo.orElse(null)) + defaultInvoiceMemo(defaultInvoiceMemo.getOrNull()) /** * Determines the default memo on this subscription's invoices. Note that if this is not @@ -335,7 +335,7 @@ private constructor( * end of the billing period. */ fun invoicingThreshold(invoicingThreshold: Optional) = - invoicingThreshold(invoicingThreshold.orElse(null)) + invoicingThreshold(invoicingThreshold.getOrNull()) /** * When this subscription's accrued usage reaches this threshold, an invoice will be @@ -358,7 +358,7 @@ private constructor( * setting the value to `null`, and the entire metadata mapping can be cleared by * setting `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed by @@ -389,8 +389,7 @@ private constructor( * issue, whereas a value of `30` represents that the customer has a month to pay the * invoice. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun netTerms(netTerms: Optional) = netTerms(netTerms.orElse(null) as Long?) + fun netTerms(netTerms: Optional) = netTerms(netTerms.getOrNull()) /** * Determines the difference between the invoice issue date for subscription invoices as @@ -501,9 +500,8 @@ private constructor( * with the saved payment method on the due date. This property defaults to the plan's * behavior. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun autoCollection(autoCollection: Optional) = - autoCollection(autoCollection.orElse(null) as Boolean?) + autoCollection(autoCollection.getOrNull()) /** * Determines whether issued invoices for this subscription will automatically be charged @@ -527,7 +525,7 @@ private constructor( * provided, it is determined by the plan configuration. */ fun defaultInvoiceMemo(defaultInvoiceMemo: Optional) = - defaultInvoiceMemo(defaultInvoiceMemo.orElse(null)) + defaultInvoiceMemo(defaultInvoiceMemo.getOrNull()) /** * Determines the default memo on this subscription's invoices. Note that if this is not @@ -552,7 +550,7 @@ private constructor( * billing period. */ fun invoicingThreshold(invoicingThreshold: Optional) = - invoicingThreshold(invoicingThreshold.orElse(null)) + invoicingThreshold(invoicingThreshold.getOrNull()) /** * When this subscription's accrued usage reaches this threshold, an invoice will be issued @@ -575,7 +573,7 @@ private constructor( * setting the value to `null`, and the entire metadata mapping can be cleared by setting * `metadata` to `null`. */ - fun metadata(metadata: Optional) = metadata(metadata.orElse(null)) + fun metadata(metadata: Optional) = metadata(metadata.getOrNull()) /** * User-specified key/value pairs for the resource. Individual keys can be removed by @@ -603,8 +601,7 @@ private constructor( * date that they are due. A value of `0` here represents that the invoice is due on issue, * whereas a value of `30` represents that the customer has a month to pay the invoice. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun netTerms(netTerms: Optional) = netTerms(netTerms.orElse(null) as Long?) + fun netTerms(netTerms: Optional) = netTerms(netTerms.getOrNull()) /** * Determines the difference between the invoice issue date for subscription invoices as the diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUpdateTrialResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUpdateTrialResponse.kt index 3dcfb548..a19cecfb 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUpdateTrialResponse.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUpdateTrialResponse.kt @@ -568,9 +568,8 @@ private constructor( activePlanPhaseOrder(activePlanPhaseOrder as Long?) /** The current plan phase that is active, only if the subscription's plan has phases. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun activePlanPhaseOrder(activePlanPhaseOrder: Optional) = - activePlanPhaseOrder(activePlanPhaseOrder.orElse(null) as Long?) + activePlanPhaseOrder(activePlanPhaseOrder.getOrNull()) /** The current plan phase that is active, only if the subscription's plan has phases. */ fun activePlanPhaseOrder(activePlanPhaseOrder: JsonField) = apply { @@ -623,9 +622,8 @@ private constructor( * with the saved payment method on the due date. This property defaults to the plan's * behavior. If null, defaults to the customer's setting. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun autoCollection(autoCollection: Optional) = - autoCollection(autoCollection.orElse(null) as Boolean?) + autoCollection(autoCollection.getOrNull()) /** * Determines whether issued invoices for this subscription will automatically be charged @@ -680,7 +678,7 @@ private constructor( * are not currently active. */ fun currentBillingPeriodEndDate(currentBillingPeriodEndDate: Optional) = - currentBillingPeriodEndDate(currentBillingPeriodEndDate.orElse(null)) + currentBillingPeriodEndDate(currentBillingPeriodEndDate.getOrNull()) /** * The end of the current billing period. This is an exclusive timestamp, such that the @@ -706,7 +704,7 @@ private constructor( * is not currently active. */ fun currentBillingPeriodStartDate(currentBillingPeriodStartDate: Optional) = - currentBillingPeriodStartDate(currentBillingPeriodStartDate.orElse(null)) + currentBillingPeriodStartDate(currentBillingPeriodStartDate.getOrNull()) /** * The start date of the current billing period. This is an inclusive timestamp; the instant @@ -769,7 +767,7 @@ private constructor( * provided, it is determined by the plan configuration. */ fun defaultInvoiceMemo(defaultInvoiceMemo: Optional) = - defaultInvoiceMemo(defaultInvoiceMemo.orElse(null)) + defaultInvoiceMemo(defaultInvoiceMemo.getOrNull()) /** * Determines the default memo on this subscriptions' invoices. Note that if this is not @@ -812,7 +810,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The date Orb stops billing for this subscription. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The date Orb stops billing for this subscription. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -838,7 +836,7 @@ private constructor( invoicingThreshold(JsonField.ofNullable(invoicingThreshold)) fun invoicingThreshold(invoicingThreshold: Optional) = - invoicingThreshold(invoicingThreshold.orElse(null)) + invoicingThreshold(invoicingThreshold.getOrNull()) fun invoicingThreshold(invoicingThreshold: JsonField) = apply { this.invoicingThreshold = invoicingThreshold @@ -941,7 +939,7 @@ private constructor( redeemedCoupon(JsonField.ofNullable(redeemedCoupon)) fun redeemedCoupon(redeemedCoupon: Optional) = - redeemedCoupon(redeemedCoupon.orElse(null)) + redeemedCoupon(redeemedCoupon.getOrNull()) fun redeemedCoupon(redeemedCoupon: JsonField) = apply { this.redeemedCoupon = redeemedCoupon @@ -1178,7 +1176,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The end date of the adjustment interval. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The end date of the adjustment interval. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -1727,9 +1725,8 @@ private constructor( planPhaseOrder(planPhaseOrder as Long?) /** The plan phase in which this adjustment is active. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) /** The plan phase in which this adjustment is active. */ fun planPhaseOrder(planPhaseOrder: JsonField) = apply { @@ -1740,7 +1737,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -2148,9 +2145,8 @@ private constructor( planPhaseOrder(planPhaseOrder as Long?) /** The plan phase in which this adjustment is active. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) /** The plan phase in which this adjustment is active. */ fun planPhaseOrder(planPhaseOrder: JsonField) = apply { @@ -2161,7 +2157,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -2557,9 +2553,8 @@ private constructor( planPhaseOrder(planPhaseOrder as Long?) /** The plan phase in which this adjustment is active. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) /** The plan phase in which this adjustment is active. */ fun planPhaseOrder(planPhaseOrder: JsonField) = apply { @@ -2570,7 +2565,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -2981,9 +2976,8 @@ private constructor( planPhaseOrder(planPhaseOrder as Long?) /** The plan phase in which this adjustment is active. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) /** The plan phase in which this adjustment is active. */ fun planPhaseOrder(planPhaseOrder: JsonField) = apply { @@ -2994,7 +2988,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -3387,9 +3381,8 @@ private constructor( planPhaseOrder(planPhaseOrder as Long?) /** The plan phase in which this adjustment is active. */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + planPhaseOrder(planPhaseOrder.getOrNull()) /** The plan phase in which this adjustment is active. */ fun planPhaseOrder(planPhaseOrder: JsonField) = apply { @@ -3400,7 +3393,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) /** The reason for the adjustment. */ - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) /** The reason for the adjustment. */ fun reason(reason: JsonField) = apply { this.reason = reason } @@ -3717,8 +3710,7 @@ private constructor( * The month on which the billing cycle is anchored (e.g. a quarterly price anchored in * February would have cycles starting February, May, August, and November). */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun month(month: Optional) = month(month.orElse(null) as Long?) + fun month(month: Optional) = month(month.getOrNull()) /** * The month on which the billing cycle is anchored (e.g. a quarterly price anchored in @@ -3742,8 +3734,7 @@ private constructor( * The year on which the billing cycle is anchored (e.g. a 2 year billing cycle anchored * on 2021 would have cycles starting on 2021, 2023, 2025, etc.). */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun year(year: Optional) = year(year.orElse(null) as Long?) + fun year(year: Optional) = year(year.getOrNull()) /** * The year on which the billing cycle is anchored (e.g. a 2 year billing cycle anchored @@ -4172,7 +4163,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The end date of the discount interval. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The end date of the discount interval. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -4532,7 +4523,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The end date of the discount interval. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The end date of the discount interval. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -4908,7 +4899,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The end date of the discount interval. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The end date of the discount interval. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -5190,7 +5181,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -5426,7 +5417,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The end date of the maximum interval. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The end date of the maximum interval. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -5758,7 +5749,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) /** The end date of the minimum interval. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** The end date of the minimum interval. */ fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -6131,7 +6122,7 @@ private constructor( * interval is not currently active. */ fun currentBillingPeriodEndDate(currentBillingPeriodEndDate: Optional) = - currentBillingPeriodEndDate(currentBillingPeriodEndDate.orElse(null)) + currentBillingPeriodEndDate(currentBillingPeriodEndDate.getOrNull()) /** * The end of the current billing period. This is an exclusive timestamp, such that the @@ -6157,7 +6148,7 @@ private constructor( */ fun currentBillingPeriodStartDate( currentBillingPeriodStartDate: Optional - ) = currentBillingPeriodStartDate(currentBillingPeriodStartDate.orElse(null)) + ) = currentBillingPeriodStartDate(currentBillingPeriodStartDate.getOrNull()) /** * The start date of the current billing period. This is an inclusive timestamp; the @@ -6178,7 +6169,7 @@ private constructor( * The end date of the price interval. This is the date that Orb stops billing for this * price. */ - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) /** * The end date of the price interval. This is the date that Orb stops billing for this @@ -6190,7 +6181,7 @@ private constructor( fun filter(filter: String?) = filter(JsonField.ofNullable(filter)) /** An additional filter to apply to usage queries. */ - fun filter(filter: Optional) = filter(filter.orElse(null)) + fun filter(filter: Optional) = filter(filter.getOrNull()) /** An additional filter to apply to usage queries. */ fun filter(filter: JsonField) = apply { this.filter = filter } @@ -6209,7 +6200,7 @@ private constructor( */ fun fixedFeeQuantityTransitions( fixedFeeQuantityTransitions: Optional> - ) = fixedFeeQuantityTransitions(fixedFeeQuantityTransitions.orElse(null)) + ) = fixedFeeQuantityTransitions(fixedFeeQuantityTransitions.getOrNull()) /** * The fixed fee quantity transitions for this price interval. This is only relevant for @@ -6702,7 +6693,7 @@ private constructor( * price interval. */ fun usageCustomerIds(usageCustomerIds: Optional>) = - usageCustomerIds(usageCustomerIds.orElse(null)) + usageCustomerIds(usageCustomerIds.getOrNull()) /** * A list of customer IDs whose usage events will be aggregated and billed under this @@ -7015,7 +7006,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) fun endDate(endDate: JsonField) = apply { this.endDate = endDate } @@ -7236,7 +7227,7 @@ private constructor( fun endDate(endDate: OffsetDateTime?) = endDate(JsonField.ofNullable(endDate)) - fun endDate(endDate: Optional) = endDate(endDate.orElse(null)) + fun endDate(endDate: Optional) = endDate(endDate.getOrNull()) fun endDate(endDate: JsonField) = apply { this.endDate = endDate } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUsage.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUsage.kt index b7fc7022..0e531291 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUsage.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUsage.kt @@ -30,6 +30,7 @@ import com.withorb.api.errors.OrbInvalidDataException import java.time.OffsetDateTime import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull @JsonDeserialize(using = SubscriptionUsage.Deserializer::class) @JsonSerialize(using = SubscriptionUsage.Serializer::class) @@ -909,7 +910,7 @@ private constructor( paginationMetadata(JsonField.ofNullable(paginationMetadata)) fun paginationMetadata(paginationMetadata: Optional) = - paginationMetadata(paginationMetadata.orElse(null)) + paginationMetadata(paginationMetadata.getOrNull()) fun paginationMetadata(paginationMetadata: JsonField) = apply { this.paginationMetadata = paginationMetadata diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/TrialDiscount.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/TrialDiscount.kt index 2742d2b5..370de1bf 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/TrialDiscount.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/TrialDiscount.kt @@ -19,6 +19,7 @@ import com.withorb.api.core.toImmutable import com.withorb.api.errors.OrbInvalidDataException import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull @NoAutoDetect class TrialDiscount @@ -173,7 +174,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) fun reason(reason: JsonField) = apply { this.reason = reason } @@ -183,7 +184,7 @@ private constructor( /** Only available if discount_type is `trial` */ fun trialAmountDiscount(trialAmountDiscount: Optional) = - trialAmountDiscount(trialAmountDiscount.orElse(null)) + trialAmountDiscount(trialAmountDiscount.getOrNull()) /** Only available if discount_type is `trial` */ fun trialAmountDiscount(trialAmountDiscount: JsonField) = apply { @@ -199,9 +200,8 @@ private constructor( trialPercentageDiscount(trialPercentageDiscount as Double?) /** Only available if discount_type is `trial` */ - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun trialPercentageDiscount(trialPercentageDiscount: Optional) = - trialPercentageDiscount(trialPercentageDiscount.orElse(null) as Double?) + trialPercentageDiscount(trialPercentageDiscount.getOrNull()) /** Only available if discount_type is `trial` */ fun trialPercentageDiscount(trialPercentageDiscount: JsonField) = apply { diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/UsageDiscount.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/UsageDiscount.kt index 57c38321..d802fc98 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/UsageDiscount.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/UsageDiscount.kt @@ -19,6 +19,7 @@ import com.withorb.api.core.toImmutable import com.withorb.api.errors.OrbInvalidDataException import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull @NoAutoDetect class UsageDiscount @@ -176,7 +177,7 @@ private constructor( fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) - fun reason(reason: Optional) = reason(reason.orElse(null)) + fun reason(reason: Optional) = reason(reason.getOrNull()) fun reason(reason: JsonField) = apply { this.reason = reason } diff --git a/orb-java/build.gradle.kts b/orb-java/build.gradle.kts index 4393c00c..330a2be0 100644 --- a/orb-java/build.gradle.kts +++ b/orb-java/build.gradle.kts @@ -6,24 +6,3 @@ plugins { dependencies { api(project(":orb-java-client-okhttp")) } - -// Redefine `dokkaJavadoc` to: -// - Depend on the root project's task for merging the docs of all the projects -// - Forward that task's output to this task's output -tasks.named("dokkaJavadoc").configure { - actions.clear() - - val dokkaJavadocCollector = rootProject.tasks["dokkaJavadocCollector"] - dependsOn(dokkaJavadocCollector) - - val outputDirectory = project.layout.buildDirectory.dir("dokka/javadoc") - doLast { - copy { - from(dokkaJavadocCollector.outputs.files) - into(outputDirectory) - duplicatesStrategy = DuplicatesStrategy.INCLUDE - } - } - - outputs.dir(outputDirectory) -}