diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index cb9d2541..7f3f5c84 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.22.0"
+ ".": "0.23.0"
}
\ No newline at end of file
diff --git a/.stats.yml b/.stats.yml
index eeba5cf5..f878d0a8 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,2 +1,2 @@
configured_endpoints: 101
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-11f40c15fa889d9752019e8a35b82d2e7a3d42f2b42c850b469f120a5b2c47ba.yml
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-e480186cdd0e2cc631befa7e2c6ba5f2d7ae52052f0e79a748214f3ade8a98ee.yml
diff --git a/CHANGELOG.md b/CHANGELOG.md
index bb276426..e1869e42 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,23 @@
# Changelog
+## 0.23.0 (2025-01-18)
+
+Full Changelog: [v0.22.0...v0.23.0](https://github.com/orbcorp/orb-java/compare/v0.22.0...v0.23.0)
+
+### Features
+
+* **api:** api update ([#206](https://github.com/orbcorp/orb-java/issues/206)) ([e2eef46](https://github.com/orbcorp/orb-java/commit/e2eef4669606db8745234da24a04814da1118f86))
+
+
+### Chores
+
+* **internal:** upgrade kotlin compiler and gradle ([#203](https://github.com/orbcorp/orb-java/issues/203)) ([3e03f2b](https://github.com/orbcorp/orb-java/commit/3e03f2bb7a247262f89871ecec0a957ee50b64f4))
+
+
+### Documentation
+
+* add more documentation ([#205](https://github.com/orbcorp/orb-java/issues/205)) ([c8fbcb6](https://github.com/orbcorp/orb-java/commit/c8fbcb675e81cf8683c92843fffdbe7b4aa6286f))
+
## 0.22.0 (2025-01-16)
Full Changelog: [v0.21.0...v0.22.0](https://github.com/orbcorp/orb-java/compare/v0.21.0...v0.22.0)
diff --git a/README.md b/README.md
index 25496d02..a58b9a16 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@
-[](https://central.sonatype.com/artifact/com.withorb.api/orb-java/0.22.0)
+[](https://central.sonatype.com/artifact/com.withorb.api/orb-java/0.23.0)
@@ -25,7 +25,7 @@ The REST API documentation can be found on [docs.withorb.com](https://docs.with
```kotlin
-implementation("com.withorb.api:orb-java:0.22.0")
+implementation("com.withorb.api:orb-java:0.23.0")
```
#### Maven
@@ -34,7 +34,7 @@ implementation("com.withorb.api:orb-java:0.22.0")
com.withorb.api
orb-java
- 0.22.0
+ 0.23.0
```
diff --git a/build.gradle.kts b/build.gradle.kts
index 86f53d40..68c099dc 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -1,4 +1,4 @@
allprojects {
group = "com.withorb.api"
- version = "0.22.0" // x-release-please-version
+ version = "0.23.0" // x-release-please-version
}
diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts
index 493cb327..8a1d7a10 100644
--- a/buildSrc/build.gradle.kts
+++ b/buildSrc/build.gradle.kts
@@ -1,6 +1,6 @@
plugins {
`kotlin-dsl`
- kotlin("jvm") version "1.9.22"
+ kotlin("jvm") version "2.1.0"
id("com.vanniktech.maven.publish") version "0.28.0"
}
diff --git a/buildSrc/src/main/kotlin/orb.kotlin.gradle.kts b/buildSrc/src/main/kotlin/orb.kotlin.gradle.kts
index 0368cf6c..882c3a5c 100644
--- a/buildSrc/src/main/kotlin/orb.kotlin.gradle.kts
+++ b/buildSrc/src/main/kotlin/orb.kotlin.gradle.kts
@@ -21,8 +21,12 @@ configure {
tasks.withType().configureEach {
kotlinOptions {
- allWarningsAsErrors = true
- freeCompilerArgs = listOf("-Xjvm-default=all", "-Xjdk-release=1.8")
+ freeCompilerArgs = listOf(
+ "-Xjvm-default=all",
+ "-Xjdk-release=1.8",
+ // Suppress deprecation warnings because we may still reference and test deprecated members.
+ "-Xsuppress-warning=DEPRECATION"
+ )
jvmTarget = "1.8"
}
}
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
index e6441136..a4b76b95 100644
Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index b82aa23a..cea7a793 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
diff --git a/gradlew b/gradlew
index 1aa94a42..f3b75f3b 100755
--- a/gradlew
+++ b/gradlew
@@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
+# SPDX-License-Identifier: Apache-2.0
+#
##############################################################################
#
@@ -55,7 +57,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
-# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
+# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
@@ -84,7 +86,7 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
-APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
+APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
diff --git a/gradlew.bat b/gradlew.bat
index 25da30db..9d21a218 100644
--- a/gradlew.bat
+++ b/gradlew.bat
@@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
+@rem SPDX-License-Identifier: Apache-2.0
+@rem
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
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 41b70a36..7a1b4a84 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
@@ -21,8 +21,8 @@ import java.util.Objects
import java.util.Optional
/**
- * [Alerts within Orb](https://docs.withorb.com/guides/product-catalog/configuring-alerts) monitor
- * spending, usage, or credit balance and trigger webhooks when a threshold is exceeded.
+ * [Alerts within Orb](/product-catalog/configuring-alerts) monitor spending, usage, or credit
+ * balance and trigger webhooks when a threshold is exceeded.
*
* Alerts created through the API can be scoped to either customers or subscriptions.
*/
@@ -915,6 +915,7 @@ private constructor(
"Threshold{value=$value, additionalProperties=$additionalProperties}"
}
+ /** The type of alert. This must be a valid alert type. */
class Type
@JsonCreator
private constructor(
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 1b1007f8..aa1a4cd2 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
@@ -25,9 +25,9 @@ import java.util.Optional
* This endpoint creates a new alert to monitor a customer's credit balance. There are three types
* of alerts that can be scoped to customers: `credit_balance_depleted`, `credit_balance_dropped`,
* and `credit_balance_recovered`. Customers can have a maximum of one of each type of alert per
- * [credit balance currency](https://docs.withorb.com/guides/product-catalog/prepurchase).
- * `credit_balance_dropped` alerts require a list of thresholds to be provided while
- * `credit_balance_depleted` and `credit_balance_recovered` alerts do not require thresholds.
+ * [credit balance currency](/product-catalog/prepurchase). `credit_balance_dropped` alerts require
+ * a list of thresholds to be provided while `credit_balance_depleted` and
+ * `credit_balance_recovered` alerts do not require thresholds.
*/
class AlertCreateForCustomerParams
constructor(
@@ -414,6 +414,7 @@ constructor(
)
}
+ /** The type of alert to create. This must be a valid alert type. */
class Type
@JsonCreator
private constructor(
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 c48f6ccc..0475ed90 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
@@ -25,9 +25,9 @@ import java.util.Optional
* This endpoint creates a new alert to monitor a customer's credit balance. There are three types
* of alerts that can be scoped to customers: `credit_balance_depleted`, `credit_balance_dropped`,
* and `credit_balance_recovered`. Customers can have a maximum of one of each type of alert per
- * [credit balance currency](https://docs.withorb.com/guides/product-catalog/prepurchase).
- * `credit_balance_dropped` alerts require a list of thresholds to be provided while
- * `credit_balance_depleted` and `credit_balance_recovered` alerts do not require thresholds.
+ * [credit balance currency](/product-catalog/prepurchase). `credit_balance_dropped` alerts require
+ * a list of thresholds to be provided while `credit_balance_depleted` and
+ * `credit_balance_recovered` alerts do not require thresholds.
*/
class AlertCreateForExternalCustomerParams
constructor(
@@ -423,6 +423,7 @@ constructor(
)
}
+ /** The type of alert to create. This must be a valid alert type. */
class Type
@JsonCreator
private constructor(
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 7474b386..a02901f1 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
@@ -534,6 +534,7 @@ constructor(
"Threshold{value=$value, additionalProperties=$additionalProperties}"
}
+ /** The type of alert to create. This must be a valid alert type. */
class Type
@JsonCreator
private constructor(
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 960a6433..7088ecd4 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
@@ -19,6 +19,17 @@ import java.util.Optional
import java.util.stream.Stream
import java.util.stream.StreamSupport
+/**
+ * This endpoint returns a list of alerts within Orb.
+ *
+ * The request must specify one of `customer_id`, `external_customer_id`, or `subscription_id`.
+ *
+ * If querying by subscripion_id, the endpoint will return the subscription level alerts as well as
+ * the plan level alerts associated with the subscription.
+ *
+ * The list of alerts is ordered starting from the most recently created alert. This endpoint
+ * follows Orb's [standardized pagination format](/api-reference/pagination).
+ */
class AlertListPage
private constructor(
private val alertsService: AlertService,
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertListPageAsync.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertListPageAsync.kt
index 2d7c92a3..161853a7 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertListPageAsync.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertListPageAsync.kt
@@ -20,6 +20,17 @@ import java.util.concurrent.CompletableFuture
import java.util.concurrent.Executor
import java.util.function.Predicate
+/**
+ * This endpoint returns a list of alerts within Orb.
+ *
+ * The request must specify one of `customer_id`, `external_customer_id`, or `subscription_id`.
+ *
+ * If querying by subscripion_id, the endpoint will return the subscription level alerts as well as
+ * the plan level alerts associated with the subscription.
+ *
+ * The list of alerts is ordered starting from the most recently created alert. This endpoint
+ * follows Orb's [standardized pagination format](/api-reference/pagination).
+ */
class AlertListPageAsync
private constructor(
private val alertsService: AlertServiceAsync,
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 2d10e511..6aea2a47 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
@@ -19,7 +19,7 @@ import java.util.Optional
* the plan level alerts associated with the subscription.
*
* The list of alerts is ordered starting from the most recently created alert. This endpoint
- * follows Orb's [standardized pagination format](../reference/pagination).
+ * follows Orb's [standardized pagination format](/api-reference/pagination).
*/
class AlertListParams
constructor(
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 911b12a6..d0f6e58f 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
@@ -35,37 +35,6 @@ import kotlin.jvm.optionals.getOrNull
* percentage amount to an invoice or subscription. Coupons are activated using a redemption code,
* which applies the discount to a subscription or invoice. The duration of a coupon determines how
* long it remains available for use by end users.
- *
- * ## How to use coupons
- *
- * Coupons can be created using the Orb dashboard or programmatically through the API. Once a coupon
- * is created, it can be managed and applied programmatically via the API. To redeem a coupon, use
- * the `redemption_code` property when [creating a subscription](create-subscription.api.mdx) or
- * when scheduling a [plan change](schedule-plan-change.api.mdx).
- *
- * ## When to use coupons
- *
- * A common use case for coupons is through self-serve signup or upgrade flows in your checkout
- * experience or billing portal. Coupons can also be used as one-off to incentivize use for custom
- * agreements.
- *
- * Coupons are effective when launching new features and encouraging existing users to upgrade to a
- * higher tier. For example, you could create a coupon code "UPGRADE20" that offers a 20% discount
- * on the first month of the new plan. This code can be applied during the upgrade process in your
- * billing portal, making it straightforward for users to benefit from the new features at a reduced
- * cost.
- *
- * ## Coupon scoping
- *
- * When a coupon is applied on a subscription, it creates a discount adjustment that applies to all
- * of the prices on the subscription at the time of the coupon application. Notably, coupons do not
- * scope in new price additions to a subscription automatically — if a new price is added to the
- * subscription with a subscription edit or plan version migration, the discount created with the
- * coupon will not apply to it automatically. If you'd like the coupon to apply to newly added
- * prices, you can [edit the adjustment intervals](add-edit-price-intervals.api.mdx) to end the
- * discount interval created by the coupon at the time of the migration and add a new one starting
- * at the time of the migration that includes the newly added prices you'd like the coupon to apply
- * to.
*/
@NoAutoDetect
class Coupon
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 0d6a0b65..3b2d74d3 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
@@ -19,6 +19,13 @@ import java.util.Optional
import java.util.stream.Stream
import java.util.stream.StreamSupport
+/**
+ * This endpoint returns a list of all coupons for an account in a list format.
+ *
+ * The list of coupons is ordered starting from the most recently created coupon. The response also
+ * includes `pagination_metadata`, which lets the caller retrieve the next page of results if they
+ * exist. More information about pagination can be found in the Pagination-metadata schema.
+ */
class CouponListPage
private constructor(
private val couponsService: CouponService,
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CouponListPageAsync.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CouponListPageAsync.kt
index ad788113..8e2d01d8 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CouponListPageAsync.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CouponListPageAsync.kt
@@ -20,6 +20,13 @@ import java.util.concurrent.CompletableFuture
import java.util.concurrent.Executor
import java.util.function.Predicate
+/**
+ * This endpoint returns a list of all coupons for an account in a list format.
+ *
+ * The list of coupons is ordered starting from the most recently created coupon. The response also
+ * includes `pagination_metadata`, which lets the caller retrieve the next page of results if they
+ * exist. More information about pagination can be found in the Pagination-metadata schema.
+ */
class CouponListPageAsync
private constructor(
private val couponsService: CouponServiceAsync,
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 b480e48d..703e3fb8 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
@@ -19,6 +19,12 @@ import java.util.Optional
import java.util.stream.Stream
import java.util.stream.StreamSupport
+/**
+ * This endpoint returns a list of all subscriptions that have redeemed a given coupon as a
+ * [paginated](/api-reference/pagination) list, ordered starting from the most recently created
+ * subscription. For a full discussion of the subscription resource, see
+ * [Subscription](/core-concepts#subscription).
+ */
class CouponSubscriptionListPage
private constructor(
private val subscriptionsService: SubscriptionService,
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CouponSubscriptionListPageAsync.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CouponSubscriptionListPageAsync.kt
index d05cbe84..5ef983df 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CouponSubscriptionListPageAsync.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CouponSubscriptionListPageAsync.kt
@@ -20,6 +20,12 @@ import java.util.concurrent.CompletableFuture
import java.util.concurrent.Executor
import java.util.function.Predicate
+/**
+ * This endpoint returns a list of all subscriptions that have redeemed a given coupon as a
+ * [paginated](/api-reference/pagination) list, ordered starting from the most recently created
+ * subscription. For a full discussion of the subscription resource, see
+ * [Subscription](/core-concepts#subscription).
+ */
class CouponSubscriptionListPageAsync
private constructor(
private val subscriptionsService: SubscriptionServiceAsync,
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 f30efa04..506e9972 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
@@ -11,9 +11,9 @@ import java.util.Optional
/**
* This endpoint returns a list of all subscriptions that have redeemed a given coupon as a
- * [paginated](../reference/pagination) list, ordered starting from the most recently created
+ * [paginated](/api-reference/pagination) list, ordered starting from the most recently created
* subscription. For a full discussion of the subscription resource, see
- * [Subscription](../guides/concepts#subscription).
+ * [Subscription](/core-concepts#subscription).
*/
class CouponSubscriptionListParams
constructor(
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 fd7889b4..5f1dac93 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
@@ -21,8 +21,8 @@ import java.util.Objects
import java.util.Optional
/**
- * The [Credit Note](/guides/invoicing/credit-notes) resource represents a credit that has been
- * applied to a particular invoice.
+ * The [Credit Note](/invoicing/credit-notes) resource represents a credit that has been applied to
+ * a particular invoice.
*/
@NoAutoDetect
class CreditNote
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 398a20e9..f97ed262 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
@@ -21,7 +21,7 @@ import com.withorb.api.errors.OrbInvalidDataException
import java.util.Objects
import java.util.Optional
-/** This endpoint is used to create a single [`Credit Note`](../guides/invoicing/credit-notes). */
+/** This endpoint is used to create a single [`Credit Note`](/invoicing/credit-notes). */
class CreditNoteCreateParams
constructor(
private val body: CreditNoteCreateBody,
@@ -508,6 +508,7 @@ constructor(
"LineItem{amount=$amount, invoiceLineItemId=$invoiceLineItemId, additionalProperties=$additionalProperties}"
}
+ /** An optional reason for the credit note. */
class Reason
@JsonCreator
private constructor(
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CreditNoteFetchParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CreditNoteFetchParams.kt
index 050976d7..d48e298d 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CreditNoteFetchParams.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CreditNoteFetchParams.kt
@@ -9,8 +9,8 @@ import com.withorb.api.core.http.QueryParams
import java.util.Objects
/**
- * This endpoint is used to fetch a single [`Credit Note`](../guides/invoicing/credit-notes) given
- * an identifier.
+ * This endpoint is used to fetch a single [`Credit Note`](/invoicing/credit-notes) given an
+ * identifier.
*/
class CreditNoteFetchParams
constructor(
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 2246aca4..95190fec 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
@@ -19,6 +19,11 @@ import java.util.Optional
import java.util.stream.Stream
import java.util.stream.StreamSupport
+/**
+ * Get a paginated list of CreditNotes. Users can also filter by customer_id, subscription_id, or
+ * external_customer_id. The credit notes will be returned in reverse chronological order by
+ * `creation_time`.
+ */
class CreditNoteListPage
private constructor(
private val creditNotesService: CreditNoteService,
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CreditNoteListPageAsync.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CreditNoteListPageAsync.kt
index 25704d68..e30cd766 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CreditNoteListPageAsync.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CreditNoteListPageAsync.kt
@@ -20,6 +20,11 @@ import java.util.concurrent.CompletableFuture
import java.util.concurrent.Executor
import java.util.function.Predicate
+/**
+ * Get a paginated list of CreditNotes. Users can also filter by customer_id, subscription_id, or
+ * external_customer_id. The credit notes will be returned in reverse chronological order by
+ * `creation_time`.
+ */
class CreditNoteListPageAsync
private constructor(
private val creditNotesService: CreditNoteServiceAsync,
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 ff4c4d8d..ed1a0d16 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
@@ -26,8 +26,8 @@ import java.util.Optional
* In Orb, customers are assigned system generated identifiers automatically, but it's often
* desirable to have these match existing identifiers in your system. To avoid having to denormalize
* Orb ID information, you can pass in an `external_customer_id` with your own identifier. See
- * [Customer ID Aliases](../guides/events-and-metrics/customer-aliases) for further information
- * about how these aliases work in Orb.
+ * [Customer ID Aliases](/events-and-metrics/customer-aliases) for further information about how
+ * these aliases work in Orb.
*
* In addition to having an identifier in your system, a customer may exist in a payment provider
* solution like Stripe. Use the `payment_provider_id` and the `payment_provider` enum field to
@@ -35,8 +35,8 @@ import java.util.Optional
*
* A customer also has a timezone (from the standard
* [IANA timezone database](https://www.iana.org/time-zones)), which defaults to your account's
- * timezone. See [Timezone localization](../guides/product-catalog/timezones.md) for information on
- * what this timezone parameter influences within Orb.
+ * timezone. See [Timezone localization](/essentials/timezones) for information on what this
+ * timezone parameter influences within Orb.
*/
@NoAutoDetect
class Customer
@@ -1451,6 +1451,10 @@ private constructor(
override fun toString() = "Metadata{additionalProperties=$additionalProperties}"
}
+ /**
+ * This is used for creating charges or invoices in an external system via Orb. When not in test
+ * mode, the connection must first be configured in the Orb webapp.
+ */
class PaymentProvider
@JsonCreator
private constructor(
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 f7f830f7..0ce3df44 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
@@ -19,6 +19,32 @@ import java.util.Optional
import java.util.stream.Stream
import java.util.stream.StreamSupport
+/**
+ * ## The customer balance
+ *
+ * The customer balance is an amount in the customer's currency, which Orb automatically applies to
+ * subsequent invoices. This balance can be adjusted manually via Orb's webapp on the customer
+ * details page. You can use this balance to provide a fixed mid-period credit to the customer.
+ * Commonly, this is done due to system downtime/SLA violation, or an adhoc adjustment discussed
+ * with the customer.
+ *
+ * If the balance is a positive value at the time of invoicing, it represents that the customer has
+ * credit that should be used to offset the amount due on the next issued invoice. In this case, Orb
+ * will automatically reduce the next invoice by the balance amount, and roll over any remaining
+ * balance if the invoice is fully discounted.
+ *
+ * If the balance is a negative value at the time of invoicing, Orb will increase the invoice's
+ * amount due with a positive adjustment, and reset the balance to 0.
+ *
+ * This endpoint retrieves all customer balance transactions in reverse chronological order for a
+ * single customer, providing a complete audit trail of all adjustments and invoice applications.
+ *
+ * ## Eligibility
+ *
+ * The customer balance can only be applied to invoices or adjusted manually if invoices are not
+ * synced to a separate invoicing provider. If a payment gateway such as Stripe is used, the balance
+ * will be applied to the invoice before forwarding payment to the gateway.
+ */
class CustomerBalanceTransactionListPage
private constructor(
private val balanceTransactionsService: BalanceTransactionService,
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerBalanceTransactionListPageAsync.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerBalanceTransactionListPageAsync.kt
index 2b7fd46d..37b8e537 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerBalanceTransactionListPageAsync.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerBalanceTransactionListPageAsync.kt
@@ -20,6 +20,32 @@ import java.util.concurrent.CompletableFuture
import java.util.concurrent.Executor
import java.util.function.Predicate
+/**
+ * ## The customer balance
+ *
+ * The customer balance is an amount in the customer's currency, which Orb automatically applies to
+ * subsequent invoices. This balance can be adjusted manually via Orb's webapp on the customer
+ * details page. You can use this balance to provide a fixed mid-period credit to the customer.
+ * Commonly, this is done due to system downtime/SLA violation, or an adhoc adjustment discussed
+ * with the customer.
+ *
+ * If the balance is a positive value at the time of invoicing, it represents that the customer has
+ * credit that should be used to offset the amount due on the next issued invoice. In this case, Orb
+ * will automatically reduce the next invoice by the balance amount, and roll over any remaining
+ * balance if the invoice is fully discounted.
+ *
+ * If the balance is a negative value at the time of invoicing, Orb will increase the invoice's
+ * amount due with a positive adjustment, and reset the balance to 0.
+ *
+ * This endpoint retrieves all customer balance transactions in reverse chronological order for a
+ * single customer, providing a complete audit trail of all adjustments and invoice applications.
+ *
+ * ## Eligibility
+ *
+ * The customer balance can only be applied to invoices or adjusted manually if invoices are not
+ * synced to a separate invoicing provider. If a payment gateway such as Stripe is used, the balance
+ * will be applied to the invoice before forwarding payment to the gateway.
+ */
class CustomerBalanceTransactionListPageAsync
private constructor(
private val balanceTransactionsService: BalanceTransactionServiceAsync,
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 46bcd49f..56296037 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
@@ -18,8 +18,8 @@ import java.util.Optional
/**
* This endpoint is used to fetch a day-by-day snapshot of a customer's costs in Orb, calculated by
* applying pricing information to the underlying usage (see the
- * [subscription usage endpoint](fetch-subscription-usage.api.mdx) to fetch usage per metric, in
- * usage units rather than a currency).
+ * [subscription usage endpoint](/api-reference/subscription/fetch-subscription-usage) to fetch
+ * usage per metric, in usage units rather than a currency).
*
* This endpoint can be leveraged for internal tooling and to provide a more transparent billing
* experience for your end users:
@@ -27,8 +27,8 @@ import java.util.Optional
* billing period.
* 2. Provide customer visibility into how different services are contributing to the overall
* invoice with a per-day timeseries (as compared to the
- * [upcoming invoice](fetch-upcoming-invoice) resource, which represents a snapshot for the
- * current period).
+ * [upcoming invoice](/api-reference/invoice/fetch-upcoming-invoice) resource, which represents a
+ * snapshot for the current period).
* 3. Assess how minimums and discounts affect your customers by teasing apart costs directly as a
* result of usage, as opposed to minimums and discounts at the plan and price level.
* 4. Gain insight into key customer health metrics, such as the percent utilization of the minimum
@@ -367,6 +367,11 @@ constructor(
)
}
+ /**
+ * Controls whether Orb returns cumulative costs since the start of the billing period, or
+ * incremental day-by-day costs. If your customer has minimums or discounts, it's strongly
+ * recommended that you use the default cumulative behavior.
+ */
class ViewMode
@JsonCreator
private constructor(
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 8602aeef..5b7b26ce 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
@@ -316,224 +316,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the
* key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls
- * into, where each tier range is defined by an upper and lower bound. For example, the
- * first ten units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40
- * (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6
- * units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to assess.
- * For example, this would allow you to assess a fee of 0.25% on every payment you
- * process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given
- * event depends on the tier range that the billing period falls into. Each tier range
- * is defined by an upper bound. For example, after $1.5M of payment volume is reached,
- * each individual payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total.
- * Similar to tiered pricing, the BPS parameters of a given event depends on the tier
- * range that it falls into, where each tier range is defined by an upper and lower
- * bound. For example, the first few payments may have a 0.8 BPS take-rate and all
- * payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model.
- * In a one-dimensional matrix, the second value is `null`. Every configuration has a
- * list of `matrix_values` which give the unit prices for specified property values. In
- * a one-dimensional matrix, the matrix values will have `dimension_values` where the
- * second value of the pair is null. If an event does not match any of the dimension
- * values in the matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow
- * unit pricing. They also have an additional parameter `fixed_price_quantity`. If the
- * Price represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(): Price = price.getRequired("price")
@@ -555,224 +339,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the
* key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls
- * into, where each tier range is defined by an upper and lower bound. For example, the
- * first ten units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40
- * (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6
- * units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to assess.
- * For example, this would allow you to assess a fee of 0.25% on every payment you
- * process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given
- * event depends on the tier range that the billing period falls into. Each tier range
- * is defined by an upper bound. For example, after $1.5M of payment volume is reached,
- * each individual payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total.
- * Similar to tiered pricing, the BPS parameters of a given event depends on the tier
- * range that it falls into, where each tier range is defined by an upper and lower
- * bound. For example, the first few payments may have a 0.8 BPS take-rate and all
- * payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model.
- * In a one-dimensional matrix, the second value is `null`. Every configuration has a
- * list of `matrix_values` which give the unit prices for specified property values. In
- * a one-dimensional matrix, the matrix values will have `dimension_values` where the
- * second value of the pair is null. If an event does not match any of the dimension
- * values in the matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow
- * unit pricing. They also have an additional parameter `fixed_price_quantity`. If the
- * Price represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
@JsonProperty("price") @ExcludeMissing fun _price(): JsonField = price
@@ -836,228 +404,8 @@ private constructor(
* is serialized differently in a given Price object. The model_type field
* determines the key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For
- * example, the first ten units may cost $0.50 each and all units thereafter may
- * cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units.
- * For example, if you've bought less than 10 units, they may each be $0.50 for a
- * total of $5.00. Once you've bought more than 10 units, all units may now be
- * priced at $0.40 (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes.
- * For example, if the package size is set to 5, then 4 units will be billed as 5
- * and 6 units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to
- * assess. For example, this would allow you to assess a fee of 0.25% on every
- * payment you process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
- * total quantity across all events. Similar to bulk pricing, the BPS parameters of
- * a given event depends on the tier range that the billing period falls into. Each
- * tier range is defined by an upper bound. For example, after $1.5M of payment
- * volume is reached, each individual payment may have a lower cap or a smaller
- * take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
- * event's applicable parameter is a function of its marginal addition to the period
- * total. Similar to tiered pricing, the BPS parameters of a given event depends on
- * the tier range that it falls into, where each tier range is defined by an upper
- * and lower bound. For example, the first few payments may have a 0.8 BPS take-rate
- * and all payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing
- * model. In a one-dimensional matrix, the second value is `null`. Every
- * configuration has a list of `matrix_values` which give the unit prices for
- * specified property values. In a one-dimensional matrix, the matrix values will
- * have `dimension_values` where the second value of the pair is null. If an event
- * does not match any of the dimension values in the matrix, it will resort to the
- * `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and
- * follow unit pricing. They also have an additional parameter
- * `fixed_price_quantity`. If the Price represents a fixed cost, this represents the
- * quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(price: Price) = price(JsonField.of(price))
@@ -1070,228 +418,8 @@ private constructor(
* is serialized differently in a given Price object. The model_type field
* determines the key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For
- * example, the first ten units may cost $0.50 each and all units thereafter may
- * cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units.
- * For example, if you've bought less than 10 units, they may each be $0.50 for a
- * total of $5.00. Once you've bought more than 10 units, all units may now be
- * priced at $0.40 (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes.
- * For example, if the package size is set to 5, then 4 units will be billed as 5
- * and 6 units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to
- * assess. For example, this would allow you to assess a fee of 0.25% on every
- * payment you process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
- * total quantity across all events. Similar to bulk pricing, the BPS parameters of
- * a given event depends on the tier range that the billing period falls into. Each
- * tier range is defined by an upper bound. For example, after $1.5M of payment
- * volume is reached, each individual payment may have a lower cap or a smaller
- * take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
- * event's applicable parameter is a function of its marginal addition to the period
- * total. Similar to tiered pricing, the BPS parameters of a given event depends on
- * the tier range that it falls into, where each tier range is defined by an upper
- * and lower bound. For example, the first few payments may have a 0.8 BPS take-rate
- * and all payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing
- * model. In a one-dimensional matrix, the second value is `null`. Every
- * configuration has a list of `matrix_values` which give the unit prices for
- * specified property values. In a one-dimensional matrix, the matrix values will
- * have `dimension_values` where the second value of the pair is null. If an event
- * does not match any of the dimension values in the matrix, it will resort to the
- * `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and
- * follow unit pricing. They also have an additional parameter
- * `fixed_price_quantity`. If the Price represents a fixed cost, this represents the
- * quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(price: JsonField) = apply { this.price = price }
@@ -1304,228 +432,8 @@ private constructor(
* is serialized differently in a given Price object. The model_type field
* determines the key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For
- * example, the first ten units may cost $0.50 each and all units thereafter may
- * cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units.
- * For example, if you've bought less than 10 units, they may each be $0.50 for a
- * total of $5.00. Once you've bought more than 10 units, all units may now be
- * priced at $0.40 (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes.
- * For example, if the package size is set to 5, then 4 units will be billed as 5
- * and 6 units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to
- * assess. For example, this would allow you to assess a fee of 0.25% on every
- * payment you process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
- * total quantity across all events. Similar to bulk pricing, the BPS parameters of
- * a given event depends on the tier range that the billing period falls into. Each
- * tier range is defined by an upper bound. For example, after $1.5M of payment
- * volume is reached, each individual payment may have a lower cap or a smaller
- * take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
- * event's applicable parameter is a function of its marginal addition to the period
- * total. Similar to tiered pricing, the BPS parameters of a given event depends on
- * the tier range that it falls into, where each tier range is defined by an upper
- * and lower bound. For example, the first few payments may have a 0.8 BPS take-rate
- * and all payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing
- * model. In a one-dimensional matrix, the second value is `null`. Every
- * configuration has a list of `matrix_values` which give the unit prices for
- * specified property values. In a one-dimensional matrix, the matrix values will
- * have `dimension_values` where the second value of the pair is null. If an event
- * does not match any of the dimension values in the matrix, it will resort to the
- * `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and
- * follow unit pricing. They also have an additional parameter
- * `fixed_price_quantity`. If the Price represents a fixed cost, this represents the
- * quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(unitPrice: Price.UnitPrice) = price(Price.ofUnitPrice(unitPrice))
@@ -1538,228 +446,8 @@ private constructor(
* is serialized differently in a given Price object. The model_type field
* determines the key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For
- * example, the first ten units may cost $0.50 each and all units thereafter may
- * cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units.
- * For example, if you've bought less than 10 units, they may each be $0.50 for a
- * total of $5.00. Once you've bought more than 10 units, all units may now be
- * priced at $0.40 (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes.
- * For example, if the package size is set to 5, then 4 units will be billed as 5
- * and 6 units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to
- * assess. For example, this would allow you to assess a fee of 0.25% on every
- * payment you process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
- * total quantity across all events. Similar to bulk pricing, the BPS parameters of
- * a given event depends on the tier range that the billing period falls into. Each
- * tier range is defined by an upper bound. For example, after $1.5M of payment
- * volume is reached, each individual payment may have a lower cap or a smaller
- * take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
- * event's applicable parameter is a function of its marginal addition to the period
- * total. Similar to tiered pricing, the BPS parameters of a given event depends on
- * the tier range that it falls into, where each tier range is defined by an upper
- * and lower bound. For example, the first few payments may have a 0.8 BPS take-rate
- * and all payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing
- * model. In a one-dimensional matrix, the second value is `null`. Every
- * configuration has a list of `matrix_values` which give the unit prices for
- * specified property values. In a one-dimensional matrix, the matrix values will
- * have `dimension_values` where the second value of the pair is null. If an event
- * does not match any of the dimension values in the matrix, it will resort to the
- * `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and
- * follow unit pricing. They also have an additional parameter
- * `fixed_price_quantity`. If the Price represents a fixed cost, this represents the
- * quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(packagePrice: Price.PackagePrice) =
price(Price.ofPackagePrice(packagePrice))
@@ -1773,228 +461,8 @@ private constructor(
* is serialized differently in a given Price object. The model_type field
* determines the key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For
- * example, the first ten units may cost $0.50 each and all units thereafter may
- * cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units.
- * For example, if you've bought less than 10 units, they may each be $0.50 for a
- * total of $5.00. Once you've bought more than 10 units, all units may now be
- * priced at $0.40 (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes.
- * For example, if the package size is set to 5, then 4 units will be billed as 5
- * and 6 units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to
- * assess. For example, this would allow you to assess a fee of 0.25% on every
- * payment you process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
- * total quantity across all events. Similar to bulk pricing, the BPS parameters of
- * a given event depends on the tier range that the billing period falls into. Each
- * tier range is defined by an upper bound. For example, after $1.5M of payment
- * volume is reached, each individual payment may have a lower cap or a smaller
- * take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
- * event's applicable parameter is a function of its marginal addition to the period
- * total. Similar to tiered pricing, the BPS parameters of a given event depends on
- * the tier range that it falls into, where each tier range is defined by an upper
- * and lower bound. For example, the first few payments may have a 0.8 BPS take-rate
- * and all payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing
- * model. In a one-dimensional matrix, the second value is `null`. Every
- * configuration has a list of `matrix_values` which give the unit prices for
- * specified property values. In a one-dimensional matrix, the matrix values will
- * have `dimension_values` where the second value of the pair is null. If an event
- * does not match any of the dimension values in the matrix, it will resort to the
- * `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and
- * follow unit pricing. They also have an additional parameter
- * `fixed_price_quantity`. If the Price represents a fixed cost, this represents the
- * quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(matrixPrice: Price.MatrixPrice) = price(Price.ofMatrixPrice(matrixPrice))
@@ -2007,228 +475,8 @@ private constructor(
* is serialized differently in a given Price object. The model_type field
* determines the key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For
- * example, the first ten units may cost $0.50 each and all units thereafter may
- * cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units.
- * For example, if you've bought less than 10 units, they may each be $0.50 for a
- * total of $5.00. Once you've bought more than 10 units, all units may now be
- * priced at $0.40 (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes.
- * For example, if the package size is set to 5, then 4 units will be billed as 5
- * and 6 units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to
- * assess. For example, this would allow you to assess a fee of 0.25% on every
- * payment you process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
- * total quantity across all events. Similar to bulk pricing, the BPS parameters of
- * a given event depends on the tier range that the billing period falls into. Each
- * tier range is defined by an upper bound. For example, after $1.5M of payment
- * volume is reached, each individual payment may have a lower cap or a smaller
- * take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
- * event's applicable parameter is a function of its marginal addition to the period
- * total. Similar to tiered pricing, the BPS parameters of a given event depends on
- * the tier range that it falls into, where each tier range is defined by an upper
- * and lower bound. For example, the first few payments may have a 0.8 BPS take-rate
- * and all payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing
- * model. In a one-dimensional matrix, the second value is `null`. Every
- * configuration has a list of `matrix_values` which give the unit prices for
- * specified property values. In a one-dimensional matrix, the matrix values will
- * have `dimension_values` where the second value of the pair is null. If an event
- * does not match any of the dimension values in the matrix, it will resort to the
- * `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and
- * follow unit pricing. They also have an additional parameter
- * `fixed_price_quantity`. If the Price represents a fixed cost, this represents the
- * quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(tieredPrice: Price.TieredPrice) = price(Price.ofTieredPrice(tieredPrice))
@@ -2241,228 +489,8 @@ private constructor(
* is serialized differently in a given Price object. The model_type field
* determines the key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For
- * example, the first ten units may cost $0.50 each and all units thereafter may
- * cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units.
- * For example, if you've bought less than 10 units, they may each be $0.50 for a
- * total of $5.00. Once you've bought more than 10 units, all units may now be
- * priced at $0.40 (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes.
- * For example, if the package size is set to 5, then 4 units will be billed as 5
- * and 6 units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to
- * assess. For example, this would allow you to assess a fee of 0.25% on every
- * payment you process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
- * total quantity across all events. Similar to bulk pricing, the BPS parameters of
- * a given event depends on the tier range that the billing period falls into. Each
- * tier range is defined by an upper bound. For example, after $1.5M of payment
- * volume is reached, each individual payment may have a lower cap or a smaller
- * take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
- * event's applicable parameter is a function of its marginal addition to the period
- * total. Similar to tiered pricing, the BPS parameters of a given event depends on
- * the tier range that it falls into, where each tier range is defined by an upper
- * and lower bound. For example, the first few payments may have a 0.8 BPS take-rate
- * and all payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing
- * model. In a one-dimensional matrix, the second value is `null`. Every
- * configuration has a list of `matrix_values` which give the unit prices for
- * specified property values. In a one-dimensional matrix, the matrix values will
- * have `dimension_values` where the second value of the pair is null. If an event
- * does not match any of the dimension values in the matrix, it will resort to the
- * `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and
- * follow unit pricing. They also have an additional parameter
- * `fixed_price_quantity`. If the Price represents a fixed cost, this represents the
- * quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(tieredBpsPrice: Price.TieredBpsPrice) =
price(Price.ofTieredBpsPrice(tieredBpsPrice))
@@ -2476,697 +504,37 @@ private constructor(
* is serialized differently in a given Price object. The model_type field
* determines the key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
+ */
+ fun price(bpsPrice: Price.BpsPrice) = price(Price.ofBpsPrice(bpsPrice))
+
+ /**
+ * The Price resource represents a price that can be billed on a subscription,
+ * resulting in a charge on an invoice in the form of an invoice line item. Prices
+ * take a quantity and determine an amount to bill.
*
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
+ * Orb supports a few different pricing models out of the box. Each of these models
+ * is serialized differently in a given Price object. The model_type field
+ * determines the key for the configuration object that is present.
*
- * ## Tiered pricing
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
+ */
+ fun price(bulkBpsPrice: Price.BulkBpsPrice) =
+ price(Price.ofBulkBpsPrice(bulkBpsPrice))
+
+ /**
+ * The Price resource represents a price that can be billed on a subscription,
+ * resulting in a charge on an invoice in the form of an invoice line item. Prices
+ * take a quantity and determine an amount to bill.
*
- * In tiered pricing, the cost of a given unit depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For
- * example, the first ten units may cost $0.50 each and all units thereafter may
- * cost $0.10 each.
+ * Orb supports a few different pricing models out of the box. Each of these models
+ * is serialized differently in a given Price object. The model_type field
+ * determines the key for the configuration object that is present.
*
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units.
- * For example, if you've bought less than 10 units, they may each be $0.50 for a
- * total of $5.00. Once you've bought more than 10 units, all units may now be
- * priced at $0.40 (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes.
- * For example, if the package size is set to 5, then 4 units will be billed as 5
- * and 6 units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to
- * assess. For example, this would allow you to assess a fee of 0.25% on every
- * payment you process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
- * total quantity across all events. Similar to bulk pricing, the BPS parameters of
- * a given event depends on the tier range that the billing period falls into. Each
- * tier range is defined by an upper bound. For example, after $1.5M of payment
- * volume is reached, each individual payment may have a lower cap or a smaller
- * take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
- * event's applicable parameter is a function of its marginal addition to the period
- * total. Similar to tiered pricing, the BPS parameters of a given event depends on
- * the tier range that it falls into, where each tier range is defined by an upper
- * and lower bound. For example, the first few payments may have a 0.8 BPS take-rate
- * and all payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing
- * model. In a one-dimensional matrix, the second value is `null`. Every
- * configuration has a list of `matrix_values` which give the unit prices for
- * specified property values. In a one-dimensional matrix, the matrix values will
- * have `dimension_values` where the second value of the pair is null. If an event
- * does not match any of the dimension values in the matrix, it will resort to the
- * `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and
- * follow unit pricing. They also have an additional parameter
- * `fixed_price_quantity`. If the Price represents a fixed cost, this represents the
- * quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
- */
- fun price(bpsPrice: Price.BpsPrice) = price(Price.ofBpsPrice(bpsPrice))
-
- /**
- * The Price resource represents a price that can be billed on a subscription,
- * resulting in a charge on an invoice in the form of an invoice line item. Prices
- * take a quantity and determine an amount to bill.
- *
- * Orb supports a few different pricing models out of the box. Each of these models
- * is serialized differently in a given Price object. The model_type field
- * determines the key for the configuration object that is present.
- *
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For
- * example, the first ten units may cost $0.50 each and all units thereafter may
- * cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units.
- * For example, if you've bought less than 10 units, they may each be $0.50 for a
- * total of $5.00. Once you've bought more than 10 units, all units may now be
- * priced at $0.40 (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes.
- * For example, if the package size is set to 5, then 4 units will be billed as 5
- * and 6 units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to
- * assess. For example, this would allow you to assess a fee of 0.25% on every
- * payment you process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
- * total quantity across all events. Similar to bulk pricing, the BPS parameters of
- * a given event depends on the tier range that the billing period falls into. Each
- * tier range is defined by an upper bound. For example, after $1.5M of payment
- * volume is reached, each individual payment may have a lower cap or a smaller
- * take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
- * event's applicable parameter is a function of its marginal addition to the period
- * total. Similar to tiered pricing, the BPS parameters of a given event depends on
- * the tier range that it falls into, where each tier range is defined by an upper
- * and lower bound. For example, the first few payments may have a 0.8 BPS take-rate
- * and all payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing
- * model. In a one-dimensional matrix, the second value is `null`. Every
- * configuration has a list of `matrix_values` which give the unit prices for
- * specified property values. In a one-dimensional matrix, the matrix values will
- * have `dimension_values` where the second value of the pair is null. If an event
- * does not match any of the dimension values in the matrix, it will resort to the
- * `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and
- * follow unit pricing. They also have an additional parameter
- * `fixed_price_quantity`. If the Price represents a fixed cost, this represents the
- * quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
- */
- fun price(bulkBpsPrice: Price.BulkBpsPrice) =
- price(Price.ofBulkBpsPrice(bulkBpsPrice))
-
- /**
- * The Price resource represents a price that can be billed on a subscription,
- * resulting in a charge on an invoice in the form of an invoice line item. Prices
- * take a quantity and determine an amount to bill.
- *
- * Orb supports a few different pricing models out of the box. Each of these models
- * is serialized differently in a given Price object. The model_type field
- * determines the key for the configuration object that is present.
- *
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For
- * example, the first ten units may cost $0.50 each and all units thereafter may
- * cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units.
- * For example, if you've bought less than 10 units, they may each be $0.50 for a
- * total of $5.00. Once you've bought more than 10 units, all units may now be
- * priced at $0.40 (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes.
- * For example, if the package size is set to 5, then 4 units will be billed as 5
- * and 6 units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to
- * assess. For example, this would allow you to assess a fee of 0.25% on every
- * payment you process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
- * total quantity across all events. Similar to bulk pricing, the BPS parameters of
- * a given event depends on the tier range that the billing period falls into. Each
- * tier range is defined by an upper bound. For example, after $1.5M of payment
- * volume is reached, each individual payment may have a lower cap or a smaller
- * take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
- * event's applicable parameter is a function of its marginal addition to the period
- * total. Similar to tiered pricing, the BPS parameters of a given event depends on
- * the tier range that it falls into, where each tier range is defined by an upper
- * and lower bound. For example, the first few payments may have a 0.8 BPS take-rate
- * and all payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing
- * model. In a one-dimensional matrix, the second value is `null`. Every
- * configuration has a list of `matrix_values` which give the unit prices for
- * specified property values. In a one-dimensional matrix, the matrix values will
- * have `dimension_values` where the second value of the pair is null. If an event
- * does not match any of the dimension values in the matrix, it will resort to the
- * `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and
- * follow unit pricing. They also have an additional parameter
- * `fixed_price_quantity`. If the Price represents a fixed cost, this represents the
- * quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(bulkPrice: Price.BulkPrice) = price(Price.ofBulkPrice(bulkPrice))
@@ -3179,228 +547,8 @@ private constructor(
* is serialized differently in a given Price object. The model_type field
* determines the key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For
- * example, the first ten units may cost $0.50 each and all units thereafter may
- * cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units.
- * For example, if you've bought less than 10 units, they may each be $0.50 for a
- * total of $5.00. Once you've bought more than 10 units, all units may now be
- * priced at $0.40 (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes.
- * For example, if the package size is set to 5, then 4 units will be billed as 5
- * and 6 units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to
- * assess. For example, this would allow you to assess a fee of 0.25% on every
- * payment you process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
- * total quantity across all events. Similar to bulk pricing, the BPS parameters of
- * a given event depends on the tier range that the billing period falls into. Each
- * tier range is defined by an upper bound. For example, after $1.5M of payment
- * volume is reached, each individual payment may have a lower cap or a smaller
- * take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
- * event's applicable parameter is a function of its marginal addition to the period
- * total. Similar to tiered pricing, the BPS parameters of a given event depends on
- * the tier range that it falls into, where each tier range is defined by an upper
- * and lower bound. For example, the first few payments may have a 0.8 BPS take-rate
- * and all payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing
- * model. In a one-dimensional matrix, the second value is `null`. Every
- * configuration has a list of `matrix_values` which give the unit prices for
- * specified property values. In a one-dimensional matrix, the matrix values will
- * have `dimension_values` where the second value of the pair is null. If an event
- * does not match any of the dimension values in the matrix, it will resort to the
- * `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and
- * follow unit pricing. They also have an additional parameter
- * `fixed_price_quantity`. If the Price represents a fixed cost, this represents the
- * quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(thresholdTotalAmountPrice: Price.ThresholdTotalAmountPrice) =
price(Price.ofThresholdTotalAmountPrice(thresholdTotalAmountPrice))
@@ -3414,228 +562,8 @@ private constructor(
* is serialized differently in a given Price object. The model_type field
* determines the key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For
- * example, the first ten units may cost $0.50 each and all units thereafter may
- * cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units.
- * For example, if you've bought less than 10 units, they may each be $0.50 for a
- * total of $5.00. Once you've bought more than 10 units, all units may now be
- * priced at $0.40 (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes.
- * For example, if the package size is set to 5, then 4 units will be billed as 5
- * and 6 units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to
- * assess. For example, this would allow you to assess a fee of 0.25% on every
- * payment you process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
- * total quantity across all events. Similar to bulk pricing, the BPS parameters of
- * a given event depends on the tier range that the billing period falls into. Each
- * tier range is defined by an upper bound. For example, after $1.5M of payment
- * volume is reached, each individual payment may have a lower cap or a smaller
- * take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
- * event's applicable parameter is a function of its marginal addition to the period
- * total. Similar to tiered pricing, the BPS parameters of a given event depends on
- * the tier range that it falls into, where each tier range is defined by an upper
- * and lower bound. For example, the first few payments may have a 0.8 BPS take-rate
- * and all payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing
- * model. In a one-dimensional matrix, the second value is `null`. Every
- * configuration has a list of `matrix_values` which give the unit prices for
- * specified property values. In a one-dimensional matrix, the matrix values will
- * have `dimension_values` where the second value of the pair is null. If an event
- * does not match any of the dimension values in the matrix, it will resort to the
- * `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and
- * follow unit pricing. They also have an additional parameter
- * `fixed_price_quantity`. If the Price represents a fixed cost, this represents the
- * quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(tieredPackagePrice: Price.TieredPackagePrice) =
price(Price.ofTieredPackagePrice(tieredPackagePrice))
@@ -3649,228 +577,8 @@ private constructor(
* is serialized differently in a given Price object. The model_type field
* determines the key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For
- * example, the first ten units may cost $0.50 each and all units thereafter may
- * cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units.
- * For example, if you've bought less than 10 units, they may each be $0.50 for a
- * total of $5.00. Once you've bought more than 10 units, all units may now be
- * priced at $0.40 (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes.
- * For example, if the package size is set to 5, then 4 units will be billed as 5
- * and 6 units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to
- * assess. For example, this would allow you to assess a fee of 0.25% on every
- * payment you process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
- * total quantity across all events. Similar to bulk pricing, the BPS parameters of
- * a given event depends on the tier range that the billing period falls into. Each
- * tier range is defined by an upper bound. For example, after $1.5M of payment
- * volume is reached, each individual payment may have a lower cap or a smaller
- * take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
- * event's applicable parameter is a function of its marginal addition to the period
- * total. Similar to tiered pricing, the BPS parameters of a given event depends on
- * the tier range that it falls into, where each tier range is defined by an upper
- * and lower bound. For example, the first few payments may have a 0.8 BPS take-rate
- * and all payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing
- * model. In a one-dimensional matrix, the second value is `null`. Every
- * configuration has a list of `matrix_values` which give the unit prices for
- * specified property values. In a one-dimensional matrix, the matrix values will
- * have `dimension_values` where the second value of the pair is null. If an event
- * does not match any of the dimension values in the matrix, it will resort to the
- * `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and
- * follow unit pricing. They also have an additional parameter
- * `fixed_price_quantity`. If the Price represents a fixed cost, this represents the
- * quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(groupedTieredPrice: Price.GroupedTieredPrice) =
price(Price.ofGroupedTieredPrice(groupedTieredPrice))
@@ -3884,228 +592,8 @@ private constructor(
* is serialized differently in a given Price object. The model_type field
* determines the key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For
- * example, the first ten units may cost $0.50 each and all units thereafter may
- * cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units.
- * For example, if you've bought less than 10 units, they may each be $0.50 for a
- * total of $5.00. Once you've bought more than 10 units, all units may now be
- * priced at $0.40 (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes.
- * For example, if the package size is set to 5, then 4 units will be billed as 5
- * and 6 units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to
- * assess. For example, this would allow you to assess a fee of 0.25% on every
- * payment you process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
- * total quantity across all events. Similar to bulk pricing, the BPS parameters of
- * a given event depends on the tier range that the billing period falls into. Each
- * tier range is defined by an upper bound. For example, after $1.5M of payment
- * volume is reached, each individual payment may have a lower cap or a smaller
- * take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
- * event's applicable parameter is a function of its marginal addition to the period
- * total. Similar to tiered pricing, the BPS parameters of a given event depends on
- * the tier range that it falls into, where each tier range is defined by an upper
- * and lower bound. For example, the first few payments may have a 0.8 BPS take-rate
- * and all payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing
- * model. In a one-dimensional matrix, the second value is `null`. Every
- * configuration has a list of `matrix_values` which give the unit prices for
- * specified property values. In a one-dimensional matrix, the matrix values will
- * have `dimension_values` where the second value of the pair is null. If an event
- * does not match any of the dimension values in the matrix, it will resort to the
- * `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and
- * follow unit pricing. They also have an additional parameter
- * `fixed_price_quantity`. If the Price represents a fixed cost, this represents the
- * quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(tieredWithMinimumPrice: Price.TieredWithMinimumPrice) =
price(Price.ofTieredWithMinimumPrice(tieredWithMinimumPrice))
@@ -4119,228 +607,8 @@ private constructor(
* is serialized differently in a given Price object. The model_type field
* determines the key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For
- * example, the first ten units may cost $0.50 each and all units thereafter may
- * cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units.
- * For example, if you've bought less than 10 units, they may each be $0.50 for a
- * total of $5.00. Once you've bought more than 10 units, all units may now be
- * priced at $0.40 (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes.
- * For example, if the package size is set to 5, then 4 units will be billed as 5
- * and 6 units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to
- * assess. For example, this would allow you to assess a fee of 0.25% on every
- * payment you process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
- * total quantity across all events. Similar to bulk pricing, the BPS parameters of
- * a given event depends on the tier range that the billing period falls into. Each
- * tier range is defined by an upper bound. For example, after $1.5M of payment
- * volume is reached, each individual payment may have a lower cap or a smaller
- * take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
- * event's applicable parameter is a function of its marginal addition to the period
- * total. Similar to tiered pricing, the BPS parameters of a given event depends on
- * the tier range that it falls into, where each tier range is defined by an upper
- * and lower bound. For example, the first few payments may have a 0.8 BPS take-rate
- * and all payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing
- * model. In a one-dimensional matrix, the second value is `null`. Every
- * configuration has a list of `matrix_values` which give the unit prices for
- * specified property values. In a one-dimensional matrix, the matrix values will
- * have `dimension_values` where the second value of the pair is null. If an event
- * does not match any of the dimension values in the matrix, it will resort to the
- * `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and
- * follow unit pricing. They also have an additional parameter
- * `fixed_price_quantity`. If the Price represents a fixed cost, this represents the
- * quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(tieredPackageWithMinimumPrice: Price.TieredPackageWithMinimumPrice) =
price(Price.ofTieredPackageWithMinimumPrice(tieredPackageWithMinimumPrice))
@@ -4354,228 +622,8 @@ private constructor(
* is serialized differently in a given Price object. The model_type field
* determines the key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For
- * example, the first ten units may cost $0.50 each and all units thereafter may
- * cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units.
- * For example, if you've bought less than 10 units, they may each be $0.50 for a
- * total of $5.00. Once you've bought more than 10 units, all units may now be
- * priced at $0.40 (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes.
- * For example, if the package size is set to 5, then 4 units will be billed as 5
- * and 6 units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to
- * assess. For example, this would allow you to assess a fee of 0.25% on every
- * payment you process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
- * total quantity across all events. Similar to bulk pricing, the BPS parameters of
- * a given event depends on the tier range that the billing period falls into. Each
- * tier range is defined by an upper bound. For example, after $1.5M of payment
- * volume is reached, each individual payment may have a lower cap or a smaller
- * take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
- * event's applicable parameter is a function of its marginal addition to the period
- * total. Similar to tiered pricing, the BPS parameters of a given event depends on
- * the tier range that it falls into, where each tier range is defined by an upper
- * and lower bound. For example, the first few payments may have a 0.8 BPS take-rate
- * and all payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing
- * model. In a one-dimensional matrix, the second value is `null`. Every
- * configuration has a list of `matrix_values` which give the unit prices for
- * specified property values. In a one-dimensional matrix, the matrix values will
- * have `dimension_values` where the second value of the pair is null. If an event
- * does not match any of the dimension values in the matrix, it will resort to the
- * `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and
- * follow unit pricing. They also have an additional parameter
- * `fixed_price_quantity`. If the Price represents a fixed cost, this represents the
- * quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(packageWithAllocationPrice: Price.PackageWithAllocationPrice) =
price(Price.ofPackageWithAllocationPrice(packageWithAllocationPrice))
@@ -4589,463 +637,23 @@ private constructor(
* is serialized differently in a given Price object. The model_type field
* determines the key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For
- * example, the first ten units may cost $0.50 each and all units thereafter may
- * cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units.
- * For example, if you've bought less than 10 units, they may each be $0.50 for a
- * total of $5.00. Once you've bought more than 10 units, all units may now be
- * priced at $0.40 (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes.
- * For example, if the package size is set to 5, then 4 units will be billed as 5
- * and 6 units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to
- * assess. For example, this would allow you to assess a fee of 0.25% on every
- * payment you process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
- * total quantity across all events. Similar to bulk pricing, the BPS parameters of
- * a given event depends on the tier range that the billing period falls into. Each
- * tier range is defined by an upper bound. For example, after $1.5M of payment
- * volume is reached, each individual payment may have a lower cap or a smaller
- * take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
- * event's applicable parameter is a function of its marginal addition to the period
- * total. Similar to tiered pricing, the BPS parameters of a given event depends on
- * the tier range that it falls into, where each tier range is defined by an upper
- * and lower bound. For example, the first few payments may have a 0.8 BPS take-rate
- * and all payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing
- * model. In a one-dimensional matrix, the second value is `null`. Every
- * configuration has a list of `matrix_values` which give the unit prices for
- * specified property values. In a one-dimensional matrix, the matrix values will
- * have `dimension_values` where the second value of the pair is null. If an event
- * does not match any of the dimension values in the matrix, it will resort to the
- * `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and
- * follow unit pricing. They also have an additional parameter
- * `fixed_price_quantity`. If the Price represents a fixed cost, this represents the
- * quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
- */
- fun price(unitWithPercentPrice: Price.UnitWithPercentPrice) =
- price(Price.ofUnitWithPercentPrice(unitWithPercentPrice))
-
- /**
- * The Price resource represents a price that can be billed on a subscription,
- * resulting in a charge on an invoice in the form of an invoice line item. Prices
- * take a quantity and determine an amount to bill.
- *
- * Orb supports a few different pricing models out of the box. Each of these models
- * is serialized differently in a given Price object. The model_type field
- * determines the key for the configuration object that is present.
- *
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For
- * example, the first ten units may cost $0.50 each and all units thereafter may
- * cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units.
- * For example, if you've bought less than 10 units, they may each be $0.50 for a
- * total of $5.00. Once you've bought more than 10 units, all units may now be
- * priced at $0.40 (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes.
- * For example, if the package size is set to 5, then 4 units will be billed as 5
- * and 6 units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to
- * assess. For example, this would allow you to assess a fee of 0.25% on every
- * payment you process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
- * total quantity across all events. Similar to bulk pricing, the BPS parameters of
- * a given event depends on the tier range that the billing period falls into. Each
- * tier range is defined by an upper bound. For example, after $1.5M of payment
- * volume is reached, each individual payment may have a lower cap or a smaller
- * take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
- * event's applicable parameter is a function of its marginal addition to the period
- * total. Similar to tiered pricing, the BPS parameters of a given event depends on
- * the tier range that it falls into, where each tier range is defined by an upper
- * and lower bound. For example, the first few payments may have a 0.8 BPS take-rate
- * and all payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing
- * model. In a one-dimensional matrix, the second value is `null`. Every
- * configuration has a list of `matrix_values` which give the unit prices for
- * specified property values. In a one-dimensional matrix, the matrix values will
- * have `dimension_values` where the second value of the pair is null. If an event
- * does not match any of the dimension values in the matrix, it will resort to the
- * `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
+ */
+ fun price(unitWithPercentPrice: Price.UnitWithPercentPrice) =
+ price(Price.ofUnitWithPercentPrice(unitWithPercentPrice))
+
+ /**
+ * The Price resource represents a price that can be billed on a subscription,
+ * resulting in a charge on an invoice in the form of an invoice line item. Prices
+ * take a quantity and determine an amount to bill.
*
- * Fixed fees are prices that are applied independent of usage quantities, and
- * follow unit pricing. They also have an additional parameter
- * `fixed_price_quantity`. If the Price represents a fixed cost, this represents the
- * quantity of units applied.
+ * Orb supports a few different pricing models out of the box. Each of these models
+ * is serialized differently in a given Price object. The model_type field
+ * determines the key for the configuration object that is present.
*
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(matrixWithAllocationPrice: Price.MatrixWithAllocationPrice) =
price(Price.ofMatrixWithAllocationPrice(matrixWithAllocationPrice))
@@ -5059,228 +667,8 @@ private constructor(
* is serialized differently in a given Price object. The model_type field
* determines the key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For
- * example, the first ten units may cost $0.50 each and all units thereafter may
- * cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units.
- * For example, if you've bought less than 10 units, they may each be $0.50 for a
- * total of $5.00. Once you've bought more than 10 units, all units may now be
- * priced at $0.40 (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes.
- * For example, if the package size is set to 5, then 4 units will be billed as 5
- * and 6 units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to
- * assess. For example, this would allow you to assess a fee of 0.25% on every
- * payment you process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
- * total quantity across all events. Similar to bulk pricing, the BPS parameters of
- * a given event depends on the tier range that the billing period falls into. Each
- * tier range is defined by an upper bound. For example, after $1.5M of payment
- * volume is reached, each individual payment may have a lower cap or a smaller
- * take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
- * event's applicable parameter is a function of its marginal addition to the period
- * total. Similar to tiered pricing, the BPS parameters of a given event depends on
- * the tier range that it falls into, where each tier range is defined by an upper
- * and lower bound. For example, the first few payments may have a 0.8 BPS take-rate
- * and all payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing
- * model. In a one-dimensional matrix, the second value is `null`. Every
- * configuration has a list of `matrix_values` which give the unit prices for
- * specified property values. In a one-dimensional matrix, the matrix values will
- * have `dimension_values` where the second value of the pair is null. If an event
- * does not match any of the dimension values in the matrix, it will resort to the
- * `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and
- * follow unit pricing. They also have an additional parameter
- * `fixed_price_quantity`. If the Price represents a fixed cost, this represents the
- * quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(tieredWithProrationPrice: Price.TieredWithProrationPrice) =
price(Price.ofTieredWithProrationPrice(tieredWithProrationPrice))
@@ -5294,228 +682,8 @@ private constructor(
* is serialized differently in a given Price object. The model_type field
* determines the key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For
- * example, the first ten units may cost $0.50 each and all units thereafter may
- * cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units.
- * For example, if you've bought less than 10 units, they may each be $0.50 for a
- * total of $5.00. Once you've bought more than 10 units, all units may now be
- * priced at $0.40 (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes.
- * For example, if the package size is set to 5, then 4 units will be billed as 5
- * and 6 units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to
- * assess. For example, this would allow you to assess a fee of 0.25% on every
- * payment you process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
- * total quantity across all events. Similar to bulk pricing, the BPS parameters of
- * a given event depends on the tier range that the billing period falls into. Each
- * tier range is defined by an upper bound. For example, after $1.5M of payment
- * volume is reached, each individual payment may have a lower cap or a smaller
- * take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
- * event's applicable parameter is a function of its marginal addition to the period
- * total. Similar to tiered pricing, the BPS parameters of a given event depends on
- * the tier range that it falls into, where each tier range is defined by an upper
- * and lower bound. For example, the first few payments may have a 0.8 BPS take-rate
- * and all payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing
- * model. In a one-dimensional matrix, the second value is `null`. Every
- * configuration has a list of `matrix_values` which give the unit prices for
- * specified property values. In a one-dimensional matrix, the matrix values will
- * have `dimension_values` where the second value of the pair is null. If an event
- * does not match any of the dimension values in the matrix, it will resort to the
- * `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and
- * follow unit pricing. They also have an additional parameter
- * `fixed_price_quantity`. If the Price represents a fixed cost, this represents the
- * quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(unitWithProrationPrice: Price.UnitWithProrationPrice) =
price(Price.ofUnitWithProrationPrice(unitWithProrationPrice))
@@ -5529,228 +697,8 @@ private constructor(
* is serialized differently in a given Price object. The model_type field
* determines the key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For
- * example, the first ten units may cost $0.50 each and all units thereafter may
- * cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units.
- * For example, if you've bought less than 10 units, they may each be $0.50 for a
- * total of $5.00. Once you've bought more than 10 units, all units may now be
- * priced at $0.40 (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes.
- * For example, if the package size is set to 5, then 4 units will be billed as 5
- * and 6 units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to
- * assess. For example, this would allow you to assess a fee of 0.25% on every
- * payment you process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
- * total quantity across all events. Similar to bulk pricing, the BPS parameters of
- * a given event depends on the tier range that the billing period falls into. Each
- * tier range is defined by an upper bound. For example, after $1.5M of payment
- * volume is reached, each individual payment may have a lower cap or a smaller
- * take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
- * event's applicable parameter is a function of its marginal addition to the period
- * total. Similar to tiered pricing, the BPS parameters of a given event depends on
- * the tier range that it falls into, where each tier range is defined by an upper
- * and lower bound. For example, the first few payments may have a 0.8 BPS take-rate
- * and all payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing
- * model. In a one-dimensional matrix, the second value is `null`. Every
- * configuration has a list of `matrix_values` which give the unit prices for
- * specified property values. In a one-dimensional matrix, the matrix values will
- * have `dimension_values` where the second value of the pair is null. If an event
- * does not match any of the dimension values in the matrix, it will resort to the
- * `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and
- * follow unit pricing. They also have an additional parameter
- * `fixed_price_quantity`. If the Price represents a fixed cost, this represents the
- * quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(groupedAllocationPrice: Price.GroupedAllocationPrice) =
price(Price.ofGroupedAllocationPrice(groupedAllocationPrice))
@@ -5764,228 +712,8 @@ private constructor(
* is serialized differently in a given Price object. The model_type field
* determines the key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For
- * example, the first ten units may cost $0.50 each and all units thereafter may
- * cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units.
- * For example, if you've bought less than 10 units, they may each be $0.50 for a
- * total of $5.00. Once you've bought more than 10 units, all units may now be
- * priced at $0.40 (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes.
- * For example, if the package size is set to 5, then 4 units will be billed as 5
- * and 6 units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to
- * assess. For example, this would allow you to assess a fee of 0.25% on every
- * payment you process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
- * total quantity across all events. Similar to bulk pricing, the BPS parameters of
- * a given event depends on the tier range that the billing period falls into. Each
- * tier range is defined by an upper bound. For example, after $1.5M of payment
- * volume is reached, each individual payment may have a lower cap or a smaller
- * take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
- * event's applicable parameter is a function of its marginal addition to the period
- * total. Similar to tiered pricing, the BPS parameters of a given event depends on
- * the tier range that it falls into, where each tier range is defined by an upper
- * and lower bound. For example, the first few payments may have a 0.8 BPS take-rate
- * and all payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing
- * model. In a one-dimensional matrix, the second value is `null`. Every
- * configuration has a list of `matrix_values` which give the unit prices for
- * specified property values. In a one-dimensional matrix, the matrix values will
- * have `dimension_values` where the second value of the pair is null. If an event
- * does not match any of the dimension values in the matrix, it will resort to the
- * `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and
- * follow unit pricing. They also have an additional parameter
- * `fixed_price_quantity`. If the Price represents a fixed cost, this represents the
- * quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(groupedWithProratedMinimumPrice: Price.GroupedWithProratedMinimumPrice) =
price(Price.ofGroupedWithProratedMinimumPrice(groupedWithProratedMinimumPrice))
@@ -5999,228 +727,8 @@ private constructor(
* is serialized differently in a given Price object. The model_type field
* determines the key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For
- * example, the first ten units may cost $0.50 each and all units thereafter may
- * cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units.
- * For example, if you've bought less than 10 units, they may each be $0.50 for a
- * total of $5.00. Once you've bought more than 10 units, all units may now be
- * priced at $0.40 (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes.
- * For example, if the package size is set to 5, then 4 units will be billed as 5
- * and 6 units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to
- * assess. For example, this would allow you to assess a fee of 0.25% on every
- * payment you process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
- * total quantity across all events. Similar to bulk pricing, the BPS parameters of
- * a given event depends on the tier range that the billing period falls into. Each
- * tier range is defined by an upper bound. For example, after $1.5M of payment
- * volume is reached, each individual payment may have a lower cap or a smaller
- * take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
- * event's applicable parameter is a function of its marginal addition to the period
- * total. Similar to tiered pricing, the BPS parameters of a given event depends on
- * the tier range that it falls into, where each tier range is defined by an upper
- * and lower bound. For example, the first few payments may have a 0.8 BPS take-rate
- * and all payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing
- * model. In a one-dimensional matrix, the second value is `null`. Every
- * configuration has a list of `matrix_values` which give the unit prices for
- * specified property values. In a one-dimensional matrix, the matrix values will
- * have `dimension_values` where the second value of the pair is null. If an event
- * does not match any of the dimension values in the matrix, it will resort to the
- * `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and
- * follow unit pricing. They also have an additional parameter
- * `fixed_price_quantity`. If the Price represents a fixed cost, this represents the
- * quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(groupedWithMeteredMinimumPrice: Price.GroupedWithMeteredMinimumPrice) =
price(Price.ofGroupedWithMeteredMinimumPrice(groupedWithMeteredMinimumPrice))
@@ -6234,228 +742,8 @@ private constructor(
* is serialized differently in a given Price object. The model_type field
* determines the key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For
- * example, the first ten units may cost $0.50 each and all units thereafter may
- * cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units.
- * For example, if you've bought less than 10 units, they may each be $0.50 for a
- * total of $5.00. Once you've bought more than 10 units, all units may now be
- * priced at $0.40 (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes.
- * For example, if the package size is set to 5, then 4 units will be billed as 5
- * and 6 units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to
- * assess. For example, this would allow you to assess a fee of 0.25% on every
- * payment you process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
- * total quantity across all events. Similar to bulk pricing, the BPS parameters of
- * a given event depends on the tier range that the billing period falls into. Each
- * tier range is defined by an upper bound. For example, after $1.5M of payment
- * volume is reached, each individual payment may have a lower cap or a smaller
- * take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
- * event's applicable parameter is a function of its marginal addition to the period
- * total. Similar to tiered pricing, the BPS parameters of a given event depends on
- * the tier range that it falls into, where each tier range is defined by an upper
- * and lower bound. For example, the first few payments may have a 0.8 BPS take-rate
- * and all payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing
- * model. In a one-dimensional matrix, the second value is `null`. Every
- * configuration has a list of `matrix_values` which give the unit prices for
- * specified property values. In a one-dimensional matrix, the matrix values will
- * have `dimension_values` where the second value of the pair is null. If an event
- * does not match any of the dimension values in the matrix, it will resort to the
- * `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and
- * follow unit pricing. They also have an additional parameter
- * `fixed_price_quantity`. If the Price represents a fixed cost, this represents the
- * quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(matrixWithDisplayNamePrice: Price.MatrixWithDisplayNamePrice) =
price(Price.ofMatrixWithDisplayNamePrice(matrixWithDisplayNamePrice))
@@ -6469,228 +757,8 @@ private constructor(
* is serialized differently in a given Price object. The model_type field
* determines the key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For
- * example, the first ten units may cost $0.50 each and all units thereafter may
- * cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units.
- * For example, if you've bought less than 10 units, they may each be $0.50 for a
- * total of $5.00. Once you've bought more than 10 units, all units may now be
- * priced at $0.40 (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes.
- * For example, if the package size is set to 5, then 4 units will be billed as 5
- * and 6 units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to
- * assess. For example, this would allow you to assess a fee of 0.25% on every
- * payment you process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
- * total quantity across all events. Similar to bulk pricing, the BPS parameters of
- * a given event depends on the tier range that the billing period falls into. Each
- * tier range is defined by an upper bound. For example, after $1.5M of payment
- * volume is reached, each individual payment may have a lower cap or a smaller
- * take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
- * event's applicable parameter is a function of its marginal addition to the period
- * total. Similar to tiered pricing, the BPS parameters of a given event depends on
- * the tier range that it falls into, where each tier range is defined by an upper
- * and lower bound. For example, the first few payments may have a 0.8 BPS take-rate
- * and all payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing
- * model. In a one-dimensional matrix, the second value is `null`. Every
- * configuration has a list of `matrix_values` which give the unit prices for
- * specified property values. In a one-dimensional matrix, the matrix values will
- * have `dimension_values` where the second value of the pair is null. If an event
- * does not match any of the dimension values in the matrix, it will resort to the
- * `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and
- * follow unit pricing. They also have an additional parameter
- * `fixed_price_quantity`. If the Price represents a fixed cost, this represents the
- * quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(bulkWithProrationPrice: Price.BulkWithProrationPrice) =
price(Price.ofBulkWithProrationPrice(bulkWithProrationPrice))
@@ -6704,467 +772,12 @@ private constructor(
* is serialized differently in a given Price object. The model_type field
* determines the key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For
- * example, the first ten units may cost $0.50 each and all units thereafter may
- * cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units.
- * For example, if you've bought less than 10 units, they may each be $0.50 for a
- * total of $5.00. Once you've bought more than 10 units, all units may now be
- * priced at $0.40 (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes.
- * For example, if the package size is set to 5, then 4 units will be billed as 5
- * and 6 units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to
- * assess. For example, this would allow you to assess a fee of 0.25% on every
- * payment you process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
- * total quantity across all events. Similar to bulk pricing, the BPS parameters of
- * a given event depends on the tier range that the billing period falls into. Each
- * tier range is defined by an upper bound. For example, after $1.5M of payment
- * volume is reached, each individual payment may have a lower cap or a smaller
- * take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
- * event's applicable parameter is a function of its marginal addition to the period
- * total. Similar to tiered pricing, the BPS parameters of a given event depends on
- * the tier range that it falls into, where each tier range is defined by an upper
- * and lower bound. For example, the first few payments may have a 0.8 BPS take-rate
- * and all payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing
- * model. In a one-dimensional matrix, the second value is `null`. Every
- * configuration has a list of `matrix_values` which give the unit prices for
- * specified property values. In a one-dimensional matrix, the matrix values will
- * have `dimension_values` where the second value of the pair is null. If an event
- * does not match any of the dimension values in the matrix, it will resort to the
- * `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and
- * follow unit pricing. They also have an additional parameter
- * `fixed_price_quantity`. If the Price represents a fixed cost, this represents the
- * quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(groupedTieredPackagePrice: Price.GroupedTieredPackagePrice) =
price(Price.ofGroupedTieredPackagePrice(groupedTieredPackagePrice))
- /**
- * The Price resource represents a price that can be billed on a subscription,
- * resulting in a charge on an invoice in the form of an invoice line item. Prices
- * take a quantity and determine an amount to bill.
- *
- * Orb supports a few different pricing models out of the box. Each of these models
- * is serialized differently in a given Price object. The model_type field
- * determines the key for the configuration object that is present.
- *
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For
- * example, the first ten units may cost $0.50 each and all units thereafter may
- * cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units.
- * For example, if you've bought less than 10 units, they may each be $0.50 for a
- * total of $5.00. Once you've bought more than 10 units, all units may now be
- * priced at $0.40 (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes.
- * For example, if the package size is set to 5, then 4 units will be billed as 5
- * and 6 units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to
- * assess. For example, this would allow you to assess a fee of 0.25% on every
- * payment you process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
- * total quantity across all events. Similar to bulk pricing, the BPS parameters of
- * a given event depends on the tier range that the billing period falls into. Each
- * tier range is defined by an upper bound. For example, after $1.5M of payment
- * volume is reached, each individual payment may have a lower cap or a smaller
- * take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
- * event's applicable parameter is a function of its marginal addition to the period
- * total. Similar to tiered pricing, the BPS parameters of a given event depends on
- * the tier range that it falls into, where each tier range is defined by an upper
- * and lower bound. For example, the first few payments may have a 0.8 BPS take-rate
- * and all payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing
- * model. In a one-dimensional matrix, the second value is `null`. Every
- * configuration has a list of `matrix_values` which give the unit prices for
- * specified property values. In a one-dimensional matrix, the matrix values will
- * have `dimension_values` where the second value of the pair is null. If an event
- * does not match any of the dimension values in the matrix, it will resort to the
- * `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and
- * follow unit pricing. They also have an additional parameter
- * `fixed_price_quantity`. If the Price represents a fixed cost, this represents the
- * quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
- */
- fun price(maxGroupTieredPrice: Price.MaxGroupTieredPrice) =
- price(Price.ofMaxGroupTieredPrice(maxGroupTieredPrice))
-
/**
* Price's contributions for the timeframe, excluding any minimums and discounts.
*/
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 c33da7bc..214793b0 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
@@ -18,8 +18,8 @@ import java.util.Optional
/**
* This endpoint is used to fetch a day-by-day snapshot of a customer's costs in Orb, calculated by
* applying pricing information to the underlying usage (see the
- * [subscription usage endpoint](fetch-subscription-usage.api.mdx) to fetch usage per metric, in
- * usage units rather than a currency).
+ * [subscription usage endpoint](/api-reference/subscription/fetch-subscription-usage) to fetch
+ * usage per metric, in usage units rather than a currency).
*
* This endpoint can be leveraged for internal tooling and to provide a more transparent billing
* experience for your end users:
@@ -27,8 +27,8 @@ import java.util.Optional
* billing period.
* 2. Provide customer visibility into how different services are contributing to the overall
* invoice with a per-day timeseries (as compared to the
- * [upcoming invoice](fetch-upcoming-invoice) resource, which represents a snapshot for the
- * current period).
+ * [upcoming invoice](/api-reference/invoice/fetch-upcoming-invoice) resource, which represents a
+ * snapshot for the current period).
* 3. Assess how minimums and discounts affect your customers by teasing apart costs directly as a
* result of usage, as opposed to minimums and discounts at the plan and price level.
* 4. Gain insight into key customer health metrics, such as the percent utilization of the minimum
@@ -363,6 +363,11 @@ constructor(
)
}
+ /**
+ * Controls whether Orb returns cumulative costs since the start of the billing period, or
+ * incremental day-by-day costs. If your customer has minimums or discounts, it's strongly
+ * recommended that you use the default cumulative behavior.
+ */
class ViewMode
@JsonCreator
private constructor(
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 fc6d96f9..4ac301b3 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
@@ -313,224 +313,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the
* key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls
- * into, where each tier range is defined by an upper and lower bound. For example, the
- * first ten units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40
- * (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6
- * units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to assess.
- * For example, this would allow you to assess a fee of 0.25% on every payment you
- * process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given
- * event depends on the tier range that the billing period falls into. Each tier range
- * is defined by an upper bound. For example, after $1.5M of payment volume is reached,
- * each individual payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total.
- * Similar to tiered pricing, the BPS parameters of a given event depends on the tier
- * range that it falls into, where each tier range is defined by an upper and lower
- * bound. For example, the first few payments may have a 0.8 BPS take-rate and all
- * payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model.
- * In a one-dimensional matrix, the second value is `null`. Every configuration has a
- * list of `matrix_values` which give the unit prices for specified property values. In
- * a one-dimensional matrix, the matrix values will have `dimension_values` where the
- * second value of the pair is null. If an event does not match any of the dimension
- * values in the matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow
- * unit pricing. They also have an additional parameter `fixed_price_quantity`. If the
- * Price represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(): Price = price.getRequired("price")
@@ -552,224 +336,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the
* key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls
- * into, where each tier range is defined by an upper and lower bound. For example, the
- * first ten units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40
- * (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6
- * units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to assess.
- * For example, this would allow you to assess a fee of 0.25% on every payment you
- * process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given
- * event depends on the tier range that the billing period falls into. Each tier range
- * is defined by an upper bound. For example, after $1.5M of payment volume is reached,
- * each individual payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total.
- * Similar to tiered pricing, the BPS parameters of a given event depends on the tier
- * range that it falls into, where each tier range is defined by an upper and lower
- * bound. For example, the first few payments may have a 0.8 BPS take-rate and all
- * payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model.
- * In a one-dimensional matrix, the second value is `null`. Every configuration has a
- * list of `matrix_values` which give the unit prices for specified property values. In
- * a one-dimensional matrix, the matrix values will have `dimension_values` where the
- * second value of the pair is null. If an event does not match any of the dimension
- * values in the matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow
- * unit pricing. They also have an additional parameter `fixed_price_quantity`. If the
- * Price represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
@JsonProperty("price") @ExcludeMissing fun _price(): JsonField = price
@@ -833,228 +401,8 @@ private constructor(
* is serialized differently in a given Price object. The model_type field
* determines the key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For
- * example, the first ten units may cost $0.50 each and all units thereafter may
- * cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units.
- * For example, if you've bought less than 10 units, they may each be $0.50 for a
- * total of $5.00. Once you've bought more than 10 units, all units may now be
- * priced at $0.40 (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes.
- * For example, if the package size is set to 5, then 4 units will be billed as 5
- * and 6 units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to
- * assess. For example, this would allow you to assess a fee of 0.25% on every
- * payment you process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
- * total quantity across all events. Similar to bulk pricing, the BPS parameters of
- * a given event depends on the tier range that the billing period falls into. Each
- * tier range is defined by an upper bound. For example, after $1.5M of payment
- * volume is reached, each individual payment may have a lower cap or a smaller
- * take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
- * event's applicable parameter is a function of its marginal addition to the period
- * total. Similar to tiered pricing, the BPS parameters of a given event depends on
- * the tier range that it falls into, where each tier range is defined by an upper
- * and lower bound. For example, the first few payments may have a 0.8 BPS take-rate
- * and all payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing
- * model. In a one-dimensional matrix, the second value is `null`. Every
- * configuration has a list of `matrix_values` which give the unit prices for
- * specified property values. In a one-dimensional matrix, the matrix values will
- * have `dimension_values` where the second value of the pair is null. If an event
- * does not match any of the dimension values in the matrix, it will resort to the
- * `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and
- * follow unit pricing. They also have an additional parameter
- * `fixed_price_quantity`. If the Price represents a fixed cost, this represents the
- * quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(price: Price) = price(JsonField.of(price))
@@ -1067,228 +415,8 @@ private constructor(
* is serialized differently in a given Price object. The model_type field
* determines the key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For
- * example, the first ten units may cost $0.50 each and all units thereafter may
- * cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units.
- * For example, if you've bought less than 10 units, they may each be $0.50 for a
- * total of $5.00. Once you've bought more than 10 units, all units may now be
- * priced at $0.40 (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes.
- * For example, if the package size is set to 5, then 4 units will be billed as 5
- * and 6 units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to
- * assess. For example, this would allow you to assess a fee of 0.25% on every
- * payment you process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
- * total quantity across all events. Similar to bulk pricing, the BPS parameters of
- * a given event depends on the tier range that the billing period falls into. Each
- * tier range is defined by an upper bound. For example, after $1.5M of payment
- * volume is reached, each individual payment may have a lower cap or a smaller
- * take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
- * event's applicable parameter is a function of its marginal addition to the period
- * total. Similar to tiered pricing, the BPS parameters of a given event depends on
- * the tier range that it falls into, where each tier range is defined by an upper
- * and lower bound. For example, the first few payments may have a 0.8 BPS take-rate
- * and all payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing
- * model. In a one-dimensional matrix, the second value is `null`. Every
- * configuration has a list of `matrix_values` which give the unit prices for
- * specified property values. In a one-dimensional matrix, the matrix values will
- * have `dimension_values` where the second value of the pair is null. If an event
- * does not match any of the dimension values in the matrix, it will resort to the
- * `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and
- * follow unit pricing. They also have an additional parameter
- * `fixed_price_quantity`. If the Price represents a fixed cost, this represents the
- * quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(price: JsonField) = apply { this.price = price }
@@ -1301,228 +429,8 @@ private constructor(
* is serialized differently in a given Price object. The model_type field
* determines the key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For
- * example, the first ten units may cost $0.50 each and all units thereafter may
- * cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units.
- * For example, if you've bought less than 10 units, they may each be $0.50 for a
- * total of $5.00. Once you've bought more than 10 units, all units may now be
- * priced at $0.40 (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes.
- * For example, if the package size is set to 5, then 4 units will be billed as 5
- * and 6 units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to
- * assess. For example, this would allow you to assess a fee of 0.25% on every
- * payment you process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
- * total quantity across all events. Similar to bulk pricing, the BPS parameters of
- * a given event depends on the tier range that the billing period falls into. Each
- * tier range is defined by an upper bound. For example, after $1.5M of payment
- * volume is reached, each individual payment may have a lower cap or a smaller
- * take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
- * event's applicable parameter is a function of its marginal addition to the period
- * total. Similar to tiered pricing, the BPS parameters of a given event depends on
- * the tier range that it falls into, where each tier range is defined by an upper
- * and lower bound. For example, the first few payments may have a 0.8 BPS take-rate
- * and all payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing
- * model. In a one-dimensional matrix, the second value is `null`. Every
- * configuration has a list of `matrix_values` which give the unit prices for
- * specified property values. In a one-dimensional matrix, the matrix values will
- * have `dimension_values` where the second value of the pair is null. If an event
- * does not match any of the dimension values in the matrix, it will resort to the
- * `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and
- * follow unit pricing. They also have an additional parameter
- * `fixed_price_quantity`. If the Price represents a fixed cost, this represents the
- * quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(unitPrice: Price.UnitPrice) = price(Price.ofUnitPrice(unitPrice))
@@ -1535,228 +443,8 @@ private constructor(
* is serialized differently in a given Price object. The model_type field
* determines the key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For
- * example, the first ten units may cost $0.50 each and all units thereafter may
- * cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units.
- * For example, if you've bought less than 10 units, they may each be $0.50 for a
- * total of $5.00. Once you've bought more than 10 units, all units may now be
- * priced at $0.40 (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes.
- * For example, if the package size is set to 5, then 4 units will be billed as 5
- * and 6 units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to
- * assess. For example, this would allow you to assess a fee of 0.25% on every
- * payment you process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
- * total quantity across all events. Similar to bulk pricing, the BPS parameters of
- * a given event depends on the tier range that the billing period falls into. Each
- * tier range is defined by an upper bound. For example, after $1.5M of payment
- * volume is reached, each individual payment may have a lower cap or a smaller
- * take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
- * event's applicable parameter is a function of its marginal addition to the period
- * total. Similar to tiered pricing, the BPS parameters of a given event depends on
- * the tier range that it falls into, where each tier range is defined by an upper
- * and lower bound. For example, the first few payments may have a 0.8 BPS take-rate
- * and all payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing
- * model. In a one-dimensional matrix, the second value is `null`. Every
- * configuration has a list of `matrix_values` which give the unit prices for
- * specified property values. In a one-dimensional matrix, the matrix values will
- * have `dimension_values` where the second value of the pair is null. If an event
- * does not match any of the dimension values in the matrix, it will resort to the
- * `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and
- * follow unit pricing. They also have an additional parameter
- * `fixed_price_quantity`. If the Price represents a fixed cost, this represents the
- * quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(packagePrice: Price.PackagePrice) =
price(Price.ofPackagePrice(packagePrice))
@@ -1770,228 +458,8 @@ private constructor(
* is serialized differently in a given Price object. The model_type field
* determines the key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For
- * example, the first ten units may cost $0.50 each and all units thereafter may
- * cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units.
- * For example, if you've bought less than 10 units, they may each be $0.50 for a
- * total of $5.00. Once you've bought more than 10 units, all units may now be
- * priced at $0.40 (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes.
- * For example, if the package size is set to 5, then 4 units will be billed as 5
- * and 6 units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to
- * assess. For example, this would allow you to assess a fee of 0.25% on every
- * payment you process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
- * total quantity across all events. Similar to bulk pricing, the BPS parameters of
- * a given event depends on the tier range that the billing period falls into. Each
- * tier range is defined by an upper bound. For example, after $1.5M of payment
- * volume is reached, each individual payment may have a lower cap or a smaller
- * take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
- * event's applicable parameter is a function of its marginal addition to the period
- * total. Similar to tiered pricing, the BPS parameters of a given event depends on
- * the tier range that it falls into, where each tier range is defined by an upper
- * and lower bound. For example, the first few payments may have a 0.8 BPS take-rate
- * and all payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing
- * model. In a one-dimensional matrix, the second value is `null`. Every
- * configuration has a list of `matrix_values` which give the unit prices for
- * specified property values. In a one-dimensional matrix, the matrix values will
- * have `dimension_values` where the second value of the pair is null. If an event
- * does not match any of the dimension values in the matrix, it will resort to the
- * `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and
- * follow unit pricing. They also have an additional parameter
- * `fixed_price_quantity`. If the Price represents a fixed cost, this represents the
- * quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(matrixPrice: Price.MatrixPrice) = price(Price.ofMatrixPrice(matrixPrice))
@@ -2004,228 +472,8 @@ private constructor(
* is serialized differently in a given Price object. The model_type field
* determines the key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For
- * example, the first ten units may cost $0.50 each and all units thereafter may
- * cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units.
- * For example, if you've bought less than 10 units, they may each be $0.50 for a
- * total of $5.00. Once you've bought more than 10 units, all units may now be
- * priced at $0.40 (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes.
- * For example, if the package size is set to 5, then 4 units will be billed as 5
- * and 6 units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to
- * assess. For example, this would allow you to assess a fee of 0.25% on every
- * payment you process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
- * total quantity across all events. Similar to bulk pricing, the BPS parameters of
- * a given event depends on the tier range that the billing period falls into. Each
- * tier range is defined by an upper bound. For example, after $1.5M of payment
- * volume is reached, each individual payment may have a lower cap or a smaller
- * take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
- * event's applicable parameter is a function of its marginal addition to the period
- * total. Similar to tiered pricing, the BPS parameters of a given event depends on
- * the tier range that it falls into, where each tier range is defined by an upper
- * and lower bound. For example, the first few payments may have a 0.8 BPS take-rate
- * and all payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing
- * model. In a one-dimensional matrix, the second value is `null`. Every
- * configuration has a list of `matrix_values` which give the unit prices for
- * specified property values. In a one-dimensional matrix, the matrix values will
- * have `dimension_values` where the second value of the pair is null. If an event
- * does not match any of the dimension values in the matrix, it will resort to the
- * `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and
- * follow unit pricing. They also have an additional parameter
- * `fixed_price_quantity`. If the Price represents a fixed cost, this represents the
- * quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(tieredPrice: Price.TieredPrice) = price(Price.ofTieredPrice(tieredPrice))
@@ -2238,228 +486,8 @@ private constructor(
* is serialized differently in a given Price object. The model_type field
* determines the key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For
- * example, the first ten units may cost $0.50 each and all units thereafter may
- * cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units.
- * For example, if you've bought less than 10 units, they may each be $0.50 for a
- * total of $5.00. Once you've bought more than 10 units, all units may now be
- * priced at $0.40 (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes.
- * For example, if the package size is set to 5, then 4 units will be billed as 5
- * and 6 units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to
- * assess. For example, this would allow you to assess a fee of 0.25% on every
- * payment you process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
- * total quantity across all events. Similar to bulk pricing, the BPS parameters of
- * a given event depends on the tier range that the billing period falls into. Each
- * tier range is defined by an upper bound. For example, after $1.5M of payment
- * volume is reached, each individual payment may have a lower cap or a smaller
- * take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
- * event's applicable parameter is a function of its marginal addition to the period
- * total. Similar to tiered pricing, the BPS parameters of a given event depends on
- * the tier range that it falls into, where each tier range is defined by an upper
- * and lower bound. For example, the first few payments may have a 0.8 BPS take-rate
- * and all payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing
- * model. In a one-dimensional matrix, the second value is `null`. Every
- * configuration has a list of `matrix_values` which give the unit prices for
- * specified property values. In a one-dimensional matrix, the matrix values will
- * have `dimension_values` where the second value of the pair is null. If an event
- * does not match any of the dimension values in the matrix, it will resort to the
- * `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and
- * follow unit pricing. They also have an additional parameter
- * `fixed_price_quantity`. If the Price represents a fixed cost, this represents the
- * quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(tieredBpsPrice: Price.TieredBpsPrice) =
price(Price.ofTieredBpsPrice(tieredBpsPrice))
@@ -2473,697 +501,37 @@ private constructor(
* is serialized differently in a given Price object. The model_type field
* determines the key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
+ */
+ fun price(bpsPrice: Price.BpsPrice) = price(Price.ofBpsPrice(bpsPrice))
+
+ /**
+ * The Price resource represents a price that can be billed on a subscription,
+ * resulting in a charge on an invoice in the form of an invoice line item. Prices
+ * take a quantity and determine an amount to bill.
*
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
+ * Orb supports a few different pricing models out of the box. Each of these models
+ * is serialized differently in a given Price object. The model_type field
+ * determines the key for the configuration object that is present.
*
- * ## Tiered pricing
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
+ */
+ fun price(bulkBpsPrice: Price.BulkBpsPrice) =
+ price(Price.ofBulkBpsPrice(bulkBpsPrice))
+
+ /**
+ * The Price resource represents a price that can be billed on a subscription,
+ * resulting in a charge on an invoice in the form of an invoice line item. Prices
+ * take a quantity and determine an amount to bill.
*
- * In tiered pricing, the cost of a given unit depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For
- * example, the first ten units may cost $0.50 each and all units thereafter may
- * cost $0.10 each.
+ * Orb supports a few different pricing models out of the box. Each of these models
+ * is serialized differently in a given Price object. The model_type field
+ * determines the key for the configuration object that is present.
*
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units.
- * For example, if you've bought less than 10 units, they may each be $0.50 for a
- * total of $5.00. Once you've bought more than 10 units, all units may now be
- * priced at $0.40 (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes.
- * For example, if the package size is set to 5, then 4 units will be billed as 5
- * and 6 units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to
- * assess. For example, this would allow you to assess a fee of 0.25% on every
- * payment you process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
- * total quantity across all events. Similar to bulk pricing, the BPS parameters of
- * a given event depends on the tier range that the billing period falls into. Each
- * tier range is defined by an upper bound. For example, after $1.5M of payment
- * volume is reached, each individual payment may have a lower cap or a smaller
- * take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
- * event's applicable parameter is a function of its marginal addition to the period
- * total. Similar to tiered pricing, the BPS parameters of a given event depends on
- * the tier range that it falls into, where each tier range is defined by an upper
- * and lower bound. For example, the first few payments may have a 0.8 BPS take-rate
- * and all payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing
- * model. In a one-dimensional matrix, the second value is `null`. Every
- * configuration has a list of `matrix_values` which give the unit prices for
- * specified property values. In a one-dimensional matrix, the matrix values will
- * have `dimension_values` where the second value of the pair is null. If an event
- * does not match any of the dimension values in the matrix, it will resort to the
- * `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and
- * follow unit pricing. They also have an additional parameter
- * `fixed_price_quantity`. If the Price represents a fixed cost, this represents the
- * quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
- */
- fun price(bpsPrice: Price.BpsPrice) = price(Price.ofBpsPrice(bpsPrice))
-
- /**
- * The Price resource represents a price that can be billed on a subscription,
- * resulting in a charge on an invoice in the form of an invoice line item. Prices
- * take a quantity and determine an amount to bill.
- *
- * Orb supports a few different pricing models out of the box. Each of these models
- * is serialized differently in a given Price object. The model_type field
- * determines the key for the configuration object that is present.
- *
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For
- * example, the first ten units may cost $0.50 each and all units thereafter may
- * cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units.
- * For example, if you've bought less than 10 units, they may each be $0.50 for a
- * total of $5.00. Once you've bought more than 10 units, all units may now be
- * priced at $0.40 (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes.
- * For example, if the package size is set to 5, then 4 units will be billed as 5
- * and 6 units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to
- * assess. For example, this would allow you to assess a fee of 0.25% on every
- * payment you process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
- * total quantity across all events. Similar to bulk pricing, the BPS parameters of
- * a given event depends on the tier range that the billing period falls into. Each
- * tier range is defined by an upper bound. For example, after $1.5M of payment
- * volume is reached, each individual payment may have a lower cap or a smaller
- * take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
- * event's applicable parameter is a function of its marginal addition to the period
- * total. Similar to tiered pricing, the BPS parameters of a given event depends on
- * the tier range that it falls into, where each tier range is defined by an upper
- * and lower bound. For example, the first few payments may have a 0.8 BPS take-rate
- * and all payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing
- * model. In a one-dimensional matrix, the second value is `null`. Every
- * configuration has a list of `matrix_values` which give the unit prices for
- * specified property values. In a one-dimensional matrix, the matrix values will
- * have `dimension_values` where the second value of the pair is null. If an event
- * does not match any of the dimension values in the matrix, it will resort to the
- * `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and
- * follow unit pricing. They also have an additional parameter
- * `fixed_price_quantity`. If the Price represents a fixed cost, this represents the
- * quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
- */
- fun price(bulkBpsPrice: Price.BulkBpsPrice) =
- price(Price.ofBulkBpsPrice(bulkBpsPrice))
-
- /**
- * The Price resource represents a price that can be billed on a subscription,
- * resulting in a charge on an invoice in the form of an invoice line item. Prices
- * take a quantity and determine an amount to bill.
- *
- * Orb supports a few different pricing models out of the box. Each of these models
- * is serialized differently in a given Price object. The model_type field
- * determines the key for the configuration object that is present.
- *
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For
- * example, the first ten units may cost $0.50 each and all units thereafter may
- * cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units.
- * For example, if you've bought less than 10 units, they may each be $0.50 for a
- * total of $5.00. Once you've bought more than 10 units, all units may now be
- * priced at $0.40 (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes.
- * For example, if the package size is set to 5, then 4 units will be billed as 5
- * and 6 units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to
- * assess. For example, this would allow you to assess a fee of 0.25% on every
- * payment you process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
- * total quantity across all events. Similar to bulk pricing, the BPS parameters of
- * a given event depends on the tier range that the billing period falls into. Each
- * tier range is defined by an upper bound. For example, after $1.5M of payment
- * volume is reached, each individual payment may have a lower cap or a smaller
- * take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
- * event's applicable parameter is a function of its marginal addition to the period
- * total. Similar to tiered pricing, the BPS parameters of a given event depends on
- * the tier range that it falls into, where each tier range is defined by an upper
- * and lower bound. For example, the first few payments may have a 0.8 BPS take-rate
- * and all payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing
- * model. In a one-dimensional matrix, the second value is `null`. Every
- * configuration has a list of `matrix_values` which give the unit prices for
- * specified property values. In a one-dimensional matrix, the matrix values will
- * have `dimension_values` where the second value of the pair is null. If an event
- * does not match any of the dimension values in the matrix, it will resort to the
- * `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and
- * follow unit pricing. They also have an additional parameter
- * `fixed_price_quantity`. If the Price represents a fixed cost, this represents the
- * quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(bulkPrice: Price.BulkPrice) = price(Price.ofBulkPrice(bulkPrice))
@@ -3176,228 +544,8 @@ private constructor(
* is serialized differently in a given Price object. The model_type field
* determines the key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For
- * example, the first ten units may cost $0.50 each and all units thereafter may
- * cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units.
- * For example, if you've bought less than 10 units, they may each be $0.50 for a
- * total of $5.00. Once you've bought more than 10 units, all units may now be
- * priced at $0.40 (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes.
- * For example, if the package size is set to 5, then 4 units will be billed as 5
- * and 6 units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to
- * assess. For example, this would allow you to assess a fee of 0.25% on every
- * payment you process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
- * total quantity across all events. Similar to bulk pricing, the BPS parameters of
- * a given event depends on the tier range that the billing period falls into. Each
- * tier range is defined by an upper bound. For example, after $1.5M of payment
- * volume is reached, each individual payment may have a lower cap or a smaller
- * take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
- * event's applicable parameter is a function of its marginal addition to the period
- * total. Similar to tiered pricing, the BPS parameters of a given event depends on
- * the tier range that it falls into, where each tier range is defined by an upper
- * and lower bound. For example, the first few payments may have a 0.8 BPS take-rate
- * and all payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing
- * model. In a one-dimensional matrix, the second value is `null`. Every
- * configuration has a list of `matrix_values` which give the unit prices for
- * specified property values. In a one-dimensional matrix, the matrix values will
- * have `dimension_values` where the second value of the pair is null. If an event
- * does not match any of the dimension values in the matrix, it will resort to the
- * `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and
- * follow unit pricing. They also have an additional parameter
- * `fixed_price_quantity`. If the Price represents a fixed cost, this represents the
- * quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(thresholdTotalAmountPrice: Price.ThresholdTotalAmountPrice) =
price(Price.ofThresholdTotalAmountPrice(thresholdTotalAmountPrice))
@@ -3411,228 +559,8 @@ private constructor(
* is serialized differently in a given Price object. The model_type field
* determines the key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For
- * example, the first ten units may cost $0.50 each and all units thereafter may
- * cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units.
- * For example, if you've bought less than 10 units, they may each be $0.50 for a
- * total of $5.00. Once you've bought more than 10 units, all units may now be
- * priced at $0.40 (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes.
- * For example, if the package size is set to 5, then 4 units will be billed as 5
- * and 6 units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to
- * assess. For example, this would allow you to assess a fee of 0.25% on every
- * payment you process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
- * total quantity across all events. Similar to bulk pricing, the BPS parameters of
- * a given event depends on the tier range that the billing period falls into. Each
- * tier range is defined by an upper bound. For example, after $1.5M of payment
- * volume is reached, each individual payment may have a lower cap or a smaller
- * take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
- * event's applicable parameter is a function of its marginal addition to the period
- * total. Similar to tiered pricing, the BPS parameters of a given event depends on
- * the tier range that it falls into, where each tier range is defined by an upper
- * and lower bound. For example, the first few payments may have a 0.8 BPS take-rate
- * and all payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing
- * model. In a one-dimensional matrix, the second value is `null`. Every
- * configuration has a list of `matrix_values` which give the unit prices for
- * specified property values. In a one-dimensional matrix, the matrix values will
- * have `dimension_values` where the second value of the pair is null. If an event
- * does not match any of the dimension values in the matrix, it will resort to the
- * `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and
- * follow unit pricing. They also have an additional parameter
- * `fixed_price_quantity`. If the Price represents a fixed cost, this represents the
- * quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(tieredPackagePrice: Price.TieredPackagePrice) =
price(Price.ofTieredPackagePrice(tieredPackagePrice))
@@ -3646,228 +574,8 @@ private constructor(
* is serialized differently in a given Price object. The model_type field
* determines the key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For
- * example, the first ten units may cost $0.50 each and all units thereafter may
- * cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units.
- * For example, if you've bought less than 10 units, they may each be $0.50 for a
- * total of $5.00. Once you've bought more than 10 units, all units may now be
- * priced at $0.40 (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes.
- * For example, if the package size is set to 5, then 4 units will be billed as 5
- * and 6 units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to
- * assess. For example, this would allow you to assess a fee of 0.25% on every
- * payment you process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
- * total quantity across all events. Similar to bulk pricing, the BPS parameters of
- * a given event depends on the tier range that the billing period falls into. Each
- * tier range is defined by an upper bound. For example, after $1.5M of payment
- * volume is reached, each individual payment may have a lower cap or a smaller
- * take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
- * event's applicable parameter is a function of its marginal addition to the period
- * total. Similar to tiered pricing, the BPS parameters of a given event depends on
- * the tier range that it falls into, where each tier range is defined by an upper
- * and lower bound. For example, the first few payments may have a 0.8 BPS take-rate
- * and all payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing
- * model. In a one-dimensional matrix, the second value is `null`. Every
- * configuration has a list of `matrix_values` which give the unit prices for
- * specified property values. In a one-dimensional matrix, the matrix values will
- * have `dimension_values` where the second value of the pair is null. If an event
- * does not match any of the dimension values in the matrix, it will resort to the
- * `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and
- * follow unit pricing. They also have an additional parameter
- * `fixed_price_quantity`. If the Price represents a fixed cost, this represents the
- * quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(groupedTieredPrice: Price.GroupedTieredPrice) =
price(Price.ofGroupedTieredPrice(groupedTieredPrice))
@@ -3881,228 +589,8 @@ private constructor(
* is serialized differently in a given Price object. The model_type field
* determines the key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For
- * example, the first ten units may cost $0.50 each and all units thereafter may
- * cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units.
- * For example, if you've bought less than 10 units, they may each be $0.50 for a
- * total of $5.00. Once you've bought more than 10 units, all units may now be
- * priced at $0.40 (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes.
- * For example, if the package size is set to 5, then 4 units will be billed as 5
- * and 6 units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to
- * assess. For example, this would allow you to assess a fee of 0.25% on every
- * payment you process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
- * total quantity across all events. Similar to bulk pricing, the BPS parameters of
- * a given event depends on the tier range that the billing period falls into. Each
- * tier range is defined by an upper bound. For example, after $1.5M of payment
- * volume is reached, each individual payment may have a lower cap or a smaller
- * take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
- * event's applicable parameter is a function of its marginal addition to the period
- * total. Similar to tiered pricing, the BPS parameters of a given event depends on
- * the tier range that it falls into, where each tier range is defined by an upper
- * and lower bound. For example, the first few payments may have a 0.8 BPS take-rate
- * and all payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing
- * model. In a one-dimensional matrix, the second value is `null`. Every
- * configuration has a list of `matrix_values` which give the unit prices for
- * specified property values. In a one-dimensional matrix, the matrix values will
- * have `dimension_values` where the second value of the pair is null. If an event
- * does not match any of the dimension values in the matrix, it will resort to the
- * `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and
- * follow unit pricing. They also have an additional parameter
- * `fixed_price_quantity`. If the Price represents a fixed cost, this represents the
- * quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(tieredWithMinimumPrice: Price.TieredWithMinimumPrice) =
price(Price.ofTieredWithMinimumPrice(tieredWithMinimumPrice))
@@ -4116,228 +604,8 @@ private constructor(
* is serialized differently in a given Price object. The model_type field
* determines the key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For
- * example, the first ten units may cost $0.50 each and all units thereafter may
- * cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units.
- * For example, if you've bought less than 10 units, they may each be $0.50 for a
- * total of $5.00. Once you've bought more than 10 units, all units may now be
- * priced at $0.40 (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes.
- * For example, if the package size is set to 5, then 4 units will be billed as 5
- * and 6 units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to
- * assess. For example, this would allow you to assess a fee of 0.25% on every
- * payment you process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
- * total quantity across all events. Similar to bulk pricing, the BPS parameters of
- * a given event depends on the tier range that the billing period falls into. Each
- * tier range is defined by an upper bound. For example, after $1.5M of payment
- * volume is reached, each individual payment may have a lower cap or a smaller
- * take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
- * event's applicable parameter is a function of its marginal addition to the period
- * total. Similar to tiered pricing, the BPS parameters of a given event depends on
- * the tier range that it falls into, where each tier range is defined by an upper
- * and lower bound. For example, the first few payments may have a 0.8 BPS take-rate
- * and all payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing
- * model. In a one-dimensional matrix, the second value is `null`. Every
- * configuration has a list of `matrix_values` which give the unit prices for
- * specified property values. In a one-dimensional matrix, the matrix values will
- * have `dimension_values` where the second value of the pair is null. If an event
- * does not match any of the dimension values in the matrix, it will resort to the
- * `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and
- * follow unit pricing. They also have an additional parameter
- * `fixed_price_quantity`. If the Price represents a fixed cost, this represents the
- * quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(tieredPackageWithMinimumPrice: Price.TieredPackageWithMinimumPrice) =
price(Price.ofTieredPackageWithMinimumPrice(tieredPackageWithMinimumPrice))
@@ -4351,228 +619,8 @@ private constructor(
* is serialized differently in a given Price object. The model_type field
* determines the key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For
- * example, the first ten units may cost $0.50 each and all units thereafter may
- * cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units.
- * For example, if you've bought less than 10 units, they may each be $0.50 for a
- * total of $5.00. Once you've bought more than 10 units, all units may now be
- * priced at $0.40 (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes.
- * For example, if the package size is set to 5, then 4 units will be billed as 5
- * and 6 units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to
- * assess. For example, this would allow you to assess a fee of 0.25% on every
- * payment you process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
- * total quantity across all events. Similar to bulk pricing, the BPS parameters of
- * a given event depends on the tier range that the billing period falls into. Each
- * tier range is defined by an upper bound. For example, after $1.5M of payment
- * volume is reached, each individual payment may have a lower cap or a smaller
- * take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
- * event's applicable parameter is a function of its marginal addition to the period
- * total. Similar to tiered pricing, the BPS parameters of a given event depends on
- * the tier range that it falls into, where each tier range is defined by an upper
- * and lower bound. For example, the first few payments may have a 0.8 BPS take-rate
- * and all payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing
- * model. In a one-dimensional matrix, the second value is `null`. Every
- * configuration has a list of `matrix_values` which give the unit prices for
- * specified property values. In a one-dimensional matrix, the matrix values will
- * have `dimension_values` where the second value of the pair is null. If an event
- * does not match any of the dimension values in the matrix, it will resort to the
- * `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and
- * follow unit pricing. They also have an additional parameter
- * `fixed_price_quantity`. If the Price represents a fixed cost, this represents the
- * quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(packageWithAllocationPrice: Price.PackageWithAllocationPrice) =
price(Price.ofPackageWithAllocationPrice(packageWithAllocationPrice))
@@ -4586,463 +634,23 @@ private constructor(
* is serialized differently in a given Price object. The model_type field
* determines the key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For
- * example, the first ten units may cost $0.50 each and all units thereafter may
- * cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units.
- * For example, if you've bought less than 10 units, they may each be $0.50 for a
- * total of $5.00. Once you've bought more than 10 units, all units may now be
- * priced at $0.40 (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes.
- * For example, if the package size is set to 5, then 4 units will be billed as 5
- * and 6 units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to
- * assess. For example, this would allow you to assess a fee of 0.25% on every
- * payment you process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
- * total quantity across all events. Similar to bulk pricing, the BPS parameters of
- * a given event depends on the tier range that the billing period falls into. Each
- * tier range is defined by an upper bound. For example, after $1.5M of payment
- * volume is reached, each individual payment may have a lower cap or a smaller
- * take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
- * event's applicable parameter is a function of its marginal addition to the period
- * total. Similar to tiered pricing, the BPS parameters of a given event depends on
- * the tier range that it falls into, where each tier range is defined by an upper
- * and lower bound. For example, the first few payments may have a 0.8 BPS take-rate
- * and all payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing
- * model. In a one-dimensional matrix, the second value is `null`. Every
- * configuration has a list of `matrix_values` which give the unit prices for
- * specified property values. In a one-dimensional matrix, the matrix values will
- * have `dimension_values` where the second value of the pair is null. If an event
- * does not match any of the dimension values in the matrix, it will resort to the
- * `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and
- * follow unit pricing. They also have an additional parameter
- * `fixed_price_quantity`. If the Price represents a fixed cost, this represents the
- * quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
- */
- fun price(unitWithPercentPrice: Price.UnitWithPercentPrice) =
- price(Price.ofUnitWithPercentPrice(unitWithPercentPrice))
-
- /**
- * The Price resource represents a price that can be billed on a subscription,
- * resulting in a charge on an invoice in the form of an invoice line item. Prices
- * take a quantity and determine an amount to bill.
- *
- * Orb supports a few different pricing models out of the box. Each of these models
- * is serialized differently in a given Price object. The model_type field
- * determines the key for the configuration object that is present.
- *
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For
- * example, the first ten units may cost $0.50 each and all units thereafter may
- * cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units.
- * For example, if you've bought less than 10 units, they may each be $0.50 for a
- * total of $5.00. Once you've bought more than 10 units, all units may now be
- * priced at $0.40 (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes.
- * For example, if the package size is set to 5, then 4 units will be billed as 5
- * and 6 units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to
- * assess. For example, this would allow you to assess a fee of 0.25% on every
- * payment you process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
- * total quantity across all events. Similar to bulk pricing, the BPS parameters of
- * a given event depends on the tier range that the billing period falls into. Each
- * tier range is defined by an upper bound. For example, after $1.5M of payment
- * volume is reached, each individual payment may have a lower cap or a smaller
- * take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
- * event's applicable parameter is a function of its marginal addition to the period
- * total. Similar to tiered pricing, the BPS parameters of a given event depends on
- * the tier range that it falls into, where each tier range is defined by an upper
- * and lower bound. For example, the first few payments may have a 0.8 BPS take-rate
- * and all payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing
- * model. In a one-dimensional matrix, the second value is `null`. Every
- * configuration has a list of `matrix_values` which give the unit prices for
- * specified property values. In a one-dimensional matrix, the matrix values will
- * have `dimension_values` where the second value of the pair is null. If an event
- * does not match any of the dimension values in the matrix, it will resort to the
- * `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
+ */
+ fun price(unitWithPercentPrice: Price.UnitWithPercentPrice) =
+ price(Price.ofUnitWithPercentPrice(unitWithPercentPrice))
+
+ /**
+ * The Price resource represents a price that can be billed on a subscription,
+ * resulting in a charge on an invoice in the form of an invoice line item. Prices
+ * take a quantity and determine an amount to bill.
*
- * Fixed fees are prices that are applied independent of usage quantities, and
- * follow unit pricing. They also have an additional parameter
- * `fixed_price_quantity`. If the Price represents a fixed cost, this represents the
- * quantity of units applied.
+ * Orb supports a few different pricing models out of the box. Each of these models
+ * is serialized differently in a given Price object. The model_type field
+ * determines the key for the configuration object that is present.
*
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(matrixWithAllocationPrice: Price.MatrixWithAllocationPrice) =
price(Price.ofMatrixWithAllocationPrice(matrixWithAllocationPrice))
@@ -5056,228 +664,8 @@ private constructor(
* is serialized differently in a given Price object. The model_type field
* determines the key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For
- * example, the first ten units may cost $0.50 each and all units thereafter may
- * cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units.
- * For example, if you've bought less than 10 units, they may each be $0.50 for a
- * total of $5.00. Once you've bought more than 10 units, all units may now be
- * priced at $0.40 (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes.
- * For example, if the package size is set to 5, then 4 units will be billed as 5
- * and 6 units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to
- * assess. For example, this would allow you to assess a fee of 0.25% on every
- * payment you process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
- * total quantity across all events. Similar to bulk pricing, the BPS parameters of
- * a given event depends on the tier range that the billing period falls into. Each
- * tier range is defined by an upper bound. For example, after $1.5M of payment
- * volume is reached, each individual payment may have a lower cap or a smaller
- * take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
- * event's applicable parameter is a function of its marginal addition to the period
- * total. Similar to tiered pricing, the BPS parameters of a given event depends on
- * the tier range that it falls into, where each tier range is defined by an upper
- * and lower bound. For example, the first few payments may have a 0.8 BPS take-rate
- * and all payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing
- * model. In a one-dimensional matrix, the second value is `null`. Every
- * configuration has a list of `matrix_values` which give the unit prices for
- * specified property values. In a one-dimensional matrix, the matrix values will
- * have `dimension_values` where the second value of the pair is null. If an event
- * does not match any of the dimension values in the matrix, it will resort to the
- * `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and
- * follow unit pricing. They also have an additional parameter
- * `fixed_price_quantity`. If the Price represents a fixed cost, this represents the
- * quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(tieredWithProrationPrice: Price.TieredWithProrationPrice) =
price(Price.ofTieredWithProrationPrice(tieredWithProrationPrice))
@@ -5291,228 +679,8 @@ private constructor(
* is serialized differently in a given Price object. The model_type field
* determines the key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For
- * example, the first ten units may cost $0.50 each and all units thereafter may
- * cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units.
- * For example, if you've bought less than 10 units, they may each be $0.50 for a
- * total of $5.00. Once you've bought more than 10 units, all units may now be
- * priced at $0.40 (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes.
- * For example, if the package size is set to 5, then 4 units will be billed as 5
- * and 6 units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to
- * assess. For example, this would allow you to assess a fee of 0.25% on every
- * payment you process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
- * total quantity across all events. Similar to bulk pricing, the BPS parameters of
- * a given event depends on the tier range that the billing period falls into. Each
- * tier range is defined by an upper bound. For example, after $1.5M of payment
- * volume is reached, each individual payment may have a lower cap or a smaller
- * take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
- * event's applicable parameter is a function of its marginal addition to the period
- * total. Similar to tiered pricing, the BPS parameters of a given event depends on
- * the tier range that it falls into, where each tier range is defined by an upper
- * and lower bound. For example, the first few payments may have a 0.8 BPS take-rate
- * and all payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing
- * model. In a one-dimensional matrix, the second value is `null`. Every
- * configuration has a list of `matrix_values` which give the unit prices for
- * specified property values. In a one-dimensional matrix, the matrix values will
- * have `dimension_values` where the second value of the pair is null. If an event
- * does not match any of the dimension values in the matrix, it will resort to the
- * `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and
- * follow unit pricing. They also have an additional parameter
- * `fixed_price_quantity`. If the Price represents a fixed cost, this represents the
- * quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(unitWithProrationPrice: Price.UnitWithProrationPrice) =
price(Price.ofUnitWithProrationPrice(unitWithProrationPrice))
@@ -5526,228 +694,8 @@ private constructor(
* is serialized differently in a given Price object. The model_type field
* determines the key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For
- * example, the first ten units may cost $0.50 each and all units thereafter may
- * cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units.
- * For example, if you've bought less than 10 units, they may each be $0.50 for a
- * total of $5.00. Once you've bought more than 10 units, all units may now be
- * priced at $0.40 (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes.
- * For example, if the package size is set to 5, then 4 units will be billed as 5
- * and 6 units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to
- * assess. For example, this would allow you to assess a fee of 0.25% on every
- * payment you process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
- * total quantity across all events. Similar to bulk pricing, the BPS parameters of
- * a given event depends on the tier range that the billing period falls into. Each
- * tier range is defined by an upper bound. For example, after $1.5M of payment
- * volume is reached, each individual payment may have a lower cap or a smaller
- * take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
- * event's applicable parameter is a function of its marginal addition to the period
- * total. Similar to tiered pricing, the BPS parameters of a given event depends on
- * the tier range that it falls into, where each tier range is defined by an upper
- * and lower bound. For example, the first few payments may have a 0.8 BPS take-rate
- * and all payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing
- * model. In a one-dimensional matrix, the second value is `null`. Every
- * configuration has a list of `matrix_values` which give the unit prices for
- * specified property values. In a one-dimensional matrix, the matrix values will
- * have `dimension_values` where the second value of the pair is null. If an event
- * does not match any of the dimension values in the matrix, it will resort to the
- * `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and
- * follow unit pricing. They also have an additional parameter
- * `fixed_price_quantity`. If the Price represents a fixed cost, this represents the
- * quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(groupedAllocationPrice: Price.GroupedAllocationPrice) =
price(Price.ofGroupedAllocationPrice(groupedAllocationPrice))
@@ -5761,228 +709,8 @@ private constructor(
* is serialized differently in a given Price object. The model_type field
* determines the key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For
- * example, the first ten units may cost $0.50 each and all units thereafter may
- * cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units.
- * For example, if you've bought less than 10 units, they may each be $0.50 for a
- * total of $5.00. Once you've bought more than 10 units, all units may now be
- * priced at $0.40 (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes.
- * For example, if the package size is set to 5, then 4 units will be billed as 5
- * and 6 units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to
- * assess. For example, this would allow you to assess a fee of 0.25% on every
- * payment you process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
- * total quantity across all events. Similar to bulk pricing, the BPS parameters of
- * a given event depends on the tier range that the billing period falls into. Each
- * tier range is defined by an upper bound. For example, after $1.5M of payment
- * volume is reached, each individual payment may have a lower cap or a smaller
- * take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
- * event's applicable parameter is a function of its marginal addition to the period
- * total. Similar to tiered pricing, the BPS parameters of a given event depends on
- * the tier range that it falls into, where each tier range is defined by an upper
- * and lower bound. For example, the first few payments may have a 0.8 BPS take-rate
- * and all payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing
- * model. In a one-dimensional matrix, the second value is `null`. Every
- * configuration has a list of `matrix_values` which give the unit prices for
- * specified property values. In a one-dimensional matrix, the matrix values will
- * have `dimension_values` where the second value of the pair is null. If an event
- * does not match any of the dimension values in the matrix, it will resort to the
- * `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and
- * follow unit pricing. They also have an additional parameter
- * `fixed_price_quantity`. If the Price represents a fixed cost, this represents the
- * quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(groupedWithProratedMinimumPrice: Price.GroupedWithProratedMinimumPrice) =
price(Price.ofGroupedWithProratedMinimumPrice(groupedWithProratedMinimumPrice))
@@ -5996,228 +724,8 @@ private constructor(
* is serialized differently in a given Price object. The model_type field
* determines the key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For
- * example, the first ten units may cost $0.50 each and all units thereafter may
- * cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units.
- * For example, if you've bought less than 10 units, they may each be $0.50 for a
- * total of $5.00. Once you've bought more than 10 units, all units may now be
- * priced at $0.40 (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes.
- * For example, if the package size is set to 5, then 4 units will be billed as 5
- * and 6 units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to
- * assess. For example, this would allow you to assess a fee of 0.25% on every
- * payment you process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
- * total quantity across all events. Similar to bulk pricing, the BPS parameters of
- * a given event depends on the tier range that the billing period falls into. Each
- * tier range is defined by an upper bound. For example, after $1.5M of payment
- * volume is reached, each individual payment may have a lower cap or a smaller
- * take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
- * event's applicable parameter is a function of its marginal addition to the period
- * total. Similar to tiered pricing, the BPS parameters of a given event depends on
- * the tier range that it falls into, where each tier range is defined by an upper
- * and lower bound. For example, the first few payments may have a 0.8 BPS take-rate
- * and all payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing
- * model. In a one-dimensional matrix, the second value is `null`. Every
- * configuration has a list of `matrix_values` which give the unit prices for
- * specified property values. In a one-dimensional matrix, the matrix values will
- * have `dimension_values` where the second value of the pair is null. If an event
- * does not match any of the dimension values in the matrix, it will resort to the
- * `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and
- * follow unit pricing. They also have an additional parameter
- * `fixed_price_quantity`. If the Price represents a fixed cost, this represents the
- * quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(groupedWithMeteredMinimumPrice: Price.GroupedWithMeteredMinimumPrice) =
price(Price.ofGroupedWithMeteredMinimumPrice(groupedWithMeteredMinimumPrice))
@@ -6231,228 +739,8 @@ private constructor(
* is serialized differently in a given Price object. The model_type field
* determines the key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For
- * example, the first ten units may cost $0.50 each and all units thereafter may
- * cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units.
- * For example, if you've bought less than 10 units, they may each be $0.50 for a
- * total of $5.00. Once you've bought more than 10 units, all units may now be
- * priced at $0.40 (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes.
- * For example, if the package size is set to 5, then 4 units will be billed as 5
- * and 6 units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to
- * assess. For example, this would allow you to assess a fee of 0.25% on every
- * payment you process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
- * total quantity across all events. Similar to bulk pricing, the BPS parameters of
- * a given event depends on the tier range that the billing period falls into. Each
- * tier range is defined by an upper bound. For example, after $1.5M of payment
- * volume is reached, each individual payment may have a lower cap or a smaller
- * take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
- * event's applicable parameter is a function of its marginal addition to the period
- * total. Similar to tiered pricing, the BPS parameters of a given event depends on
- * the tier range that it falls into, where each tier range is defined by an upper
- * and lower bound. For example, the first few payments may have a 0.8 BPS take-rate
- * and all payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing
- * model. In a one-dimensional matrix, the second value is `null`. Every
- * configuration has a list of `matrix_values` which give the unit prices for
- * specified property values. In a one-dimensional matrix, the matrix values will
- * have `dimension_values` where the second value of the pair is null. If an event
- * does not match any of the dimension values in the matrix, it will resort to the
- * `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and
- * follow unit pricing. They also have an additional parameter
- * `fixed_price_quantity`. If the Price represents a fixed cost, this represents the
- * quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(matrixWithDisplayNamePrice: Price.MatrixWithDisplayNamePrice) =
price(Price.ofMatrixWithDisplayNamePrice(matrixWithDisplayNamePrice))
@@ -6466,228 +754,8 @@ private constructor(
* is serialized differently in a given Price object. The model_type field
* determines the key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For
- * example, the first ten units may cost $0.50 each and all units thereafter may
- * cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units.
- * For example, if you've bought less than 10 units, they may each be $0.50 for a
- * total of $5.00. Once you've bought more than 10 units, all units may now be
- * priced at $0.40 (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes.
- * For example, if the package size is set to 5, then 4 units will be billed as 5
- * and 6 units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to
- * assess. For example, this would allow you to assess a fee of 0.25% on every
- * payment you process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
- * total quantity across all events. Similar to bulk pricing, the BPS parameters of
- * a given event depends on the tier range that the billing period falls into. Each
- * tier range is defined by an upper bound. For example, after $1.5M of payment
- * volume is reached, each individual payment may have a lower cap or a smaller
- * take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
- * event's applicable parameter is a function of its marginal addition to the period
- * total. Similar to tiered pricing, the BPS parameters of a given event depends on
- * the tier range that it falls into, where each tier range is defined by an upper
- * and lower bound. For example, the first few payments may have a 0.8 BPS take-rate
- * and all payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing
- * model. In a one-dimensional matrix, the second value is `null`. Every
- * configuration has a list of `matrix_values` which give the unit prices for
- * specified property values. In a one-dimensional matrix, the matrix values will
- * have `dimension_values` where the second value of the pair is null. If an event
- * does not match any of the dimension values in the matrix, it will resort to the
- * `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and
- * follow unit pricing. They also have an additional parameter
- * `fixed_price_quantity`. If the Price represents a fixed cost, this represents the
- * quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(bulkWithProrationPrice: Price.BulkWithProrationPrice) =
price(Price.ofBulkWithProrationPrice(bulkWithProrationPrice))
@@ -6701,467 +769,12 @@ private constructor(
* is serialized differently in a given Price object. The model_type field
* determines the key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For
- * example, the first ten units may cost $0.50 each and all units thereafter may
- * cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units.
- * For example, if you've bought less than 10 units, they may each be $0.50 for a
- * total of $5.00. Once you've bought more than 10 units, all units may now be
- * priced at $0.40 (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes.
- * For example, if the package size is set to 5, then 4 units will be billed as 5
- * and 6 units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to
- * assess. For example, this would allow you to assess a fee of 0.25% on every
- * payment you process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
- * total quantity across all events. Similar to bulk pricing, the BPS parameters of
- * a given event depends on the tier range that the billing period falls into. Each
- * tier range is defined by an upper bound. For example, after $1.5M of payment
- * volume is reached, each individual payment may have a lower cap or a smaller
- * take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
- * event's applicable parameter is a function of its marginal addition to the period
- * total. Similar to tiered pricing, the BPS parameters of a given event depends on
- * the tier range that it falls into, where each tier range is defined by an upper
- * and lower bound. For example, the first few payments may have a 0.8 BPS take-rate
- * and all payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing
- * model. In a one-dimensional matrix, the second value is `null`. Every
- * configuration has a list of `matrix_values` which give the unit prices for
- * specified property values. In a one-dimensional matrix, the matrix values will
- * have `dimension_values` where the second value of the pair is null. If an event
- * does not match any of the dimension values in the matrix, it will resort to the
- * `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and
- * follow unit pricing. They also have an additional parameter
- * `fixed_price_quantity`. If the Price represents a fixed cost, this represents the
- * quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(groupedTieredPackagePrice: Price.GroupedTieredPackagePrice) =
price(Price.ofGroupedTieredPackagePrice(groupedTieredPackagePrice))
- /**
- * The Price resource represents a price that can be billed on a subscription,
- * resulting in a charge on an invoice in the form of an invoice line item. Prices
- * take a quantity and determine an amount to bill.
- *
- * Orb supports a few different pricing models out of the box. Each of these models
- * is serialized differently in a given Price object. The model_type field
- * determines the key for the configuration object that is present.
- *
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For
- * example, the first ten units may cost $0.50 each and all units thereafter may
- * cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units.
- * For example, if you've bought less than 10 units, they may each be $0.50 for a
- * total of $5.00. Once you've bought more than 10 units, all units may now be
- * priced at $0.40 (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes.
- * For example, if the package size is set to 5, then 4 units will be billed as 5
- * and 6 units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to
- * assess. For example, this would allow you to assess a fee of 0.25% on every
- * payment you process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the
- * total quantity across all events. Similar to bulk pricing, the BPS parameters of
- * a given event depends on the tier range that the billing period falls into. Each
- * tier range is defined by an upper bound. For example, after $1.5M of payment
- * volume is reached, each individual payment may have a lower cap or a smaller
- * take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an
- * event's applicable parameter is a function of its marginal addition to the period
- * total. Similar to tiered pricing, the BPS parameters of a given event depends on
- * the tier range that it falls into, where each tier range is defined by an upper
- * and lower bound. For example, the first few payments may have a 0.8 BPS take-rate
- * and all payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing
- * model. In a one-dimensional matrix, the second value is `null`. Every
- * configuration has a list of `matrix_values` which give the unit prices for
- * specified property values. In a one-dimensional matrix, the matrix values will
- * have `dimension_values` where the second value of the pair is null. If an event
- * does not match any of the dimension values in the matrix, it will resort to the
- * `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and
- * follow unit pricing. They also have an additional parameter
- * `fixed_price_quantity`. If the Price represents a fixed cost, this represents the
- * quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
- */
- fun price(maxGroupTieredPrice: Price.MaxGroupTieredPrice) =
- price(Price.ofMaxGroupTieredPrice(maxGroupTieredPrice))
-
/**
* Price's contributions for the timeframe, excluding any minimums and discounts.
*/
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 1f09a7d8..582d7f11 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
@@ -34,15 +34,15 @@ import kotlin.jvm.optionals.getOrNull
/**
* This operation is used to create an Orb customer, who is party to the core billing relationship.
- * See [Customer](../guides/concepts#customer) for an overview of the customer resource.
+ * See [Customer](/core-concepts##customer) for an overview of the customer resource.
*
* This endpoint is critical in the following Orb functionality:
* - Automated charges can be configured by setting `payment_provider` and `payment_provider_id` to
* automatically issue invoices
- * - [Customer ID Aliases](../guides/events-and-metrics/customer-aliases) can be configured by
- * setting `external_customer_id`
- * - [Timezone localization](../guides/product-catalog/timezones.md) can be configured on a
- * per-customer basis by setting the `timezone` parameter
+ * - [Customer ID Aliases](/events-and-metrics/customer-aliases) can be configured by setting
+ * `external_customer_id`
+ * - [Timezone localization](/essentials/timezones) can be configured on a per-customer basis by
+ * setting the `timezone` parameter
*/
class CustomerCreateParams
constructor(
@@ -2944,6 +2944,10 @@ constructor(
override fun toString() = "Metadata{additionalProperties=$additionalProperties}"
}
+ /**
+ * This is used for creating charges or invoices in an external system via Orb. When not in test
+ * mode, the connection must first be configured in the Orb webapp.
+ */
class PaymentProvider
@JsonCreator
private constructor(
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 537480e3..9fa929b1 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
@@ -2818,6 +2818,7 @@ constructor(
override fun toString() = "Metadata{additionalProperties=$additionalProperties}"
}
+ /** Can only be specified when `entry_type=void`. The reason for the void. */
class VoidReason
@JsonCreator
private constructor(
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 fa7802ea..67256bc4 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
@@ -32,8 +32,8 @@ import java.util.Optional
import kotlin.jvm.optionals.getOrNull
/**
- * The [Credit Ledger Entry resource](/guides/product-catalog/prepurchase) models prepaid credits
- * within Orb.
+ * The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid credits within
+ * Orb.
*/
@JsonDeserialize(using = CustomerCreditLedgerCreateEntryByExternalIdResponse.Deserializer::class)
@JsonSerialize(using = CustomerCreditLedgerCreateEntryByExternalIdResponse.Serializer::class)
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 37bbda25..4d312d36 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
@@ -2804,6 +2804,7 @@ constructor(
override fun toString() = "Metadata{additionalProperties=$additionalProperties}"
}
+ /** Can only be specified when `entry_type=void`. The reason for the void. */
class VoidReason
@JsonCreator
private constructor(
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 2c82cf07..7f53bb90 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
@@ -32,8 +32,8 @@ import java.util.Optional
import kotlin.jvm.optionals.getOrNull
/**
- * The [Credit Ledger Entry resource](/guides/product-catalog/prepurchase) models prepaid credits
- * within Orb.
+ * The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid credits within
+ * Orb.
*/
@JsonDeserialize(using = CustomerCreditLedgerCreateEntryResponse.Deserializer::class)
@JsonSerialize(using = CustomerCreditLedgerCreateEntryResponse.Serializer::class)
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 035e6091..716dc50d 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
@@ -19,6 +19,83 @@ import java.util.Optional
import java.util.stream.Stream
import java.util.stream.StreamSupport
+/**
+ * The credits ledger provides _auditing_ functionality over Orb's credits system with a list of
+ * actions that have taken place to modify a customer's credit balance. This
+ * [paginated endpoint](/api-reference/pagination) lists these entries, starting from the most
+ * recent ledger entry.
+ *
+ * More details on using Orb's real-time credit feature are [here](/product-catalog/prepurchase).
+ *
+ * There are four major types of modifications to credit balance, detailed below.
+ *
+ * ## Increment
+ *
+ * Credits (which optionally expire on a future date) can be added via the API ([Add Ledger
+ * Entry](create-ledger-entry)). The ledger entry for such an action will always contain the total
+ * eligible starting and ending balance for the customer at the time the entry was added to the
+ * ledger.
+ *
+ * ## Decrement
+ *
+ * Deductions can occur as a result of an API call to create a ledger entry (see
+ * [Add Ledger Entry](create-ledger-entry)), or automatically as a result of incurring usage. Both
+ * ledger entries present the `decrement` entry type.
+ *
+ * As usage for a customer is reported into Orb, credits may be deducted according to the customer's
+ * plan configuration. An automated deduction of this type will result in a ledger entry, also with
+ * a starting and ending balance. In order to provide better tracing capabilities for automatic
+ * deductions, Orb always associates each automatic deduction with the `event_id` at the time of
+ * ingestion, used to pinpoint _why_ credit deduction took place and to ensure that credits are
+ * never deducted without an associated usage event.
+ *
+ * By default, Orb uses an algorithm that automatically deducts from the _soonest expiring credit
+ * block_ first in order to ensure that all credits are utilized appropriately. As an example, if
+ * trial credits with an expiration date of 2 weeks from now are present for a customer, they will
+ * be used before any deductions take place from a non-expiring credit block.
+ *
+ * If there are multiple blocks with the same expiration date, Orb will deduct from the block with
+ * the _lower cost basis_ first (e.g. trial credits with a $0 cost basis before paid credits with a
+ * $5.00 cost basis).
+ *
+ * It's also possible for a single usage event's deduction to _span_ credit blocks. In this case,
+ * Orb will deduct from the next block, ending at the credit block which consists of unexpiring
+ * credits. Each of these deductions will lead to a _separate_ ledger entry, one per credit block
+ * that is deducted from. By default, the customer's total credit balance in Orb can be negative as
+ * a result of a decrement.
+ *
+ * ## Expiration change
+ *
+ * The expiry of credits can be changed as a result of the API (See
+ * [Add Ledger Entry](create-ledger-entry)). This will create a ledger entry that specifies the
+ * balance as well as the initial and target expiry dates.
+ *
+ * Note that for this entry type, `starting_balance` will equal `ending_balance`, and the `amount`
+ * represents the balance transferred. The credit block linked to the ledger entry is the source
+ * credit block from which there was an expiration change
+ *
+ * ## Credits expiry
+ *
+ * When a set of credits expire on pre-set expiration date, the customer's balance automatically
+ * reflects this change and adds an entry to the ledger indicating this event. Note that credit
+ * expiry should always happen close to a date boundary in the customer's timezone.
+ *
+ * ## Void initiated
+ *
+ * Credit blocks can be voided via the API. The `amount` on this entry corresponds to the number of
+ * credits that were remaining in the block at time of void. `void_reason` will be populated if the
+ * void is created with a reason.
+ *
+ * ## Void
+ *
+ * When a set of credits is voided, the customer's balance automatically reflects this change and
+ * adds an entry to the ledger indicating this event.
+ *
+ * ## Amendment
+ *
+ * When credits are added to a customer's balance as a result of a correction, this entry will be
+ * added to the ledger to indicate the adjustment of credits.
+ */
class CustomerCreditLedgerListByExternalIdPage
private constructor(
private val ledgerService: LedgerService,
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerListByExternalIdPageAsync.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerListByExternalIdPageAsync.kt
index 76217dc2..5d8f449f 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerListByExternalIdPageAsync.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerListByExternalIdPageAsync.kt
@@ -20,6 +20,83 @@ import java.util.concurrent.CompletableFuture
import java.util.concurrent.Executor
import java.util.function.Predicate
+/**
+ * The credits ledger provides _auditing_ functionality over Orb's credits system with a list of
+ * actions that have taken place to modify a customer's credit balance. This
+ * [paginated endpoint](/api-reference/pagination) lists these entries, starting from the most
+ * recent ledger entry.
+ *
+ * More details on using Orb's real-time credit feature are [here](/product-catalog/prepurchase).
+ *
+ * There are four major types of modifications to credit balance, detailed below.
+ *
+ * ## Increment
+ *
+ * Credits (which optionally expire on a future date) can be added via the API ([Add Ledger
+ * Entry](create-ledger-entry)). The ledger entry for such an action will always contain the total
+ * eligible starting and ending balance for the customer at the time the entry was added to the
+ * ledger.
+ *
+ * ## Decrement
+ *
+ * Deductions can occur as a result of an API call to create a ledger entry (see
+ * [Add Ledger Entry](create-ledger-entry)), or automatically as a result of incurring usage. Both
+ * ledger entries present the `decrement` entry type.
+ *
+ * As usage for a customer is reported into Orb, credits may be deducted according to the customer's
+ * plan configuration. An automated deduction of this type will result in a ledger entry, also with
+ * a starting and ending balance. In order to provide better tracing capabilities for automatic
+ * deductions, Orb always associates each automatic deduction with the `event_id` at the time of
+ * ingestion, used to pinpoint _why_ credit deduction took place and to ensure that credits are
+ * never deducted without an associated usage event.
+ *
+ * By default, Orb uses an algorithm that automatically deducts from the _soonest expiring credit
+ * block_ first in order to ensure that all credits are utilized appropriately. As an example, if
+ * trial credits with an expiration date of 2 weeks from now are present for a customer, they will
+ * be used before any deductions take place from a non-expiring credit block.
+ *
+ * If there are multiple blocks with the same expiration date, Orb will deduct from the block with
+ * the _lower cost basis_ first (e.g. trial credits with a $0 cost basis before paid credits with a
+ * $5.00 cost basis).
+ *
+ * It's also possible for a single usage event's deduction to _span_ credit blocks. In this case,
+ * Orb will deduct from the next block, ending at the credit block which consists of unexpiring
+ * credits. Each of these deductions will lead to a _separate_ ledger entry, one per credit block
+ * that is deducted from. By default, the customer's total credit balance in Orb can be negative as
+ * a result of a decrement.
+ *
+ * ## Expiration change
+ *
+ * The expiry of credits can be changed as a result of the API (See
+ * [Add Ledger Entry](create-ledger-entry)). This will create a ledger entry that specifies the
+ * balance as well as the initial and target expiry dates.
+ *
+ * Note that for this entry type, `starting_balance` will equal `ending_balance`, and the `amount`
+ * represents the balance transferred. The credit block linked to the ledger entry is the source
+ * credit block from which there was an expiration change
+ *
+ * ## Credits expiry
+ *
+ * When a set of credits expire on pre-set expiration date, the customer's balance automatically
+ * reflects this change and adds an entry to the ledger indicating this event. Note that credit
+ * expiry should always happen close to a date boundary in the customer's timezone.
+ *
+ * ## Void initiated
+ *
+ * Credit blocks can be voided via the API. The `amount` on this entry corresponds to the number of
+ * credits that were remaining in the block at time of void. `void_reason` will be populated if the
+ * void is created with a reason.
+ *
+ * ## Void
+ *
+ * When a set of credits is voided, the customer's balance automatically reflects this change and
+ * adds an entry to the ledger indicating this event.
+ *
+ * ## Amendment
+ *
+ * When credits are added to a customer's balance as a result of a correction, this entry will be
+ * added to the ledger to indicate the adjustment of credits.
+ */
class CustomerCreditLedgerListByExternalIdPageAsync
private constructor(
private val ledgerService: LedgerServiceAsync,
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 85ca0139..7e1e4535 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
@@ -18,11 +18,10 @@ import java.util.Optional
/**
* The credits ledger provides _auditing_ functionality over Orb's credits system with a list of
* actions that have taken place to modify a customer's credit balance. This
- * [paginated endpoint](../reference/pagination) lists these entries, starting from the most recent
- * ledger entry.
+ * [paginated endpoint](/api-reference/pagination) lists these entries, starting from the most
+ * recent ledger entry.
*
- * More details on using Orb's real-time credit feature are
- * [here](../guides/product-catalog/prepurchase.md).
+ * More details on using Orb's real-time credit feature are [here](/product-catalog/prepurchase).
*
* There are four major types of modifications to credit balance, detailed below.
*
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 7e08d174..584c1886 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
@@ -32,8 +32,8 @@ import java.util.Optional
import kotlin.jvm.optionals.getOrNull
/**
- * The [Credit Ledger Entry resource](/guides/product-catalog/prepurchase) models prepaid credits
- * within Orb.
+ * The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid credits within
+ * Orb.
*/
@JsonDeserialize(using = CustomerCreditLedgerListByExternalIdResponse.Deserializer::class)
@JsonSerialize(using = CustomerCreditLedgerListByExternalIdResponse.Serializer::class)
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 136f8e04..53b1ab96 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
@@ -19,6 +19,83 @@ import java.util.Optional
import java.util.stream.Stream
import java.util.stream.StreamSupport
+/**
+ * The credits ledger provides _auditing_ functionality over Orb's credits system with a list of
+ * actions that have taken place to modify a customer's credit balance. This
+ * [paginated endpoint](/api-reference/pagination) lists these entries, starting from the most
+ * recent ledger entry.
+ *
+ * More details on using Orb's real-time credit feature are [here](/product-catalog/prepurchase).
+ *
+ * There are four major types of modifications to credit balance, detailed below.
+ *
+ * ## Increment
+ *
+ * Credits (which optionally expire on a future date) can be added via the API ([Add Ledger
+ * Entry](create-ledger-entry)). The ledger entry for such an action will always contain the total
+ * eligible starting and ending balance for the customer at the time the entry was added to the
+ * ledger.
+ *
+ * ## Decrement
+ *
+ * Deductions can occur as a result of an API call to create a ledger entry (see
+ * [Add Ledger Entry](create-ledger-entry)), or automatically as a result of incurring usage. Both
+ * ledger entries present the `decrement` entry type.
+ *
+ * As usage for a customer is reported into Orb, credits may be deducted according to the customer's
+ * plan configuration. An automated deduction of this type will result in a ledger entry, also with
+ * a starting and ending balance. In order to provide better tracing capabilities for automatic
+ * deductions, Orb always associates each automatic deduction with the `event_id` at the time of
+ * ingestion, used to pinpoint _why_ credit deduction took place and to ensure that credits are
+ * never deducted without an associated usage event.
+ *
+ * By default, Orb uses an algorithm that automatically deducts from the _soonest expiring credit
+ * block_ first in order to ensure that all credits are utilized appropriately. As an example, if
+ * trial credits with an expiration date of 2 weeks from now are present for a customer, they will
+ * be used before any deductions take place from a non-expiring credit block.
+ *
+ * If there are multiple blocks with the same expiration date, Orb will deduct from the block with
+ * the _lower cost basis_ first (e.g. trial credits with a $0 cost basis before paid credits with a
+ * $5.00 cost basis).
+ *
+ * It's also possible for a single usage event's deduction to _span_ credit blocks. In this case,
+ * Orb will deduct from the next block, ending at the credit block which consists of unexpiring
+ * credits. Each of these deductions will lead to a _separate_ ledger entry, one per credit block
+ * that is deducted from. By default, the customer's total credit balance in Orb can be negative as
+ * a result of a decrement.
+ *
+ * ## Expiration change
+ *
+ * The expiry of credits can be changed as a result of the API (See
+ * [Add Ledger Entry](create-ledger-entry)). This will create a ledger entry that specifies the
+ * balance as well as the initial and target expiry dates.
+ *
+ * Note that for this entry type, `starting_balance` will equal `ending_balance`, and the `amount`
+ * represents the balance transferred. The credit block linked to the ledger entry is the source
+ * credit block from which there was an expiration change
+ *
+ * ## Credits expiry
+ *
+ * When a set of credits expire on pre-set expiration date, the customer's balance automatically
+ * reflects this change and adds an entry to the ledger indicating this event. Note that credit
+ * expiry should always happen close to a date boundary in the customer's timezone.
+ *
+ * ## Void initiated
+ *
+ * Credit blocks can be voided via the API. The `amount` on this entry corresponds to the number of
+ * credits that were remaining in the block at time of void. `void_reason` will be populated if the
+ * void is created with a reason.
+ *
+ * ## Void
+ *
+ * When a set of credits is voided, the customer's balance automatically reflects this change and
+ * adds an entry to the ledger indicating this event.
+ *
+ * ## Amendment
+ *
+ * When credits are added to a customer's balance as a result of a correction, this entry will be
+ * added to the ledger to indicate the adjustment of credits.
+ */
class CustomerCreditLedgerListPage
private constructor(
private val ledgerService: LedgerService,
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerListPageAsync.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerListPageAsync.kt
index a0325317..283ffd2d 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerListPageAsync.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditLedgerListPageAsync.kt
@@ -20,6 +20,83 @@ import java.util.concurrent.CompletableFuture
import java.util.concurrent.Executor
import java.util.function.Predicate
+/**
+ * The credits ledger provides _auditing_ functionality over Orb's credits system with a list of
+ * actions that have taken place to modify a customer's credit balance. This
+ * [paginated endpoint](/api-reference/pagination) lists these entries, starting from the most
+ * recent ledger entry.
+ *
+ * More details on using Orb's real-time credit feature are [here](/product-catalog/prepurchase).
+ *
+ * There are four major types of modifications to credit balance, detailed below.
+ *
+ * ## Increment
+ *
+ * Credits (which optionally expire on a future date) can be added via the API ([Add Ledger
+ * Entry](create-ledger-entry)). The ledger entry for such an action will always contain the total
+ * eligible starting and ending balance for the customer at the time the entry was added to the
+ * ledger.
+ *
+ * ## Decrement
+ *
+ * Deductions can occur as a result of an API call to create a ledger entry (see
+ * [Add Ledger Entry](create-ledger-entry)), or automatically as a result of incurring usage. Both
+ * ledger entries present the `decrement` entry type.
+ *
+ * As usage for a customer is reported into Orb, credits may be deducted according to the customer's
+ * plan configuration. An automated deduction of this type will result in a ledger entry, also with
+ * a starting and ending balance. In order to provide better tracing capabilities for automatic
+ * deductions, Orb always associates each automatic deduction with the `event_id` at the time of
+ * ingestion, used to pinpoint _why_ credit deduction took place and to ensure that credits are
+ * never deducted without an associated usage event.
+ *
+ * By default, Orb uses an algorithm that automatically deducts from the _soonest expiring credit
+ * block_ first in order to ensure that all credits are utilized appropriately. As an example, if
+ * trial credits with an expiration date of 2 weeks from now are present for a customer, they will
+ * be used before any deductions take place from a non-expiring credit block.
+ *
+ * If there are multiple blocks with the same expiration date, Orb will deduct from the block with
+ * the _lower cost basis_ first (e.g. trial credits with a $0 cost basis before paid credits with a
+ * $5.00 cost basis).
+ *
+ * It's also possible for a single usage event's deduction to _span_ credit blocks. In this case,
+ * Orb will deduct from the next block, ending at the credit block which consists of unexpiring
+ * credits. Each of these deductions will lead to a _separate_ ledger entry, one per credit block
+ * that is deducted from. By default, the customer's total credit balance in Orb can be negative as
+ * a result of a decrement.
+ *
+ * ## Expiration change
+ *
+ * The expiry of credits can be changed as a result of the API (See
+ * [Add Ledger Entry](create-ledger-entry)). This will create a ledger entry that specifies the
+ * balance as well as the initial and target expiry dates.
+ *
+ * Note that for this entry type, `starting_balance` will equal `ending_balance`, and the `amount`
+ * represents the balance transferred. The credit block linked to the ledger entry is the source
+ * credit block from which there was an expiration change
+ *
+ * ## Credits expiry
+ *
+ * When a set of credits expire on pre-set expiration date, the customer's balance automatically
+ * reflects this change and adds an entry to the ledger indicating this event. Note that credit
+ * expiry should always happen close to a date boundary in the customer's timezone.
+ *
+ * ## Void initiated
+ *
+ * Credit blocks can be voided via the API. The `amount` on this entry corresponds to the number of
+ * credits that were remaining in the block at time of void. `void_reason` will be populated if the
+ * void is created with a reason.
+ *
+ * ## Void
+ *
+ * When a set of credits is voided, the customer's balance automatically reflects this change and
+ * adds an entry to the ledger indicating this event.
+ *
+ * ## Amendment
+ *
+ * When credits are added to a customer's balance as a result of a correction, this entry will be
+ * added to the ledger to indicate the adjustment of credits.
+ */
class CustomerCreditLedgerListPageAsync
private constructor(
private val ledgerService: LedgerServiceAsync,
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 eca3bdf1..dbcbdbb2 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
@@ -18,11 +18,10 @@ import java.util.Optional
/**
* The credits ledger provides _auditing_ functionality over Orb's credits system with a list of
* actions that have taken place to modify a customer's credit balance. This
- * [paginated endpoint](../reference/pagination) lists these entries, starting from the most recent
- * ledger entry.
+ * [paginated endpoint](/api-reference/pagination) lists these entries, starting from the most
+ * recent ledger entry.
*
- * More details on using Orb's real-time credit feature are
- * [here](../guides/product-catalog/prepurchase.md).
+ * More details on using Orb's real-time credit feature are [here](/product-catalog/prepurchase).
*
* There are four major types of modifications to credit balance, detailed below.
*
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 0fa15da8..880bb6f0 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
@@ -32,8 +32,8 @@ import java.util.Optional
import kotlin.jvm.optionals.getOrNull
/**
- * The [Credit Ledger Entry resource](/guides/product-catalog/prepurchase) models prepaid credits
- * within Orb.
+ * The [Credit Ledger Entry resource](/product-catalog/prepurchase) models prepaid credits within
+ * Orb.
*/
@JsonDeserialize(using = CustomerCreditLedgerListResponse.Deserializer::class)
@JsonSerialize(using = CustomerCreditLedgerListResponse.Serializer::class)
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 4a17e9c2..6240e6ec 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
@@ -19,6 +19,15 @@ import java.util.Optional
import java.util.stream.Stream
import java.util.stream.StreamSupport
+/**
+ * Returns a paginated list of unexpired, non-zero credit blocks for a customer.
+ *
+ * If `include_all_blocks` is set to `true`, all credit blocks (including expired and depleted
+ * blocks) will be included in the response.
+ *
+ * Note that `currency` defaults to credits if not specified. To use a real world currency, set
+ * `currency` to an ISO 4217 string.
+ */
class CustomerCreditListByExternalIdPage
private constructor(
private val creditsService: CreditService,
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditListByExternalIdPageAsync.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditListByExternalIdPageAsync.kt
index 82fd9fcc..ad85c415 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditListByExternalIdPageAsync.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditListByExternalIdPageAsync.kt
@@ -20,6 +20,15 @@ import java.util.concurrent.CompletableFuture
import java.util.concurrent.Executor
import java.util.function.Predicate
+/**
+ * Returns a paginated list of unexpired, non-zero credit blocks for a customer.
+ *
+ * If `include_all_blocks` is set to `true`, all credit blocks (including expired and depleted
+ * blocks) will be included in the response.
+ *
+ * Note that `currency` defaults to credits if not specified. To use a real world currency, set
+ * `currency` to an ISO 4217 string.
+ */
class CustomerCreditListByExternalIdPageAsync
private constructor(
private val creditsService: CreditServiceAsync,
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 88aea6a2..a26d5c83 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
@@ -19,6 +19,15 @@ import java.util.Optional
import java.util.stream.Stream
import java.util.stream.StreamSupport
+/**
+ * Returns a paginated list of unexpired, non-zero credit blocks for a customer.
+ *
+ * If `include_all_blocks` is set to `true`, all credit blocks (including expired and depleted
+ * blocks) will be included in the response.
+ *
+ * Note that `currency` defaults to credits if not specified. To use a real world currency, set
+ * `currency` to an ISO 4217 string.
+ */
class CustomerCreditListPage
private constructor(
private val creditsService: CreditService,
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditListPageAsync.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditListPageAsync.kt
index 133b0fe4..4aadb3b7 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditListPageAsync.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditListPageAsync.kt
@@ -20,6 +20,15 @@ import java.util.concurrent.CompletableFuture
import java.util.concurrent.Executor
import java.util.function.Predicate
+/**
+ * Returns a paginated list of unexpired, non-zero credit blocks for a customer.
+ *
+ * If `include_all_blocks` is set to `true`, all credit blocks (including expired and depleted
+ * blocks) will be included in the response.
+ *
+ * Note that `currency` defaults to credits if not specified. To use a real world currency, set
+ * `currency` to an ISO 4217 string.
+ */
class CustomerCreditListPageAsync
private constructor(
private val creditsService: CreditServiceAsync,
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 3942aa37..2f120d1b 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
@@ -866,6 +866,7 @@ constructor(
"InvoiceSettings{autoCollection=$autoCollection, netTerms=$netTerms, memo=$memo, requireSuccessfulPayment=$requireSuccessfulPayment, additionalProperties=$additionalProperties}"
}
+ /** The unit of expires_after. */
class ExpiresAfterUnit
@JsonCreator
private constructor(
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 aff4d511..afba784d 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
@@ -512,6 +512,7 @@ private constructor(
"InvoiceSettings{autoCollection=$autoCollection, netTerms=$netTerms, memo=$memo, requireSuccessfulPayment=$requireSuccessfulPayment, additionalProperties=$additionalProperties}"
}
+ /** The unit of expires_after. */
class ExpiresAfterUnit
@JsonCreator
private constructor(
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 7e16567e..92f8bef0 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
@@ -861,6 +861,7 @@ constructor(
"InvoiceSettings{autoCollection=$autoCollection, netTerms=$netTerms, memo=$memo, requireSuccessfulPayment=$requireSuccessfulPayment, additionalProperties=$additionalProperties}"
}
+ /** The unit of expires_after. */
class ExpiresAfterUnit
@JsonCreator
private constructor(
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 d3bdb452..2c070a0d 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
@@ -510,6 +510,7 @@ private constructor(
"InvoiceSettings{autoCollection=$autoCollection, netTerms=$netTerms, memo=$memo, requireSuccessfulPayment=$requireSuccessfulPayment, additionalProperties=$additionalProperties}"
}
+ /** The unit of expires_after. */
class ExpiresAfterUnit
@JsonCreator
private constructor(
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 77712032..ece8a14a 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
@@ -19,6 +19,7 @@ import java.util.Optional
import java.util.stream.Stream
import java.util.stream.StreamSupport
+/** List top-ups by external ID */
class CustomerCreditTopUpListByExternalIdPage
private constructor(
private val topUpsService: TopUpService,
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditTopUpListByExternalIdPageAsync.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditTopUpListByExternalIdPageAsync.kt
index 14a1a4e8..bf391a8f 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditTopUpListByExternalIdPageAsync.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditTopUpListByExternalIdPageAsync.kt
@@ -20,6 +20,7 @@ import java.util.concurrent.CompletableFuture
import java.util.concurrent.Executor
import java.util.function.Predicate
+/** List top-ups by external ID */
class CustomerCreditTopUpListByExternalIdPageAsync
private constructor(
private val topUpsService: TopUpServiceAsync,
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 0e82a3e1..4192efd5 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
@@ -511,6 +511,7 @@ private constructor(
"InvoiceSettings{autoCollection=$autoCollection, netTerms=$netTerms, memo=$memo, requireSuccessfulPayment=$requireSuccessfulPayment, additionalProperties=$additionalProperties}"
}
+ /** The unit of expires_after. */
class ExpiresAfterUnit
@JsonCreator
private constructor(
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 c24266c1..987a0859 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
@@ -19,6 +19,7 @@ import java.util.Optional
import java.util.stream.Stream
import java.util.stream.StreamSupport
+/** List top-ups */
class CustomerCreditTopUpListPage
private constructor(
private val topUpsService: TopUpService,
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditTopUpListPageAsync.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditTopUpListPageAsync.kt
index 21355e23..c86e8eda 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditTopUpListPageAsync.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditTopUpListPageAsync.kt
@@ -20,6 +20,7 @@ import java.util.concurrent.CompletableFuture
import java.util.concurrent.Executor
import java.util.function.Predicate
+/** List top-ups */
class CustomerCreditTopUpListPageAsync
private constructor(
private val topUpsService: TopUpServiceAsync,
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 bc9da0f2..39051da3 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
@@ -510,6 +510,7 @@ private constructor(
"InvoiceSettings{autoCollection=$autoCollection, netTerms=$netTerms, memo=$memo, requireSuccessfulPayment=$requireSuccessfulPayment, additionalProperties=$additionalProperties}"
}
+ /** The unit of expires_after. */
class ExpiresAfterUnit
@JsonCreator
private constructor(
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerFetchByExternalIdParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerFetchByExternalIdParams.kt
index 1430a60d..69c75504 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerFetchByExternalIdParams.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerFetchByExternalIdParams.kt
@@ -10,7 +10,7 @@ import java.util.Objects
/**
* This endpoint is used to fetch customer details given an `external_customer_id` (see
- * [Customer ID Aliases](../guides/events-and-metrics/customer-aliases)).
+ * [Customer ID Aliases](/events-and-metrics/customer-aliases)).
*
* Note that the resource and semantics of this endpoint exactly mirror
* [Get Customer](fetch-customer).
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerFetchParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerFetchParams.kt
index 02534851..bef21530 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerFetchParams.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerFetchParams.kt
@@ -12,8 +12,7 @@ import java.util.Objects
* This endpoint is used to fetch customer details given an identifier. If the `Customer` is in the
* process of being deleted, only the properties `id` and `deleted: true` will be returned.
*
- * See the [Customer resource](../guides/core-concepts.mdx#customer) for a full discussion of the
- * Customer model.
+ * See the [Customer resource](/core-concepts#customer) for a full discussion of the Customer model.
*/
class CustomerFetchParams
constructor(
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 b71acf08..c13b4775 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
@@ -19,6 +19,13 @@ import java.util.Optional
import java.util.stream.Stream
import java.util.stream.StreamSupport
+/**
+ * This endpoint returns a list of all customers for an account. The list of customers is ordered
+ * starting from the most recently created customer. This endpoint follows Orb's
+ * [standardized pagination format](/api-reference/pagination).
+ *
+ * See [Customer](/core-concepts##customer) for an overview of the customer model.
+ */
class CustomerListPage
private constructor(
private val customersService: CustomerService,
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerListPageAsync.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerListPageAsync.kt
index 44845de8..5bebcc1f 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerListPageAsync.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerListPageAsync.kt
@@ -20,6 +20,13 @@ import java.util.concurrent.CompletableFuture
import java.util.concurrent.Executor
import java.util.function.Predicate
+/**
+ * This endpoint returns a list of all customers for an account. The list of customers is ordered
+ * starting from the most recently created customer. This endpoint follows Orb's
+ * [standardized pagination format](/api-reference/pagination).
+ *
+ * See [Customer](/core-concepts##customer) for an overview of the customer model.
+ */
class CustomerListPageAsync
private constructor(
private val customersService: CustomerServiceAsync,
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 f95e2248..dbfebc28 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
@@ -13,9 +13,9 @@ import java.util.Optional
/**
* This endpoint returns a list of all customers for an account. The list of customers is ordered
* starting from the most recently created customer. This endpoint follows Orb's
- * [standardized pagination format](../reference/pagination).
+ * [standardized pagination format](/api-reference/pagination).
*
- * See [Customer](../guides/concepts#customer) for an overview of the customer model.
+ * See [Customer](/core-concepts##customer) for an overview of the customer model.
*/
class CustomerListParams
constructor(
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 c178efce..135e7817 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
@@ -34,7 +34,7 @@ import kotlin.jvm.optionals.getOrNull
/**
* This endpoint is used to update customer details given an `external_customer_id` (see
- * [Customer ID Aliases](../guides/events-and-metrics/customer-aliases)). Note that the resource and
+ * [Customer ID Aliases](/events-and-metrics/customer-aliases)). Note that the resource and
* semantics of this endpoint exactly mirror [Update Customer](update-customer).
*/
class CustomerUpdateByExternalIdParams
@@ -2891,6 +2891,13 @@ constructor(
override fun toString() = "Metadata{additionalProperties=$additionalProperties}"
}
+ /**
+ * This is used for creating charges or invoices in an external system via Orb. When not in test
+ * mode:
+ * - the connection must first be configured in the Orb webapp.
+ * - if the provider is an invoicing provider (`stripe_invoice`, `quickbooks`, `bill.com`,
+ * `netsuite`), any product mappings must first be configured with the Orb team.
+ */
class PaymentProvider
@JsonCreator
private constructor(
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 2b938903..10ff446e 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
@@ -2885,6 +2885,13 @@ constructor(
override fun toString() = "Metadata{additionalProperties=$additionalProperties}"
}
+ /**
+ * This is used for creating charges or invoices in an external system via Orb. When not in test
+ * mode:
+ * - the connection must first be configured in the Orb webapp.
+ * - if the provider is an invoicing provider (`stripe_invoice`, `quickbooks`, `bill.com`,
+ * `netsuite`), any product mappings must first be configured with the Orb team.
+ */
class PaymentProvider
@JsonCreator
private constructor(
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 7af23cb5..2dbc3100 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
@@ -19,6 +19,7 @@ import java.util.Optional
import java.util.stream.Stream
import java.util.stream.StreamSupport
+/** List dimensional price groups */
class DimensionalPriceGroupListPage
private constructor(
private val dimensionalPriceGroupsService: DimensionalPriceGroupService,
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/DimensionalPriceGroupListPageAsync.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/DimensionalPriceGroupListPageAsync.kt
index 8582b411..17b52dd9 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/DimensionalPriceGroupListPageAsync.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/DimensionalPriceGroupListPageAsync.kt
@@ -20,6 +20,7 @@ import java.util.concurrent.CompletableFuture
import java.util.concurrent.Executor
import java.util.function.Predicate
+/** List dimensional price groups */
class DimensionalPriceGroupListPageAsync
private constructor(
private val dimensionalPriceGroupsService: DimensionalPriceGroupServiceAsync,
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 9c57551f..30ee516c 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
@@ -91,8 +91,8 @@ private constructor(
fun timeframeStart(): OffsetDateTime = timeframeStart.getRequired("timeframe_start")
/**
- * A boolean [computed property](../guides/extensibility/advanced-metrics#computed-properties)
- * used to filter the set of events to deprecate
+ * A boolean [computed property](/extensibility/advanced-metrics#computed-properties) used to
+ * filter the set of events to deprecate
*/
fun deprecationFilter(): Optional =
Optional.ofNullable(deprecationFilter.getNullable("deprecation_filter"))
@@ -139,8 +139,8 @@ private constructor(
fun _timeframeStart(): JsonField = timeframeStart
/**
- * A boolean [computed property](../guides/extensibility/advanced-metrics#computed-properties)
- * used to filter the set of events to deprecate
+ * A boolean [computed property](/extensibility/advanced-metrics#computed-properties) used to
+ * filter the set of events to deprecate
*/
@JsonProperty("deprecation_filter")
@ExcludeMissing
@@ -289,25 +289,22 @@ private constructor(
}
/**
- * A boolean
- * [computed property](../guides/extensibility/advanced-metrics#computed-properties) used to
- * filter the set of events to deprecate
+ * A boolean [computed property](/extensibility/advanced-metrics#computed-properties) used
+ * to filter the set of events to deprecate
*/
fun deprecationFilter(deprecationFilter: String?) =
deprecationFilter(JsonField.ofNullable(deprecationFilter))
/**
- * A boolean
- * [computed property](../guides/extensibility/advanced-metrics#computed-properties) used to
- * filter the set of events to deprecate
+ * A boolean [computed property](/extensibility/advanced-metrics#computed-properties) used
+ * to filter the set of events to deprecate
*/
fun deprecationFilter(deprecationFilter: Optional) =
deprecationFilter(deprecationFilter.orElse(null))
/**
- * A boolean
- * [computed property](../guides/extensibility/advanced-metrics#computed-properties) used to
- * filter the set of events to deprecate
+ * A boolean [computed property](/extensibility/advanced-metrics#computed-properties) used
+ * to filter the set of events to deprecate
*/
fun deprecationFilter(deprecationFilter: JsonField) = apply {
this.deprecationFilter = deprecationFilter
@@ -348,6 +345,7 @@ private constructor(
)
}
+ /** The status of the backfill. */
class Status
@JsonCreator
private constructor(
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 f27d923a..bd09a919 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
@@ -44,11 +44,11 @@ import java.util.Optional
* for that customer. If neither is specified, the backfill will affect all customers.
*
* When `replace_existing_events` is `true`, this indicates that existing events in the timeframe
- * should no longer be counted towards invoiced usage. In this scenario, the parameter `filter` can
+ * should no longer be counter towards invoiced usage. In this scenario, the parameter `filter` can
* be optionally added which enables filtering using
- * [computed properties](../guides/extensibility/advanced-metrics#computed-properties). The
- * expressiveness of computed properties allows you to deprecate existing events based on both a
- * period of time and specific property values.
+ * [computed properties](/extensibility/advanced-metrics#computed-properties). The expressiveness of
+ * computed properties allows you to deprecate existing events based on both a period of time and
+ * specific property values.
*/
class EventBackfillCreateParams
constructor(
@@ -77,8 +77,8 @@ constructor(
fun customerId(): Optional = body.customerId()
/**
- * A boolean [computed property](../guides/extensibility/advanced-metrics#computed-properties)
- * used to filter the set of events to deprecate
+ * A boolean [computed property](/extensibility/advanced-metrics#computed-properties) used to
+ * filter the set of events to deprecate
*/
fun deprecationFilter(): Optional = body.deprecationFilter()
@@ -114,8 +114,8 @@ constructor(
fun _customerId(): JsonField = body._customerId()
/**
- * A boolean [computed property](../guides/extensibility/advanced-metrics#computed-properties)
- * used to filter the set of events to deprecate
+ * A boolean [computed property](/extensibility/advanced-metrics#computed-properties) used to
+ * filter the set of events to deprecate
*/
fun _deprecationFilter(): JsonField = body._deprecationFilter()
@@ -194,9 +194,8 @@ constructor(
Optional.ofNullable(customerId.getNullable("customer_id"))
/**
- * A boolean
- * [computed property](../guides/extensibility/advanced-metrics#computed-properties) used to
- * filter the set of events to deprecate
+ * A boolean [computed property](/extensibility/advanced-metrics#computed-properties) used
+ * to filter the set of events to deprecate
*/
fun deprecationFilter(): Optional =
Optional.ofNullable(deprecationFilter.getNullable("deprecation_filter"))
@@ -243,9 +242,8 @@ constructor(
fun _customerId(): JsonField = customerId
/**
- * A boolean
- * [computed property](../guides/extensibility/advanced-metrics#computed-properties) used to
- * filter the set of events to deprecate
+ * A boolean [computed property](/extensibility/advanced-metrics#computed-properties) used
+ * to filter the set of events to deprecate
*/
@JsonProperty("deprecation_filter")
@ExcludeMissing
@@ -378,24 +376,21 @@ constructor(
fun customerId(customerId: JsonField) = apply { this.customerId = customerId }
/**
- * A boolean
- * [computed property](../guides/extensibility/advanced-metrics#computed-properties)
+ * A boolean [computed property](/extensibility/advanced-metrics#computed-properties)
* used to filter the set of events to deprecate
*/
fun deprecationFilter(deprecationFilter: String?) =
deprecationFilter(JsonField.ofNullable(deprecationFilter))
/**
- * A boolean
- * [computed property](../guides/extensibility/advanced-metrics#computed-properties)
+ * A boolean [computed property](/extensibility/advanced-metrics#computed-properties)
* used to filter the set of events to deprecate
*/
fun deprecationFilter(deprecationFilter: Optional) =
deprecationFilter(deprecationFilter.orElse(null))
/**
- * A boolean
- * [computed property](../guides/extensibility/advanced-metrics#computed-properties)
+ * A boolean [computed property](/extensibility/advanced-metrics#computed-properties)
* used to filter the set of events to deprecate
*/
fun deprecationFilter(deprecationFilter: JsonField) = apply {
@@ -568,26 +563,23 @@ constructor(
fun customerId(customerId: JsonField) = apply { body.customerId(customerId) }
/**
- * A boolean
- * [computed property](../guides/extensibility/advanced-metrics#computed-properties) used to
- * filter the set of events to deprecate
+ * A boolean [computed property](/extensibility/advanced-metrics#computed-properties) used
+ * to filter the set of events to deprecate
*/
fun deprecationFilter(deprecationFilter: String?) = apply {
body.deprecationFilter(deprecationFilter)
}
/**
- * A boolean
- * [computed property](../guides/extensibility/advanced-metrics#computed-properties) used to
- * filter the set of events to deprecate
+ * A boolean [computed property](/extensibility/advanced-metrics#computed-properties) used
+ * to filter the set of events to deprecate
*/
fun deprecationFilter(deprecationFilter: Optional) =
deprecationFilter(deprecationFilter.orElse(null))
/**
- * A boolean
- * [computed property](../guides/extensibility/advanced-metrics#computed-properties) used to
- * filter the set of events to deprecate
+ * A boolean [computed property](/extensibility/advanced-metrics#computed-properties) used
+ * to filter the set of events to deprecate
*/
fun deprecationFilter(deprecationFilter: JsonField) = apply {
body.deprecationFilter(deprecationFilter)
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 9f894e46..3fbf2e09 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
@@ -91,8 +91,8 @@ private constructor(
fun timeframeStart(): OffsetDateTime = timeframeStart.getRequired("timeframe_start")
/**
- * A boolean [computed property](../guides/extensibility/advanced-metrics#computed-properties)
- * used to filter the set of events to deprecate
+ * A boolean [computed property](/extensibility/advanced-metrics#computed-properties) used to
+ * filter the set of events to deprecate
*/
fun deprecationFilter(): Optional =
Optional.ofNullable(deprecationFilter.getNullable("deprecation_filter"))
@@ -139,8 +139,8 @@ private constructor(
fun _timeframeStart(): JsonField = timeframeStart
/**
- * A boolean [computed property](../guides/extensibility/advanced-metrics#computed-properties)
- * used to filter the set of events to deprecate
+ * A boolean [computed property](/extensibility/advanced-metrics#computed-properties) used to
+ * filter the set of events to deprecate
*/
@JsonProperty("deprecation_filter")
@ExcludeMissing
@@ -289,25 +289,22 @@ private constructor(
}
/**
- * A boolean
- * [computed property](../guides/extensibility/advanced-metrics#computed-properties) used to
- * filter the set of events to deprecate
+ * A boolean [computed property](/extensibility/advanced-metrics#computed-properties) used
+ * to filter the set of events to deprecate
*/
fun deprecationFilter(deprecationFilter: String?) =
deprecationFilter(JsonField.ofNullable(deprecationFilter))
/**
- * A boolean
- * [computed property](../guides/extensibility/advanced-metrics#computed-properties) used to
- * filter the set of events to deprecate
+ * A boolean [computed property](/extensibility/advanced-metrics#computed-properties) used
+ * to filter the set of events to deprecate
*/
fun deprecationFilter(deprecationFilter: Optional) =
deprecationFilter(deprecationFilter.orElse(null))
/**
- * A boolean
- * [computed property](../guides/extensibility/advanced-metrics#computed-properties) used to
- * filter the set of events to deprecate
+ * A boolean [computed property](/extensibility/advanced-metrics#computed-properties) used
+ * to filter the set of events to deprecate
*/
fun deprecationFilter(deprecationFilter: JsonField) = apply {
this.deprecationFilter = deprecationFilter
@@ -348,6 +345,7 @@ private constructor(
)
}
+ /** The status of the backfill. */
class Status
@JsonCreator
private constructor(
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 01cb64ad..21bfe0a7 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
@@ -91,8 +91,8 @@ private constructor(
fun timeframeStart(): OffsetDateTime = timeframeStart.getRequired("timeframe_start")
/**
- * A boolean [computed property](../guides/extensibility/advanced-metrics#computed-properties)
- * used to filter the set of events to deprecate
+ * A boolean [computed property](/extensibility/advanced-metrics#computed-properties) used to
+ * filter the set of events to deprecate
*/
fun deprecationFilter(): Optional =
Optional.ofNullable(deprecationFilter.getNullable("deprecation_filter"))
@@ -139,8 +139,8 @@ private constructor(
fun _timeframeStart(): JsonField = timeframeStart
/**
- * A boolean [computed property](../guides/extensibility/advanced-metrics#computed-properties)
- * used to filter the set of events to deprecate
+ * A boolean [computed property](/extensibility/advanced-metrics#computed-properties) used to
+ * filter the set of events to deprecate
*/
@JsonProperty("deprecation_filter")
@ExcludeMissing
@@ -289,25 +289,22 @@ private constructor(
}
/**
- * A boolean
- * [computed property](../guides/extensibility/advanced-metrics#computed-properties) used to
- * filter the set of events to deprecate
+ * A boolean [computed property](/extensibility/advanced-metrics#computed-properties) used
+ * to filter the set of events to deprecate
*/
fun deprecationFilter(deprecationFilter: String?) =
deprecationFilter(JsonField.ofNullable(deprecationFilter))
/**
- * A boolean
- * [computed property](../guides/extensibility/advanced-metrics#computed-properties) used to
- * filter the set of events to deprecate
+ * A boolean [computed property](/extensibility/advanced-metrics#computed-properties) used
+ * to filter the set of events to deprecate
*/
fun deprecationFilter(deprecationFilter: Optional) =
deprecationFilter(deprecationFilter.orElse(null))
/**
- * A boolean
- * [computed property](../guides/extensibility/advanced-metrics#computed-properties) used to
- * filter the set of events to deprecate
+ * A boolean [computed property](/extensibility/advanced-metrics#computed-properties) used
+ * to filter the set of events to deprecate
*/
fun deprecationFilter(deprecationFilter: JsonField) = apply {
this.deprecationFilter = deprecationFilter
@@ -348,6 +345,7 @@ private constructor(
)
}
+ /** The status of the backfill. */
class Status
@JsonCreator
private constructor(
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 ad5f095d..74aa608c 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
@@ -19,6 +19,14 @@ import java.util.Optional
import java.util.stream.Stream
import java.util.stream.StreamSupport
+/**
+ * This endpoint returns a list of all backfills in a list format.
+ *
+ * The list of backfills is ordered starting from the most recently created backfill. The response
+ * also includes [`pagination_metadata`](/api-reference/pagination), which lets the caller retrieve
+ * the next page of results if they exist. More information about pagination can be found in the
+ * [Pagination-metadata schema](pagination).
+ */
class EventBackfillListPage
private constructor(
private val backfillsService: BackfillService,
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/EventBackfillListPageAsync.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/EventBackfillListPageAsync.kt
index dd9ad412..b4d66d11 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/EventBackfillListPageAsync.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/EventBackfillListPageAsync.kt
@@ -20,6 +20,14 @@ import java.util.concurrent.CompletableFuture
import java.util.concurrent.Executor
import java.util.function.Predicate
+/**
+ * This endpoint returns a list of all backfills in a list format.
+ *
+ * The list of backfills is ordered starting from the most recently created backfill. The response
+ * also includes [`pagination_metadata`](/api-reference/pagination), which lets the caller retrieve
+ * the next page of results if they exist. More information about pagination can be found in the
+ * [Pagination-metadata schema](pagination).
+ */
class EventBackfillListPageAsync
private constructor(
private val backfillsService: BackfillServiceAsync,
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 dd55dab5..5fae3935 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
@@ -12,7 +12,7 @@ import java.util.Optional
* This endpoint returns a list of all backfills in a list format.
*
* The list of backfills is ordered starting from the most recently created backfill. The response
- * also includes [`pagination_metadata`](../reference/pagination), which lets the caller retrieve
+ * also includes [`pagination_metadata`](/api-reference/pagination), which lets the caller retrieve
* the next page of results if they exist. More information about pagination can be found in the
* [Pagination-metadata schema](pagination).
*/
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 1a91d687..0478f05a 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
@@ -91,8 +91,8 @@ private constructor(
fun timeframeStart(): OffsetDateTime = timeframeStart.getRequired("timeframe_start")
/**
- * A boolean [computed property](../guides/extensibility/advanced-metrics#computed-properties)
- * used to filter the set of events to deprecate
+ * A boolean [computed property](/extensibility/advanced-metrics#computed-properties) used to
+ * filter the set of events to deprecate
*/
fun deprecationFilter(): Optional =
Optional.ofNullable(deprecationFilter.getNullable("deprecation_filter"))
@@ -139,8 +139,8 @@ private constructor(
fun _timeframeStart(): JsonField = timeframeStart
/**
- * A boolean [computed property](../guides/extensibility/advanced-metrics#computed-properties)
- * used to filter the set of events to deprecate
+ * A boolean [computed property](/extensibility/advanced-metrics#computed-properties) used to
+ * filter the set of events to deprecate
*/
@JsonProperty("deprecation_filter")
@ExcludeMissing
@@ -289,25 +289,22 @@ private constructor(
}
/**
- * A boolean
- * [computed property](../guides/extensibility/advanced-metrics#computed-properties) used to
- * filter the set of events to deprecate
+ * A boolean [computed property](/extensibility/advanced-metrics#computed-properties) used
+ * to filter the set of events to deprecate
*/
fun deprecationFilter(deprecationFilter: String?) =
deprecationFilter(JsonField.ofNullable(deprecationFilter))
/**
- * A boolean
- * [computed property](../guides/extensibility/advanced-metrics#computed-properties) used to
- * filter the set of events to deprecate
+ * A boolean [computed property](/extensibility/advanced-metrics#computed-properties) used
+ * to filter the set of events to deprecate
*/
fun deprecationFilter(deprecationFilter: Optional) =
deprecationFilter(deprecationFilter.orElse(null))
/**
- * A boolean
- * [computed property](../guides/extensibility/advanced-metrics#computed-properties) used to
- * filter the set of events to deprecate
+ * A boolean [computed property](/extensibility/advanced-metrics#computed-properties) used
+ * to filter the set of events to deprecate
*/
fun deprecationFilter(deprecationFilter: JsonField) = apply {
this.deprecationFilter = deprecationFilter
@@ -348,6 +345,7 @@ private constructor(
)
}
+ /** The status of the backfill. */
class Status
@JsonCreator
private constructor(
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 f1c80ec9..57505f66 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
@@ -91,8 +91,8 @@ private constructor(
fun timeframeStart(): OffsetDateTime = timeframeStart.getRequired("timeframe_start")
/**
- * A boolean [computed property](../guides/extensibility/advanced-metrics#computed-properties)
- * used to filter the set of events to deprecate
+ * A boolean [computed property](/extensibility/advanced-metrics#computed-properties) used to
+ * filter the set of events to deprecate
*/
fun deprecationFilter(): Optional =
Optional.ofNullable(deprecationFilter.getNullable("deprecation_filter"))
@@ -139,8 +139,8 @@ private constructor(
fun _timeframeStart(): JsonField = timeframeStart
/**
- * A boolean [computed property](../guides/extensibility/advanced-metrics#computed-properties)
- * used to filter the set of events to deprecate
+ * A boolean [computed property](/extensibility/advanced-metrics#computed-properties) used to
+ * filter the set of events to deprecate
*/
@JsonProperty("deprecation_filter")
@ExcludeMissing
@@ -289,25 +289,22 @@ private constructor(
}
/**
- * A boolean
- * [computed property](../guides/extensibility/advanced-metrics#computed-properties) used to
- * filter the set of events to deprecate
+ * A boolean [computed property](/extensibility/advanced-metrics#computed-properties) used
+ * to filter the set of events to deprecate
*/
fun deprecationFilter(deprecationFilter: String?) =
deprecationFilter(JsonField.ofNullable(deprecationFilter))
/**
- * A boolean
- * [computed property](../guides/extensibility/advanced-metrics#computed-properties) used to
- * filter the set of events to deprecate
+ * A boolean [computed property](/extensibility/advanced-metrics#computed-properties) used
+ * to filter the set of events to deprecate
*/
fun deprecationFilter(deprecationFilter: Optional) =
deprecationFilter(deprecationFilter.orElse(null))
/**
- * A boolean
- * [computed property](../guides/extensibility/advanced-metrics#computed-properties) used to
- * filter the set of events to deprecate
+ * A boolean [computed property](/extensibility/advanced-metrics#computed-properties) used
+ * to filter the set of events to deprecate
*/
fun deprecationFilter(deprecationFilter: JsonField) = apply {
this.deprecationFilter = deprecationFilter
@@ -348,6 +345,7 @@ private constructor(
)
}
+ /** The status of the backfill. */
class Status
@JsonCreator
private constructor(
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 f17c4e55..1a9430e7 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
@@ -180,7 +180,7 @@ import java.util.Optional
*
* If `debug=true` is not specified, the response will only contain `validation_failed`. Orb will
* still honor the idempotency guarantees set
- * [here](../guides/events-and-metrics/event-ingestion#event-volume-and-concurrency) in all cases.
+ * [here](/events-and-metrics/event-ingestion#event-volume-and-concurrency) in all cases.
*
* We strongly recommend that you only use debug mode as part of testing your initial Orb
* integration. Once you're ready to switch to production, disable debug mode to take advantage of
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 d3ec3c4d..ac654079 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
@@ -22,7 +22,7 @@ import java.util.Optional
/**
* This endpoint returns a filtered set of events for an account in a
- * [paginated list format](../reference/pagination).
+ * [paginated list format](/api-reference/pagination).
*
* Note that this is a `POST` endpoint rather than a `GET` endpoint because it employs a JSON body
* for search criteria rather than query parameters, allowing for a more flexible search syntax.
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 0839168f..42d46455 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
@@ -111,9 +111,9 @@ private constructor(
}
/**
- * The [Event](../guides/core-concepts.mdx#event) resource represents a usage event that has
- * been created for a customer. Events are the core of Orb's usage-based billing model, and are
- * used to calculate the usage charges for a given billing period.
+ * The [Event](/core-concepts#event) resource represents a usage event that has been created for
+ * a customer. Events are the core of Orb's usage-based billing model, and are used to calculate
+ * the usage charges for a given billing period.
*/
@NoAutoDetect
class Data
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 57da9682..4357814f 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
@@ -13,12 +13,12 @@ import java.util.Optional
/**
* This endpoint returns the event volume for an account in a
- * [paginated list format](../reference/pagination).
+ * [paginated list format](/api-reference/pagination).
*
* The event volume is aggregated by the hour and the
- * [timestamp](../reference/ingest#determining-event-timestamp) field is used to determine which
- * hour an event is associated with. Note, this means that late-arriving events increment the volume
- * count for the hour window the timestamp is in, not the latest hour window.
+ * [timestamp](/api-reference/event/ingest-events) field is used to determine which hour an event is
+ * associated with. Note, this means that late-arriving events increment the volume count for the
+ * hour window the timestamp is in, not the latest hour window.
*
* Each item in the response contains the count of events aggregated by the hour where the start and
* end time are hour-aligned and in UTC. When a specific timestamp is passed in for either start or
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 612b12d5..2e7e99df 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
@@ -32,11 +32,11 @@ import java.util.Optional
import kotlin.jvm.optionals.getOrNull
/**
- * An [`Invoice`](../guides/concepts#invoice) is a fundamental billing entity, representing the
- * request for payment for a single subscription. This includes a set of line items, which
- * correspond to prices in the subscription's plan and can represent fixed recurring fees or
- * usage-based fees. They are generated at the end of a billing period, or as the result of an
- * action, such as a cancellation.
+ * An [`Invoice`](/core-concepts#invoice) is a fundamental billing entity, representing the request
+ * for payment for a single subscription. This includes a set of line items, which correspond to
+ * prices in the subscription's plan and can represent fixed recurring fees or usage-based fees.
+ * They are generated at the end of a billing period, or as the result of an action, such as a
+ * cancellation.
*/
@NoAutoDetect
class Invoice
@@ -301,7 +301,10 @@ private constructor(
* This field is deprecated in favor of `discounts`. If a `discounts` list is provided, the
* first discount in the list will be returned. If the list is empty, `None` will be returned.
*/
- @JsonProperty("discount") @ExcludeMissing fun _discount(): JsonValue = discount
+ @Deprecated("deprecated")
+ @JsonProperty("discount")
+ @ExcludeMissing
+ fun _discount(): JsonValue = discount
fun discounts(): List = discounts.getRequired("discounts")
@@ -1318,6 +1321,7 @@ private constructor(
* first discount in the list will be returned. If the list is empty, `None` will be
* returned.
*/
+ @Deprecated("deprecated")
fun discount(discount: JsonValue) = apply { this.discount = discount }
fun discounts(discounts: List) = discounts(JsonField.of(discounts))
@@ -4621,224 +4625,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the key
* for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls into,
- * where each tier range is defined by an upper and lower bound. For example, the first ten
- * units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40 (i.e.
- * 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6 units
- * will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a percent
- * (the number of basis points to charge), as well as a cap per event to assess. For
- * example, this would allow you to assess a fee of 0.25% on every payment you process, with
- * a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given event
- * depends on the tier range that the billing period falls into. Each tier range is defined
- * by an upper bound. For example, after $1.5M of payment volume is reached, each individual
- * payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total. Similar
- * to tiered pricing, the BPS parameters of a given event depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For example,
- * the first few payments may have a 0.8 BPS take-rate and all payments after a specific
- * volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model. In a
- * one-dimensional matrix, the second value is `null`. Every configuration has a list of
- * `matrix_values` which give the unit prices for specified property values. In a
- * one-dimensional matrix, the matrix values will have `dimension_values` where the second
- * value of the pair is null. If an event does not match any of the dimension values in the
- * matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow unit
- * pricing. They also have an additional parameter `fixed_price_quantity`. If the Price
- * represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(): Optional = Optional.ofNullable(price.getNullable("price"))
@@ -4906,224 +4694,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the key
* for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls into,
- * where each tier range is defined by an upper and lower bound. For example, the first ten
- * units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40 (i.e.
- * 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6 units
- * will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a percent
- * (the number of basis points to charge), as well as a cap per event to assess. For
- * example, this would allow you to assess a fee of 0.25% on every payment you process, with
- * a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given event
- * depends on the tier range that the billing period falls into. Each tier range is defined
- * by an upper bound. For example, after $1.5M of payment volume is reached, each individual
- * payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total. Similar
- * to tiered pricing, the BPS parameters of a given event depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For example,
- * the first few payments may have a 0.8 BPS take-rate and all payments after a specific
- * volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model. In a
- * one-dimensional matrix, the second value is `null`. Every configuration has a list of
- * `matrix_values` which give the unit prices for specified property values. In a
- * one-dimensional matrix, the matrix values will have `dimension_values` where the second
- * value of the pair is null. If an event does not match any of the dimension values in the
- * matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow unit
- * pricing. They also have an additional parameter `fixed_price_quantity`. If the Price
- * represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
@JsonProperty("price") @ExcludeMissing fun _price(): JsonField = price
@@ -5335,224 +4907,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the
* key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls
- * into, where each tier range is defined by an upper and lower bound. For example, the
- * first ten units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40
- * (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6
- * units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to assess.
- * For example, this would allow you to assess a fee of 0.25% on every payment you
- * process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given
- * event depends on the tier range that the billing period falls into. Each tier range
- * is defined by an upper bound. For example, after $1.5M of payment volume is reached,
- * each individual payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total.
- * Similar to tiered pricing, the BPS parameters of a given event depends on the tier
- * range that it falls into, where each tier range is defined by an upper and lower
- * bound. For example, the first few payments may have a 0.8 BPS take-rate and all
- * payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model.
- * In a one-dimensional matrix, the second value is `null`. Every configuration has a
- * list of `matrix_values` which give the unit prices for specified property values. In
- * a one-dimensional matrix, the matrix values will have `dimension_values` where the
- * second value of the pair is null. If an event does not match any of the dimension
- * values in the matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow
- * unit pricing. They also have an additional parameter `fixed_price_quantity`. If the
- * Price represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(price: Price?) = price(JsonField.ofNullable(price))
@@ -5565,224 +4921,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the
* key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls
- * into, where each tier range is defined by an upper and lower bound. For example, the
- * first ten units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40
- * (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6
- * units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to assess.
- * For example, this would allow you to assess a fee of 0.25% on every payment you
- * process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given
- * event depends on the tier range that the billing period falls into. Each tier range
- * is defined by an upper bound. For example, after $1.5M of payment volume is reached,
- * each individual payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total.
- * Similar to tiered pricing, the BPS parameters of a given event depends on the tier
- * range that it falls into, where each tier range is defined by an upper and lower
- * bound. For example, the first few payments may have a 0.8 BPS take-rate and all
- * payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model.
- * In a one-dimensional matrix, the second value is `null`. Every configuration has a
- * list of `matrix_values` which give the unit prices for specified property values. In
- * a one-dimensional matrix, the matrix values will have `dimension_values` where the
- * second value of the pair is null. If an event does not match any of the dimension
- * values in the matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow
- * unit pricing. They also have an additional parameter `fixed_price_quantity`. If the
- * Price represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * 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))
@@ -5795,224 +4935,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the
* key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls
- * into, where each tier range is defined by an upper and lower bound. For example, the
- * first ten units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40
- * (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6
- * units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to assess.
- * For example, this would allow you to assess a fee of 0.25% on every payment you
- * process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given
- * event depends on the tier range that the billing period falls into. Each tier range
- * is defined by an upper bound. For example, after $1.5M of payment volume is reached,
- * each individual payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total.
- * Similar to tiered pricing, the BPS parameters of a given event depends on the tier
- * range that it falls into, where each tier range is defined by an upper and lower
- * bound. For example, the first few payments may have a 0.8 BPS take-rate and all
- * payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model.
- * In a one-dimensional matrix, the second value is `null`. Every configuration has a
- * list of `matrix_values` which give the unit prices for specified property values. In
- * a one-dimensional matrix, the matrix values will have `dimension_values` where the
- * second value of the pair is null. If an event does not match any of the dimension
- * values in the matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow
- * unit pricing. They also have an additional parameter `fixed_price_quantity`. If the
- * Price represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(price: JsonField) = apply { this.price = price }
@@ -6025,224 +4949,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the
* key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls
- * into, where each tier range is defined by an upper and lower bound. For example, the
- * first ten units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40
- * (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6
- * units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to assess.
- * For example, this would allow you to assess a fee of 0.25% on every payment you
- * process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given
- * event depends on the tier range that the billing period falls into. Each tier range
- * is defined by an upper bound. For example, after $1.5M of payment volume is reached,
- * each individual payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total.
- * Similar to tiered pricing, the BPS parameters of a given event depends on the tier
- * range that it falls into, where each tier range is defined by an upper and lower
- * bound. For example, the first few payments may have a 0.8 BPS take-rate and all
- * payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model.
- * In a one-dimensional matrix, the second value is `null`. Every configuration has a
- * list of `matrix_values` which give the unit prices for specified property values. In
- * a one-dimensional matrix, the matrix values will have `dimension_values` where the
- * second value of the pair is null. If an event does not match any of the dimension
- * values in the matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow
- * unit pricing. They also have an additional parameter `fixed_price_quantity`. If the
- * Price represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(unitPrice: Price.UnitPrice) = price(Price.ofUnitPrice(unitPrice))
@@ -6255,224 +4963,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the
* key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls
- * into, where each tier range is defined by an upper and lower bound. For example, the
- * first ten units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40
- * (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6
- * units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to assess.
- * For example, this would allow you to assess a fee of 0.25% on every payment you
- * process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given
- * event depends on the tier range that the billing period falls into. Each tier range
- * is defined by an upper bound. For example, after $1.5M of payment volume is reached,
- * each individual payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total.
- * Similar to tiered pricing, the BPS parameters of a given event depends on the tier
- * range that it falls into, where each tier range is defined by an upper and lower
- * bound. For example, the first few payments may have a 0.8 BPS take-rate and all
- * payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model.
- * In a one-dimensional matrix, the second value is `null`. Every configuration has a
- * list of `matrix_values` which give the unit prices for specified property values. In
- * a one-dimensional matrix, the matrix values will have `dimension_values` where the
- * second value of the pair is null. If an event does not match any of the dimension
- * values in the matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow
- * unit pricing. They also have an additional parameter `fixed_price_quantity`. If the
- * Price represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(packagePrice: Price.PackagePrice) = price(Price.ofPackagePrice(packagePrice))
@@ -6485,224 +4977,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the
* key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls
- * into, where each tier range is defined by an upper and lower bound. For example, the
- * first ten units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40
- * (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6
- * units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to assess.
- * For example, this would allow you to assess a fee of 0.25% on every payment you
- * process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given
- * event depends on the tier range that the billing period falls into. Each tier range
- * is defined by an upper bound. For example, after $1.5M of payment volume is reached,
- * each individual payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total.
- * Similar to tiered pricing, the BPS parameters of a given event depends on the tier
- * range that it falls into, where each tier range is defined by an upper and lower
- * bound. For example, the first few payments may have a 0.8 BPS take-rate and all
- * payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model.
- * In a one-dimensional matrix, the second value is `null`. Every configuration has a
- * list of `matrix_values` which give the unit prices for specified property values. In
- * a one-dimensional matrix, the matrix values will have `dimension_values` where the
- * second value of the pair is null. If an event does not match any of the dimension
- * values in the matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow
- * unit pricing. They also have an additional parameter `fixed_price_quantity`. If the
- * Price represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(matrixPrice: Price.MatrixPrice) = price(Price.ofMatrixPrice(matrixPrice))
@@ -6715,224 +4991,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the
* key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls
- * into, where each tier range is defined by an upper and lower bound. For example, the
- * first ten units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40
- * (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6
- * units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to assess.
- * For example, this would allow you to assess a fee of 0.25% on every payment you
- * process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given
- * event depends on the tier range that the billing period falls into. Each tier range
- * is defined by an upper bound. For example, after $1.5M of payment volume is reached,
- * each individual payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total.
- * Similar to tiered pricing, the BPS parameters of a given event depends on the tier
- * range that it falls into, where each tier range is defined by an upper and lower
- * bound. For example, the first few payments may have a 0.8 BPS take-rate and all
- * payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model.
- * In a one-dimensional matrix, the second value is `null`. Every configuration has a
- * list of `matrix_values` which give the unit prices for specified property values. In
- * a one-dimensional matrix, the matrix values will have `dimension_values` where the
- * second value of the pair is null. If an event does not match any of the dimension
- * values in the matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow
- * unit pricing. They also have an additional parameter `fixed_price_quantity`. If the
- * Price represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(tieredPrice: Price.TieredPrice) = price(Price.ofTieredPrice(tieredPrice))
@@ -6945,685 +5005,37 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the
* key for the configuration object that is present.
*
- * ## Unit pricing
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
+ */
+ fun price(tieredBpsPrice: Price.TieredBpsPrice) =
+ price(Price.ofTieredBpsPrice(tieredBpsPrice))
+
+ /**
+ * The Price resource represents a price that can be billed on a subscription, resulting
+ * in a charge on an invoice in the form of an invoice line item. Prices take a quantity
+ * and determine an amount to bill.
*
- * With unit pricing, each unit costs a fixed amount.
+ * Orb supports a few different pricing models out of the box. Each of these models is
+ * serialized differently in a given Price object. The model_type field determines the
+ * key for the configuration object that is present.
*
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
+ */
+ fun price(bpsPrice: Price.BpsPrice) = price(Price.ofBpsPrice(bpsPrice))
+
+ /**
+ * The Price resource represents a price that can be billed on a subscription, resulting
+ * in a charge on an invoice in the form of an invoice line item. Prices take a quantity
+ * and determine an amount to bill.
*
- * ## Tiered pricing
+ * Orb supports a few different pricing models out of the box. Each of these models is
+ * serialized differently in a given Price object. The model_type field determines the
+ * key for the configuration object that is present.
*
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls
- * into, where each tier range is defined by an upper and lower bound. For example, the
- * first ten units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40
- * (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6
- * units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to assess.
- * For example, this would allow you to assess a fee of 0.25% on every payment you
- * process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given
- * event depends on the tier range that the billing period falls into. Each tier range
- * is defined by an upper bound. For example, after $1.5M of payment volume is reached,
- * each individual payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total.
- * Similar to tiered pricing, the BPS parameters of a given event depends on the tier
- * range that it falls into, where each tier range is defined by an upper and lower
- * bound. For example, the first few payments may have a 0.8 BPS take-rate and all
- * payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model.
- * In a one-dimensional matrix, the second value is `null`. Every configuration has a
- * list of `matrix_values` which give the unit prices for specified property values. In
- * a one-dimensional matrix, the matrix values will have `dimension_values` where the
- * second value of the pair is null. If an event does not match any of the dimension
- * values in the matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow
- * unit pricing. They also have an additional parameter `fixed_price_quantity`. If the
- * Price represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
- */
- fun price(tieredBpsPrice: Price.TieredBpsPrice) =
- price(Price.ofTieredBpsPrice(tieredBpsPrice))
-
- /**
- * The Price resource represents a price that can be billed on a subscription, resulting
- * in a charge on an invoice in the form of an invoice line item. Prices take a quantity
- * and determine an amount to bill.
- *
- * Orb supports a few different pricing models out of the box. Each of these models is
- * serialized differently in a given Price object. The model_type field determines the
- * key for the configuration object that is present.
- *
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls
- * into, where each tier range is defined by an upper and lower bound. For example, the
- * first ten units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40
- * (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6
- * units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to assess.
- * For example, this would allow you to assess a fee of 0.25% on every payment you
- * process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given
- * event depends on the tier range that the billing period falls into. Each tier range
- * is defined by an upper bound. For example, after $1.5M of payment volume is reached,
- * each individual payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total.
- * Similar to tiered pricing, the BPS parameters of a given event depends on the tier
- * range that it falls into, where each tier range is defined by an upper and lower
- * bound. For example, the first few payments may have a 0.8 BPS take-rate and all
- * payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model.
- * In a one-dimensional matrix, the second value is `null`. Every configuration has a
- * list of `matrix_values` which give the unit prices for specified property values. In
- * a one-dimensional matrix, the matrix values will have `dimension_values` where the
- * second value of the pair is null. If an event does not match any of the dimension
- * values in the matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow
- * unit pricing. They also have an additional parameter `fixed_price_quantity`. If the
- * Price represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
- */
- fun price(bpsPrice: Price.BpsPrice) = price(Price.ofBpsPrice(bpsPrice))
-
- /**
- * The Price resource represents a price that can be billed on a subscription, resulting
- * in a charge on an invoice in the form of an invoice line item. Prices take a quantity
- * and determine an amount to bill.
- *
- * Orb supports a few different pricing models out of the box. Each of these models is
- * serialized differently in a given Price object. The model_type field determines the
- * key for the configuration object that is present.
- *
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls
- * into, where each tier range is defined by an upper and lower bound. For example, the
- * first ten units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40
- * (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6
- * units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to assess.
- * For example, this would allow you to assess a fee of 0.25% on every payment you
- * process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given
- * event depends on the tier range that the billing period falls into. Each tier range
- * is defined by an upper bound. For example, after $1.5M of payment volume is reached,
- * each individual payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total.
- * Similar to tiered pricing, the BPS parameters of a given event depends on the tier
- * range that it falls into, where each tier range is defined by an upper and lower
- * bound. For example, the first few payments may have a 0.8 BPS take-rate and all
- * payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model.
- * In a one-dimensional matrix, the second value is `null`. Every configuration has a
- * list of `matrix_values` which give the unit prices for specified property values. In
- * a one-dimensional matrix, the matrix values will have `dimension_values` where the
- * second value of the pair is null. If an event does not match any of the dimension
- * values in the matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow
- * unit pricing. They also have an additional parameter `fixed_price_quantity`. If the
- * Price represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(bulkBpsPrice: Price.BulkBpsPrice) = price(Price.ofBulkBpsPrice(bulkBpsPrice))
@@ -7636,224 +5048,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the
* key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls
- * into, where each tier range is defined by an upper and lower bound. For example, the
- * first ten units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40
- * (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6
- * units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to assess.
- * For example, this would allow you to assess a fee of 0.25% on every payment you
- * process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given
- * event depends on the tier range that the billing period falls into. Each tier range
- * is defined by an upper bound. For example, after $1.5M of payment volume is reached,
- * each individual payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total.
- * Similar to tiered pricing, the BPS parameters of a given event depends on the tier
- * range that it falls into, where each tier range is defined by an upper and lower
- * bound. For example, the first few payments may have a 0.8 BPS take-rate and all
- * payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model.
- * In a one-dimensional matrix, the second value is `null`. Every configuration has a
- * list of `matrix_values` which give the unit prices for specified property values. In
- * a one-dimensional matrix, the matrix values will have `dimension_values` where the
- * second value of the pair is null. If an event does not match any of the dimension
- * values in the matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow
- * unit pricing. They also have an additional parameter `fixed_price_quantity`. If the
- * Price represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(bulkPrice: Price.BulkPrice) = price(Price.ofBulkPrice(bulkPrice))
@@ -7866,224 +5062,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the
* key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls
- * into, where each tier range is defined by an upper and lower bound. For example, the
- * first ten units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40
- * (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6
- * units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to assess.
- * For example, this would allow you to assess a fee of 0.25% on every payment you
- * process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given
- * event depends on the tier range that the billing period falls into. Each tier range
- * is defined by an upper bound. For example, after $1.5M of payment volume is reached,
- * each individual payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total.
- * Similar to tiered pricing, the BPS parameters of a given event depends on the tier
- * range that it falls into, where each tier range is defined by an upper and lower
- * bound. For example, the first few payments may have a 0.8 BPS take-rate and all
- * payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model.
- * In a one-dimensional matrix, the second value is `null`. Every configuration has a
- * list of `matrix_values` which give the unit prices for specified property values. In
- * a one-dimensional matrix, the matrix values will have `dimension_values` where the
- * second value of the pair is null. If an event does not match any of the dimension
- * values in the matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow
- * unit pricing. They also have an additional parameter `fixed_price_quantity`. If the
- * Price represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(thresholdTotalAmountPrice: Price.ThresholdTotalAmountPrice) =
price(Price.ofThresholdTotalAmountPrice(thresholdTotalAmountPrice))
@@ -8097,224 +5077,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the
* key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls
- * into, where each tier range is defined by an upper and lower bound. For example, the
- * first ten units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40
- * (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6
- * units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to assess.
- * For example, this would allow you to assess a fee of 0.25% on every payment you
- * process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given
- * event depends on the tier range that the billing period falls into. Each tier range
- * is defined by an upper bound. For example, after $1.5M of payment volume is reached,
- * each individual payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total.
- * Similar to tiered pricing, the BPS parameters of a given event depends on the tier
- * range that it falls into, where each tier range is defined by an upper and lower
- * bound. For example, the first few payments may have a 0.8 BPS take-rate and all
- * payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model.
- * In a one-dimensional matrix, the second value is `null`. Every configuration has a
- * list of `matrix_values` which give the unit prices for specified property values. In
- * a one-dimensional matrix, the matrix values will have `dimension_values` where the
- * second value of the pair is null. If an event does not match any of the dimension
- * values in the matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow
- * unit pricing. They also have an additional parameter `fixed_price_quantity`. If the
- * Price represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(tieredPackagePrice: Price.TieredPackagePrice) =
price(Price.ofTieredPackagePrice(tieredPackagePrice))
@@ -8328,224 +5092,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the
* key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls
- * into, where each tier range is defined by an upper and lower bound. For example, the
- * first ten units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40
- * (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6
- * units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to assess.
- * For example, this would allow you to assess a fee of 0.25% on every payment you
- * process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given
- * event depends on the tier range that the billing period falls into. Each tier range
- * is defined by an upper bound. For example, after $1.5M of payment volume is reached,
- * each individual payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total.
- * Similar to tiered pricing, the BPS parameters of a given event depends on the tier
- * range that it falls into, where each tier range is defined by an upper and lower
- * bound. For example, the first few payments may have a 0.8 BPS take-rate and all
- * payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model.
- * In a one-dimensional matrix, the second value is `null`. Every configuration has a
- * list of `matrix_values` which give the unit prices for specified property values. In
- * a one-dimensional matrix, the matrix values will have `dimension_values` where the
- * second value of the pair is null. If an event does not match any of the dimension
- * values in the matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow
- * unit pricing. They also have an additional parameter `fixed_price_quantity`. If the
- * Price represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(groupedTieredPrice: Price.GroupedTieredPrice) =
price(Price.ofGroupedTieredPrice(groupedTieredPrice))
@@ -8559,224 +5107,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the
* key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls
- * into, where each tier range is defined by an upper and lower bound. For example, the
- * first ten units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40
- * (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6
- * units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to assess.
- * For example, this would allow you to assess a fee of 0.25% on every payment you
- * process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given
- * event depends on the tier range that the billing period falls into. Each tier range
- * is defined by an upper bound. For example, after $1.5M of payment volume is reached,
- * each individual payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total.
- * Similar to tiered pricing, the BPS parameters of a given event depends on the tier
- * range that it falls into, where each tier range is defined by an upper and lower
- * bound. For example, the first few payments may have a 0.8 BPS take-rate and all
- * payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model.
- * In a one-dimensional matrix, the second value is `null`. Every configuration has a
- * list of `matrix_values` which give the unit prices for specified property values. In
- * a one-dimensional matrix, the matrix values will have `dimension_values` where the
- * second value of the pair is null. If an event does not match any of the dimension
- * values in the matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow
- * unit pricing. They also have an additional parameter `fixed_price_quantity`. If the
- * Price represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(tieredWithMinimumPrice: Price.TieredWithMinimumPrice) =
price(Price.ofTieredWithMinimumPrice(tieredWithMinimumPrice))
@@ -8790,224 +5122,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the
* key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls
- * into, where each tier range is defined by an upper and lower bound. For example, the
- * first ten units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40
- * (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6
- * units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to assess.
- * For example, this would allow you to assess a fee of 0.25% on every payment you
- * process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given
- * event depends on the tier range that the billing period falls into. Each tier range
- * is defined by an upper bound. For example, after $1.5M of payment volume is reached,
- * each individual payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total.
- * Similar to tiered pricing, the BPS parameters of a given event depends on the tier
- * range that it falls into, where each tier range is defined by an upper and lower
- * bound. For example, the first few payments may have a 0.8 BPS take-rate and all
- * payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model.
- * In a one-dimensional matrix, the second value is `null`. Every configuration has a
- * list of `matrix_values` which give the unit prices for specified property values. In
- * a one-dimensional matrix, the matrix values will have `dimension_values` where the
- * second value of the pair is null. If an event does not match any of the dimension
- * values in the matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow
- * unit pricing. They also have an additional parameter `fixed_price_quantity`. If the
- * Price represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(tieredPackageWithMinimumPrice: Price.TieredPackageWithMinimumPrice) =
price(Price.ofTieredPackageWithMinimumPrice(tieredPackageWithMinimumPrice))
@@ -9021,224 +5137,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the
* key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls
- * into, where each tier range is defined by an upper and lower bound. For example, the
- * first ten units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40
- * (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6
- * units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to assess.
- * For example, this would allow you to assess a fee of 0.25% on every payment you
- * process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given
- * event depends on the tier range that the billing period falls into. Each tier range
- * is defined by an upper bound. For example, after $1.5M of payment volume is reached,
- * each individual payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total.
- * Similar to tiered pricing, the BPS parameters of a given event depends on the tier
- * range that it falls into, where each tier range is defined by an upper and lower
- * bound. For example, the first few payments may have a 0.8 BPS take-rate and all
- * payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model.
- * In a one-dimensional matrix, the second value is `null`. Every configuration has a
- * list of `matrix_values` which give the unit prices for specified property values. In
- * a one-dimensional matrix, the matrix values will have `dimension_values` where the
- * second value of the pair is null. If an event does not match any of the dimension
- * values in the matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow
- * unit pricing. They also have an additional parameter `fixed_price_quantity`. If the
- * Price represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(packageWithAllocationPrice: Price.PackageWithAllocationPrice) =
price(Price.ofPackageWithAllocationPrice(packageWithAllocationPrice))
@@ -9252,455 +5152,23 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the
* key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls
- * into, where each tier range is defined by an upper and lower bound. For example, the
- * first ten units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40
- * (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6
- * units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to assess.
- * For example, this would allow you to assess a fee of 0.25% on every payment you
- * process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given
- * event depends on the tier range that the billing period falls into. Each tier range
- * is defined by an upper bound. For example, after $1.5M of payment volume is reached,
- * each individual payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total.
- * Similar to tiered pricing, the BPS parameters of a given event depends on the tier
- * range that it falls into, where each tier range is defined by an upper and lower
- * bound. For example, the first few payments may have a 0.8 BPS take-rate and all
- * payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model.
- * In a one-dimensional matrix, the second value is `null`. Every configuration has a
- * list of `matrix_values` which give the unit prices for specified property values. In
- * a one-dimensional matrix, the matrix values will have `dimension_values` where the
- * second value of the pair is null. If an event does not match any of the dimension
- * values in the matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow
- * unit pricing. They also have an additional parameter `fixed_price_quantity`. If the
- * Price represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
- fun price(unitWithPercentPrice: Price.UnitWithPercentPrice) =
- price(Price.ofUnitWithPercentPrice(unitWithPercentPrice))
-
- /**
- * The Price resource represents a price that can be billed on a subscription, resulting
- * in a charge on an invoice in the form of an invoice line item. Prices take a quantity
- * and determine an amount to bill.
- *
- * Orb supports a few different pricing models out of the box. Each of these models is
- * serialized differently in a given Price object. The model_type field determines the
- * key for the configuration object that is present.
- *
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls
- * into, where each tier range is defined by an upper and lower bound. For example, the
- * first ten units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40
- * (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6
- * units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to assess.
- * For example, this would allow you to assess a fee of 0.25% on every payment you
- * process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given
- * event depends on the tier range that the billing period falls into. Each tier range
- * is defined by an upper bound. For example, after $1.5M of payment volume is reached,
- * each individual payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total.
- * Similar to tiered pricing, the BPS parameters of a given event depends on the tier
- * range that it falls into, where each tier range is defined by an upper and lower
- * bound. For example, the first few payments may have a 0.8 BPS take-rate and all
- * payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model.
- * In a one-dimensional matrix, the second value is `null`. Every configuration has a
- * list of `matrix_values` which give the unit prices for specified property values. In
- * a one-dimensional matrix, the matrix values will have `dimension_values` where the
- * second value of the pair is null. If an event does not match any of the dimension
- * values in the matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
+ fun price(unitWithPercentPrice: Price.UnitWithPercentPrice) =
+ price(Price.ofUnitWithPercentPrice(unitWithPercentPrice))
+
+ /**
+ * The Price resource represents a price that can be billed on a subscription, resulting
+ * in a charge on an invoice in the form of an invoice line item. Prices take a quantity
+ * and determine an amount to bill.
*
- * Fixed fees are prices that are applied independent of usage quantities, and follow
- * unit pricing. They also have an additional parameter `fixed_price_quantity`. If the
- * Price represents a fixed cost, this represents the quantity of units applied.
+ * Orb supports a few different pricing models out of the box. Each of these models is
+ * serialized differently in a given Price object. The model_type field determines the
+ * key for the configuration object that is present.
*
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(matrixWithAllocationPrice: Price.MatrixWithAllocationPrice) =
price(Price.ofMatrixWithAllocationPrice(matrixWithAllocationPrice))
@@ -9714,224 +5182,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the
* key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls
- * into, where each tier range is defined by an upper and lower bound. For example, the
- * first ten units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40
- * (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6
- * units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to assess.
- * For example, this would allow you to assess a fee of 0.25% on every payment you
- * process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given
- * event depends on the tier range that the billing period falls into. Each tier range
- * is defined by an upper bound. For example, after $1.5M of payment volume is reached,
- * each individual payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total.
- * Similar to tiered pricing, the BPS parameters of a given event depends on the tier
- * range that it falls into, where each tier range is defined by an upper and lower
- * bound. For example, the first few payments may have a 0.8 BPS take-rate and all
- * payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model.
- * In a one-dimensional matrix, the second value is `null`. Every configuration has a
- * list of `matrix_values` which give the unit prices for specified property values. In
- * a one-dimensional matrix, the matrix values will have `dimension_values` where the
- * second value of the pair is null. If an event does not match any of the dimension
- * values in the matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow
- * unit pricing. They also have an additional parameter `fixed_price_quantity`. If the
- * Price represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(tieredWithProrationPrice: Price.TieredWithProrationPrice) =
price(Price.ofTieredWithProrationPrice(tieredWithProrationPrice))
@@ -9945,224 +5197,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the
* key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls
- * into, where each tier range is defined by an upper and lower bound. For example, the
- * first ten units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40
- * (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6
- * units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to assess.
- * For example, this would allow you to assess a fee of 0.25% on every payment you
- * process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given
- * event depends on the tier range that the billing period falls into. Each tier range
- * is defined by an upper bound. For example, after $1.5M of payment volume is reached,
- * each individual payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total.
- * Similar to tiered pricing, the BPS parameters of a given event depends on the tier
- * range that it falls into, where each tier range is defined by an upper and lower
- * bound. For example, the first few payments may have a 0.8 BPS take-rate and all
- * payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model.
- * In a one-dimensional matrix, the second value is `null`. Every configuration has a
- * list of `matrix_values` which give the unit prices for specified property values. In
- * a one-dimensional matrix, the matrix values will have `dimension_values` where the
- * second value of the pair is null. If an event does not match any of the dimension
- * values in the matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow
- * unit pricing. They also have an additional parameter `fixed_price_quantity`. If the
- * Price represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(unitWithProrationPrice: Price.UnitWithProrationPrice) =
price(Price.ofUnitWithProrationPrice(unitWithProrationPrice))
@@ -10176,224 +5212,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the
* key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls
- * into, where each tier range is defined by an upper and lower bound. For example, the
- * first ten units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40
- * (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6
- * units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to assess.
- * For example, this would allow you to assess a fee of 0.25% on every payment you
- * process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given
- * event depends on the tier range that the billing period falls into. Each tier range
- * is defined by an upper bound. For example, after $1.5M of payment volume is reached,
- * each individual payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total.
- * Similar to tiered pricing, the BPS parameters of a given event depends on the tier
- * range that it falls into, where each tier range is defined by an upper and lower
- * bound. For example, the first few payments may have a 0.8 BPS take-rate and all
- * payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model.
- * In a one-dimensional matrix, the second value is `null`. Every configuration has a
- * list of `matrix_values` which give the unit prices for specified property values. In
- * a one-dimensional matrix, the matrix values will have `dimension_values` where the
- * second value of the pair is null. If an event does not match any of the dimension
- * values in the matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow
- * unit pricing. They also have an additional parameter `fixed_price_quantity`. If the
- * Price represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(groupedAllocationPrice: Price.GroupedAllocationPrice) =
price(Price.ofGroupedAllocationPrice(groupedAllocationPrice))
@@ -10407,224 +5227,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the
* key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls
- * into, where each tier range is defined by an upper and lower bound. For example, the
- * first ten units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40
- * (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6
- * units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to assess.
- * For example, this would allow you to assess a fee of 0.25% on every payment you
- * process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given
- * event depends on the tier range that the billing period falls into. Each tier range
- * is defined by an upper bound. For example, after $1.5M of payment volume is reached,
- * each individual payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total.
- * Similar to tiered pricing, the BPS parameters of a given event depends on the tier
- * range that it falls into, where each tier range is defined by an upper and lower
- * bound. For example, the first few payments may have a 0.8 BPS take-rate and all
- * payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model.
- * In a one-dimensional matrix, the second value is `null`. Every configuration has a
- * list of `matrix_values` which give the unit prices for specified property values. In
- * a one-dimensional matrix, the matrix values will have `dimension_values` where the
- * second value of the pair is null. If an event does not match any of the dimension
- * values in the matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow
- * unit pricing. They also have an additional parameter `fixed_price_quantity`. If the
- * Price represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(groupedWithProratedMinimumPrice: Price.GroupedWithProratedMinimumPrice) =
price(Price.ofGroupedWithProratedMinimumPrice(groupedWithProratedMinimumPrice))
@@ -10638,224 +5242,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the
* key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls
- * into, where each tier range is defined by an upper and lower bound. For example, the
- * first ten units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40
- * (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6
- * units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to assess.
- * For example, this would allow you to assess a fee of 0.25% on every payment you
- * process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given
- * event depends on the tier range that the billing period falls into. Each tier range
- * is defined by an upper bound. For example, after $1.5M of payment volume is reached,
- * each individual payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total.
- * Similar to tiered pricing, the BPS parameters of a given event depends on the tier
- * range that it falls into, where each tier range is defined by an upper and lower
- * bound. For example, the first few payments may have a 0.8 BPS take-rate and all
- * payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model.
- * In a one-dimensional matrix, the second value is `null`. Every configuration has a
- * list of `matrix_values` which give the unit prices for specified property values. In
- * a one-dimensional matrix, the matrix values will have `dimension_values` where the
- * second value of the pair is null. If an event does not match any of the dimension
- * values in the matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow
- * unit pricing. They also have an additional parameter `fixed_price_quantity`. If the
- * Price represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(groupedWithMeteredMinimumPrice: Price.GroupedWithMeteredMinimumPrice) =
price(Price.ofGroupedWithMeteredMinimumPrice(groupedWithMeteredMinimumPrice))
@@ -10869,224 +5257,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the
* key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls
- * into, where each tier range is defined by an upper and lower bound. For example, the
- * first ten units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40
- * (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6
- * units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to assess.
- * For example, this would allow you to assess a fee of 0.25% on every payment you
- * process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given
- * event depends on the tier range that the billing period falls into. Each tier range
- * is defined by an upper bound. For example, after $1.5M of payment volume is reached,
- * each individual payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total.
- * Similar to tiered pricing, the BPS parameters of a given event depends on the tier
- * range that it falls into, where each tier range is defined by an upper and lower
- * bound. For example, the first few payments may have a 0.8 BPS take-rate and all
- * payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model.
- * In a one-dimensional matrix, the second value is `null`. Every configuration has a
- * list of `matrix_values` which give the unit prices for specified property values. In
- * a one-dimensional matrix, the matrix values will have `dimension_values` where the
- * second value of the pair is null. If an event does not match any of the dimension
- * values in the matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow
- * unit pricing. They also have an additional parameter `fixed_price_quantity`. If the
- * Price represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(matrixWithDisplayNamePrice: Price.MatrixWithDisplayNamePrice) =
price(Price.ofMatrixWithDisplayNamePrice(matrixWithDisplayNamePrice))
@@ -11100,224 +5272,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the
* key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls
- * into, where each tier range is defined by an upper and lower bound. For example, the
- * first ten units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40
- * (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6
- * units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to assess.
- * For example, this would allow you to assess a fee of 0.25% on every payment you
- * process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given
- * event depends on the tier range that the billing period falls into. Each tier range
- * is defined by an upper bound. For example, after $1.5M of payment volume is reached,
- * each individual payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total.
- * Similar to tiered pricing, the BPS parameters of a given event depends on the tier
- * range that it falls into, where each tier range is defined by an upper and lower
- * bound. For example, the first few payments may have a 0.8 BPS take-rate and all
- * payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model.
- * In a one-dimensional matrix, the second value is `null`. Every configuration has a
- * list of `matrix_values` which give the unit prices for specified property values. In
- * a one-dimensional matrix, the matrix values will have `dimension_values` where the
- * second value of the pair is null. If an event does not match any of the dimension
- * values in the matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow
- * unit pricing. They also have an additional parameter `fixed_price_quantity`. If the
- * Price represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(bulkWithProrationPrice: Price.BulkWithProrationPrice) =
price(Price.ofBulkWithProrationPrice(bulkWithProrationPrice))
@@ -11331,459 +5287,12 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the
* key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls
- * into, where each tier range is defined by an upper and lower bound. For example, the
- * first ten units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40
- * (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6
- * units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to assess.
- * For example, this would allow you to assess a fee of 0.25% on every payment you
- * process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given
- * event depends on the tier range that the billing period falls into. Each tier range
- * is defined by an upper bound. For example, after $1.5M of payment volume is reached,
- * each individual payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total.
- * Similar to tiered pricing, the BPS parameters of a given event depends on the tier
- * range that it falls into, where each tier range is defined by an upper and lower
- * bound. For example, the first few payments may have a 0.8 BPS take-rate and all
- * payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model.
- * In a one-dimensional matrix, the second value is `null`. Every configuration has a
- * list of `matrix_values` which give the unit prices for specified property values. In
- * a one-dimensional matrix, the matrix values will have `dimension_values` where the
- * second value of the pair is null. If an event does not match any of the dimension
- * values in the matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow
- * unit pricing. They also have an additional parameter `fixed_price_quantity`. If the
- * Price represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(groupedTieredPackagePrice: Price.GroupedTieredPackagePrice) =
price(Price.ofGroupedTieredPackagePrice(groupedTieredPackagePrice))
- /**
- * The Price resource represents a price that can be billed on a subscription, resulting
- * in a charge on an invoice in the form of an invoice line item. Prices take a quantity
- * and determine an amount to bill.
- *
- * Orb supports a few different pricing models out of the box. Each of these models is
- * serialized differently in a given Price object. The model_type field determines the
- * key for the configuration object that is present.
- *
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls
- * into, where each tier range is defined by an upper and lower bound. For example, the
- * first ten units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40
- * (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6
- * units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to assess.
- * For example, this would allow you to assess a fee of 0.25% on every payment you
- * process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given
- * event depends on the tier range that the billing period falls into. Each tier range
- * is defined by an upper bound. For example, after $1.5M of payment volume is reached,
- * each individual payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total.
- * Similar to tiered pricing, the BPS parameters of a given event depends on the tier
- * range that it falls into, where each tier range is defined by an upper and lower
- * bound. For example, the first few payments may have a 0.8 BPS take-rate and all
- * payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model.
- * In a one-dimensional matrix, the second value is `null`. Every configuration has a
- * list of `matrix_values` which give the unit prices for specified property values. In
- * a one-dimensional matrix, the matrix values will have `dimension_values` where the
- * second value of the pair is null. If an event does not match any of the dimension
- * values in the matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow
- * unit pricing. They also have an additional parameter `fixed_price_quantity`. If the
- * Price represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
- */
- fun price(maxGroupTieredPrice: Price.MaxGroupTieredPrice) =
- price(Price.ofMaxGroupTieredPrice(maxGroupTieredPrice))
-
fun quantity(quantity: Double) = quantity(JsonField.of(quantity))
fun quantity(quantity: JsonField) = apply { this.quantity = quantity }
@@ -14549,6 +8058,7 @@ private constructor(
)
}
+ /** The payment provider that attempted to collect the payment. */
class PaymentProvider
@JsonCreator
private constructor(
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceFetchParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceFetchParams.kt
index b979efff..3656e550 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceFetchParams.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceFetchParams.kt
@@ -8,9 +8,7 @@ import com.withorb.api.core.http.Headers
import com.withorb.api.core.http.QueryParams
import java.util.Objects
-/**
- * This endpoint is used to fetch an [`Invoice`](../guides/concepts#invoice) given an identifier.
- */
+/** This endpoint is used to fetch an [`Invoice`](/core-concepts#invoice) given an identifier. */
class InvoiceFetchParams
constructor(
private val invoiceId: String,
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceFetchUpcomingParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceFetchUpcomingParams.kt
index f0ec684b..48316665 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceFetchUpcomingParams.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceFetchUpcomingParams.kt
@@ -9,8 +9,8 @@ import com.withorb.api.core.http.QueryParams
import java.util.Objects
/**
- * This endpoint can be used to fetch the upcoming [invoice](../guides/concepts#invoice) for the
- * current billing period given a subscription.
+ * This endpoint can be used to fetch the upcoming [invoice](/core-concepts#invoice) for the current
+ * billing period given a subscription.
*/
class InvoiceFetchUpcomingParams
constructor(
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 1d727cf7..bdef266e 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
@@ -294,7 +294,10 @@ private constructor(
* This field is deprecated in favor of `discounts`. If a `discounts` list is provided, the
* first discount in the list will be returned. If the list is empty, `None` will be returned.
*/
- @JsonProperty("discount") @ExcludeMissing fun _discount(): JsonValue = discount
+ @Deprecated("deprecated")
+ @JsonProperty("discount")
+ @ExcludeMissing
+ fun _discount(): JsonValue = discount
fun discounts(): List = discounts.getRequired("discounts")
@@ -1312,6 +1315,7 @@ private constructor(
* first discount in the list will be returned. If the list is empty, `None` will be
* returned.
*/
+ @Deprecated("deprecated")
fun discount(discount: JsonValue) = apply { this.discount = discount }
fun discounts(discounts: List) = discounts(JsonField.of(discounts))
@@ -4615,224 +4619,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the key
* for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls into,
- * where each tier range is defined by an upper and lower bound. For example, the first ten
- * units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40 (i.e.
- * 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6 units
- * will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a percent
- * (the number of basis points to charge), as well as a cap per event to assess. For
- * example, this would allow you to assess a fee of 0.25% on every payment you process, with
- * a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given event
- * depends on the tier range that the billing period falls into. Each tier range is defined
- * by an upper bound. For example, after $1.5M of payment volume is reached, each individual
- * payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total. Similar
- * to tiered pricing, the BPS parameters of a given event depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For example,
- * the first few payments may have a 0.8 BPS take-rate and all payments after a specific
- * volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model. In a
- * one-dimensional matrix, the second value is `null`. Every configuration has a list of
- * `matrix_values` which give the unit prices for specified property values. In a
- * one-dimensional matrix, the matrix values will have `dimension_values` where the second
- * value of the pair is null. If an event does not match any of the dimension values in the
- * matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow unit
- * pricing. They also have an additional parameter `fixed_price_quantity`. If the Price
- * represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(): Optional = Optional.ofNullable(price.getNullable("price"))
@@ -4900,224 +4688,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the key
* for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls into,
- * where each tier range is defined by an upper and lower bound. For example, the first ten
- * units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40 (i.e.
- * 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6 units
- * will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a percent
- * (the number of basis points to charge), as well as a cap per event to assess. For
- * example, this would allow you to assess a fee of 0.25% on every payment you process, with
- * a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given event
- * depends on the tier range that the billing period falls into. Each tier range is defined
- * by an upper bound. For example, after $1.5M of payment volume is reached, each individual
- * payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total. Similar
- * to tiered pricing, the BPS parameters of a given event depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For example,
- * the first few payments may have a 0.8 BPS take-rate and all payments after a specific
- * volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model. In a
- * one-dimensional matrix, the second value is `null`. Every configuration has a list of
- * `matrix_values` which give the unit prices for specified property values. In a
- * one-dimensional matrix, the matrix values will have `dimension_values` where the second
- * value of the pair is null. If an event does not match any of the dimension values in the
- * matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow unit
- * pricing. They also have an additional parameter `fixed_price_quantity`. If the Price
- * represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
@JsonProperty("price") @ExcludeMissing fun _price(): JsonField = price
@@ -5329,224 +4901,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the
* key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls
- * into, where each tier range is defined by an upper and lower bound. For example, the
- * first ten units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40
- * (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6
- * units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to assess.
- * For example, this would allow you to assess a fee of 0.25% on every payment you
- * process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given
- * event depends on the tier range that the billing period falls into. Each tier range
- * is defined by an upper bound. For example, after $1.5M of payment volume is reached,
- * each individual payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total.
- * Similar to tiered pricing, the BPS parameters of a given event depends on the tier
- * range that it falls into, where each tier range is defined by an upper and lower
- * bound. For example, the first few payments may have a 0.8 BPS take-rate and all
- * payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model.
- * In a one-dimensional matrix, the second value is `null`. Every configuration has a
- * list of `matrix_values` which give the unit prices for specified property values. In
- * a one-dimensional matrix, the matrix values will have `dimension_values` where the
- * second value of the pair is null. If an event does not match any of the dimension
- * values in the matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow
- * unit pricing. They also have an additional parameter `fixed_price_quantity`. If the
- * Price represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(price: Price?) = price(JsonField.ofNullable(price))
@@ -5559,224 +4915,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the
* key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls
- * into, where each tier range is defined by an upper and lower bound. For example, the
- * first ten units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40
- * (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6
- * units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to assess.
- * For example, this would allow you to assess a fee of 0.25% on every payment you
- * process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given
- * event depends on the tier range that the billing period falls into. Each tier range
- * is defined by an upper bound. For example, after $1.5M of payment volume is reached,
- * each individual payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total.
- * Similar to tiered pricing, the BPS parameters of a given event depends on the tier
- * range that it falls into, where each tier range is defined by an upper and lower
- * bound. For example, the first few payments may have a 0.8 BPS take-rate and all
- * payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model.
- * In a one-dimensional matrix, the second value is `null`. Every configuration has a
- * list of `matrix_values` which give the unit prices for specified property values. In
- * a one-dimensional matrix, the matrix values will have `dimension_values` where the
- * second value of the pair is null. If an event does not match any of the dimension
- * values in the matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow
- * unit pricing. They also have an additional parameter `fixed_price_quantity`. If the
- * Price represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * 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))
@@ -5789,224 +4929,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the
* key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls
- * into, where each tier range is defined by an upper and lower bound. For example, the
- * first ten units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40
- * (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6
- * units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to assess.
- * For example, this would allow you to assess a fee of 0.25% on every payment you
- * process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given
- * event depends on the tier range that the billing period falls into. Each tier range
- * is defined by an upper bound. For example, after $1.5M of payment volume is reached,
- * each individual payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total.
- * Similar to tiered pricing, the BPS parameters of a given event depends on the tier
- * range that it falls into, where each tier range is defined by an upper and lower
- * bound. For example, the first few payments may have a 0.8 BPS take-rate and all
- * payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model.
- * In a one-dimensional matrix, the second value is `null`. Every configuration has a
- * list of `matrix_values` which give the unit prices for specified property values. In
- * a one-dimensional matrix, the matrix values will have `dimension_values` where the
- * second value of the pair is null. If an event does not match any of the dimension
- * values in the matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow
- * unit pricing. They also have an additional parameter `fixed_price_quantity`. If the
- * Price represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(price: JsonField) = apply { this.price = price }
@@ -6019,224 +4943,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the
* key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls
- * into, where each tier range is defined by an upper and lower bound. For example, the
- * first ten units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40
- * (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6
- * units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to assess.
- * For example, this would allow you to assess a fee of 0.25% on every payment you
- * process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given
- * event depends on the tier range that the billing period falls into. Each tier range
- * is defined by an upper bound. For example, after $1.5M of payment volume is reached,
- * each individual payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total.
- * Similar to tiered pricing, the BPS parameters of a given event depends on the tier
- * range that it falls into, where each tier range is defined by an upper and lower
- * bound. For example, the first few payments may have a 0.8 BPS take-rate and all
- * payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model.
- * In a one-dimensional matrix, the second value is `null`. Every configuration has a
- * list of `matrix_values` which give the unit prices for specified property values. In
- * a one-dimensional matrix, the matrix values will have `dimension_values` where the
- * second value of the pair is null. If an event does not match any of the dimension
- * values in the matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow
- * unit pricing. They also have an additional parameter `fixed_price_quantity`. If the
- * Price represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(unitPrice: Price.UnitPrice) = price(Price.ofUnitPrice(unitPrice))
@@ -6249,224 +4957,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the
* key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls
- * into, where each tier range is defined by an upper and lower bound. For example, the
- * first ten units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40
- * (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6
- * units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to assess.
- * For example, this would allow you to assess a fee of 0.25% on every payment you
- * process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given
- * event depends on the tier range that the billing period falls into. Each tier range
- * is defined by an upper bound. For example, after $1.5M of payment volume is reached,
- * each individual payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total.
- * Similar to tiered pricing, the BPS parameters of a given event depends on the tier
- * range that it falls into, where each tier range is defined by an upper and lower
- * bound. For example, the first few payments may have a 0.8 BPS take-rate and all
- * payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model.
- * In a one-dimensional matrix, the second value is `null`. Every configuration has a
- * list of `matrix_values` which give the unit prices for specified property values. In
- * a one-dimensional matrix, the matrix values will have `dimension_values` where the
- * second value of the pair is null. If an event does not match any of the dimension
- * values in the matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow
- * unit pricing. They also have an additional parameter `fixed_price_quantity`. If the
- * Price represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(packagePrice: Price.PackagePrice) = price(Price.ofPackagePrice(packagePrice))
@@ -6479,224 +4971,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the
* key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls
- * into, where each tier range is defined by an upper and lower bound. For example, the
- * first ten units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40
- * (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6
- * units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to assess.
- * For example, this would allow you to assess a fee of 0.25% on every payment you
- * process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given
- * event depends on the tier range that the billing period falls into. Each tier range
- * is defined by an upper bound. For example, after $1.5M of payment volume is reached,
- * each individual payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total.
- * Similar to tiered pricing, the BPS parameters of a given event depends on the tier
- * range that it falls into, where each tier range is defined by an upper and lower
- * bound. For example, the first few payments may have a 0.8 BPS take-rate and all
- * payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model.
- * In a one-dimensional matrix, the second value is `null`. Every configuration has a
- * list of `matrix_values` which give the unit prices for specified property values. In
- * a one-dimensional matrix, the matrix values will have `dimension_values` where the
- * second value of the pair is null. If an event does not match any of the dimension
- * values in the matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow
- * unit pricing. They also have an additional parameter `fixed_price_quantity`. If the
- * Price represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(matrixPrice: Price.MatrixPrice) = price(Price.ofMatrixPrice(matrixPrice))
@@ -6709,224 +4985,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the
* key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls
- * into, where each tier range is defined by an upper and lower bound. For example, the
- * first ten units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40
- * (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6
- * units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to assess.
- * For example, this would allow you to assess a fee of 0.25% on every payment you
- * process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given
- * event depends on the tier range that the billing period falls into. Each tier range
- * is defined by an upper bound. For example, after $1.5M of payment volume is reached,
- * each individual payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total.
- * Similar to tiered pricing, the BPS parameters of a given event depends on the tier
- * range that it falls into, where each tier range is defined by an upper and lower
- * bound. For example, the first few payments may have a 0.8 BPS take-rate and all
- * payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model.
- * In a one-dimensional matrix, the second value is `null`. Every configuration has a
- * list of `matrix_values` which give the unit prices for specified property values. In
- * a one-dimensional matrix, the matrix values will have `dimension_values` where the
- * second value of the pair is null. If an event does not match any of the dimension
- * values in the matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow
- * unit pricing. They also have an additional parameter `fixed_price_quantity`. If the
- * Price represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(tieredPrice: Price.TieredPrice) = price(Price.ofTieredPrice(tieredPrice))
@@ -6939,685 +4999,37 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the
* key for the configuration object that is present.
*
- * ## Unit pricing
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
+ */
+ fun price(tieredBpsPrice: Price.TieredBpsPrice) =
+ price(Price.ofTieredBpsPrice(tieredBpsPrice))
+
+ /**
+ * The Price resource represents a price that can be billed on a subscription, resulting
+ * in a charge on an invoice in the form of an invoice line item. Prices take a quantity
+ * and determine an amount to bill.
*
- * With unit pricing, each unit costs a fixed amount.
+ * Orb supports a few different pricing models out of the box. Each of these models is
+ * serialized differently in a given Price object. The model_type field determines the
+ * key for the configuration object that is present.
*
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
+ */
+ fun price(bpsPrice: Price.BpsPrice) = price(Price.ofBpsPrice(bpsPrice))
+
+ /**
+ * The Price resource represents a price that can be billed on a subscription, resulting
+ * in a charge on an invoice in the form of an invoice line item. Prices take a quantity
+ * and determine an amount to bill.
*
- * ## Tiered pricing
+ * Orb supports a few different pricing models out of the box. Each of these models is
+ * serialized differently in a given Price object. The model_type field determines the
+ * key for the configuration object that is present.
*
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls
- * into, where each tier range is defined by an upper and lower bound. For example, the
- * first ten units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40
- * (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6
- * units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to assess.
- * For example, this would allow you to assess a fee of 0.25% on every payment you
- * process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given
- * event depends on the tier range that the billing period falls into. Each tier range
- * is defined by an upper bound. For example, after $1.5M of payment volume is reached,
- * each individual payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total.
- * Similar to tiered pricing, the BPS parameters of a given event depends on the tier
- * range that it falls into, where each tier range is defined by an upper and lower
- * bound. For example, the first few payments may have a 0.8 BPS take-rate and all
- * payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model.
- * In a one-dimensional matrix, the second value is `null`. Every configuration has a
- * list of `matrix_values` which give the unit prices for specified property values. In
- * a one-dimensional matrix, the matrix values will have `dimension_values` where the
- * second value of the pair is null. If an event does not match any of the dimension
- * values in the matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow
- * unit pricing. They also have an additional parameter `fixed_price_quantity`. If the
- * Price represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
- */
- fun price(tieredBpsPrice: Price.TieredBpsPrice) =
- price(Price.ofTieredBpsPrice(tieredBpsPrice))
-
- /**
- * The Price resource represents a price that can be billed on a subscription, resulting
- * in a charge on an invoice in the form of an invoice line item. Prices take a quantity
- * and determine an amount to bill.
- *
- * Orb supports a few different pricing models out of the box. Each of these models is
- * serialized differently in a given Price object. The model_type field determines the
- * key for the configuration object that is present.
- *
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls
- * into, where each tier range is defined by an upper and lower bound. For example, the
- * first ten units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40
- * (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6
- * units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to assess.
- * For example, this would allow you to assess a fee of 0.25% on every payment you
- * process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given
- * event depends on the tier range that the billing period falls into. Each tier range
- * is defined by an upper bound. For example, after $1.5M of payment volume is reached,
- * each individual payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total.
- * Similar to tiered pricing, the BPS parameters of a given event depends on the tier
- * range that it falls into, where each tier range is defined by an upper and lower
- * bound. For example, the first few payments may have a 0.8 BPS take-rate and all
- * payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model.
- * In a one-dimensional matrix, the second value is `null`. Every configuration has a
- * list of `matrix_values` which give the unit prices for specified property values. In
- * a one-dimensional matrix, the matrix values will have `dimension_values` where the
- * second value of the pair is null. If an event does not match any of the dimension
- * values in the matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow
- * unit pricing. They also have an additional parameter `fixed_price_quantity`. If the
- * Price represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
- */
- fun price(bpsPrice: Price.BpsPrice) = price(Price.ofBpsPrice(bpsPrice))
-
- /**
- * The Price resource represents a price that can be billed on a subscription, resulting
- * in a charge on an invoice in the form of an invoice line item. Prices take a quantity
- * and determine an amount to bill.
- *
- * Orb supports a few different pricing models out of the box. Each of these models is
- * serialized differently in a given Price object. The model_type field determines the
- * key for the configuration object that is present.
- *
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls
- * into, where each tier range is defined by an upper and lower bound. For example, the
- * first ten units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40
- * (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6
- * units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to assess.
- * For example, this would allow you to assess a fee of 0.25% on every payment you
- * process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given
- * event depends on the tier range that the billing period falls into. Each tier range
- * is defined by an upper bound. For example, after $1.5M of payment volume is reached,
- * each individual payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total.
- * Similar to tiered pricing, the BPS parameters of a given event depends on the tier
- * range that it falls into, where each tier range is defined by an upper and lower
- * bound. For example, the first few payments may have a 0.8 BPS take-rate and all
- * payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model.
- * In a one-dimensional matrix, the second value is `null`. Every configuration has a
- * list of `matrix_values` which give the unit prices for specified property values. In
- * a one-dimensional matrix, the matrix values will have `dimension_values` where the
- * second value of the pair is null. If an event does not match any of the dimension
- * values in the matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow
- * unit pricing. They also have an additional parameter `fixed_price_quantity`. If the
- * Price represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(bulkBpsPrice: Price.BulkBpsPrice) = price(Price.ofBulkBpsPrice(bulkBpsPrice))
@@ -7630,224 +5042,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the
* key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls
- * into, where each tier range is defined by an upper and lower bound. For example, the
- * first ten units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40
- * (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6
- * units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to assess.
- * For example, this would allow you to assess a fee of 0.25% on every payment you
- * process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given
- * event depends on the tier range that the billing period falls into. Each tier range
- * is defined by an upper bound. For example, after $1.5M of payment volume is reached,
- * each individual payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total.
- * Similar to tiered pricing, the BPS parameters of a given event depends on the tier
- * range that it falls into, where each tier range is defined by an upper and lower
- * bound. For example, the first few payments may have a 0.8 BPS take-rate and all
- * payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model.
- * In a one-dimensional matrix, the second value is `null`. Every configuration has a
- * list of `matrix_values` which give the unit prices for specified property values. In
- * a one-dimensional matrix, the matrix values will have `dimension_values` where the
- * second value of the pair is null. If an event does not match any of the dimension
- * values in the matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow
- * unit pricing. They also have an additional parameter `fixed_price_quantity`. If the
- * Price represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(bulkPrice: Price.BulkPrice) = price(Price.ofBulkPrice(bulkPrice))
@@ -7860,224 +5056,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the
* key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls
- * into, where each tier range is defined by an upper and lower bound. For example, the
- * first ten units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40
- * (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6
- * units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to assess.
- * For example, this would allow you to assess a fee of 0.25% on every payment you
- * process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given
- * event depends on the tier range that the billing period falls into. Each tier range
- * is defined by an upper bound. For example, after $1.5M of payment volume is reached,
- * each individual payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total.
- * Similar to tiered pricing, the BPS parameters of a given event depends on the tier
- * range that it falls into, where each tier range is defined by an upper and lower
- * bound. For example, the first few payments may have a 0.8 BPS take-rate and all
- * payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model.
- * In a one-dimensional matrix, the second value is `null`. Every configuration has a
- * list of `matrix_values` which give the unit prices for specified property values. In
- * a one-dimensional matrix, the matrix values will have `dimension_values` where the
- * second value of the pair is null. If an event does not match any of the dimension
- * values in the matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow
- * unit pricing. They also have an additional parameter `fixed_price_quantity`. If the
- * Price represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(thresholdTotalAmountPrice: Price.ThresholdTotalAmountPrice) =
price(Price.ofThresholdTotalAmountPrice(thresholdTotalAmountPrice))
@@ -8091,224 +5071,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the
* key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls
- * into, where each tier range is defined by an upper and lower bound. For example, the
- * first ten units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40
- * (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6
- * units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to assess.
- * For example, this would allow you to assess a fee of 0.25% on every payment you
- * process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given
- * event depends on the tier range that the billing period falls into. Each tier range
- * is defined by an upper bound. For example, after $1.5M of payment volume is reached,
- * each individual payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total.
- * Similar to tiered pricing, the BPS parameters of a given event depends on the tier
- * range that it falls into, where each tier range is defined by an upper and lower
- * bound. For example, the first few payments may have a 0.8 BPS take-rate and all
- * payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model.
- * In a one-dimensional matrix, the second value is `null`. Every configuration has a
- * list of `matrix_values` which give the unit prices for specified property values. In
- * a one-dimensional matrix, the matrix values will have `dimension_values` where the
- * second value of the pair is null. If an event does not match any of the dimension
- * values in the matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow
- * unit pricing. They also have an additional parameter `fixed_price_quantity`. If the
- * Price represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(tieredPackagePrice: Price.TieredPackagePrice) =
price(Price.ofTieredPackagePrice(tieredPackagePrice))
@@ -8322,224 +5086,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the
* key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls
- * into, where each tier range is defined by an upper and lower bound. For example, the
- * first ten units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40
- * (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6
- * units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to assess.
- * For example, this would allow you to assess a fee of 0.25% on every payment you
- * process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given
- * event depends on the tier range that the billing period falls into. Each tier range
- * is defined by an upper bound. For example, after $1.5M of payment volume is reached,
- * each individual payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total.
- * Similar to tiered pricing, the BPS parameters of a given event depends on the tier
- * range that it falls into, where each tier range is defined by an upper and lower
- * bound. For example, the first few payments may have a 0.8 BPS take-rate and all
- * payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model.
- * In a one-dimensional matrix, the second value is `null`. Every configuration has a
- * list of `matrix_values` which give the unit prices for specified property values. In
- * a one-dimensional matrix, the matrix values will have `dimension_values` where the
- * second value of the pair is null. If an event does not match any of the dimension
- * values in the matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow
- * unit pricing. They also have an additional parameter `fixed_price_quantity`. If the
- * Price represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(groupedTieredPrice: Price.GroupedTieredPrice) =
price(Price.ofGroupedTieredPrice(groupedTieredPrice))
@@ -8553,224 +5101,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the
* key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls
- * into, where each tier range is defined by an upper and lower bound. For example, the
- * first ten units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40
- * (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6
- * units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to assess.
- * For example, this would allow you to assess a fee of 0.25% on every payment you
- * process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given
- * event depends on the tier range that the billing period falls into. Each tier range
- * is defined by an upper bound. For example, after $1.5M of payment volume is reached,
- * each individual payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total.
- * Similar to tiered pricing, the BPS parameters of a given event depends on the tier
- * range that it falls into, where each tier range is defined by an upper and lower
- * bound. For example, the first few payments may have a 0.8 BPS take-rate and all
- * payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model.
- * In a one-dimensional matrix, the second value is `null`. Every configuration has a
- * list of `matrix_values` which give the unit prices for specified property values. In
- * a one-dimensional matrix, the matrix values will have `dimension_values` where the
- * second value of the pair is null. If an event does not match any of the dimension
- * values in the matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow
- * unit pricing. They also have an additional parameter `fixed_price_quantity`. If the
- * Price represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(tieredWithMinimumPrice: Price.TieredWithMinimumPrice) =
price(Price.ofTieredWithMinimumPrice(tieredWithMinimumPrice))
@@ -8784,224 +5116,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the
* key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls
- * into, where each tier range is defined by an upper and lower bound. For example, the
- * first ten units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40
- * (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6
- * units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to assess.
- * For example, this would allow you to assess a fee of 0.25% on every payment you
- * process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given
- * event depends on the tier range that the billing period falls into. Each tier range
- * is defined by an upper bound. For example, after $1.5M of payment volume is reached,
- * each individual payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total.
- * Similar to tiered pricing, the BPS parameters of a given event depends on the tier
- * range that it falls into, where each tier range is defined by an upper and lower
- * bound. For example, the first few payments may have a 0.8 BPS take-rate and all
- * payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model.
- * In a one-dimensional matrix, the second value is `null`. Every configuration has a
- * list of `matrix_values` which give the unit prices for specified property values. In
- * a one-dimensional matrix, the matrix values will have `dimension_values` where the
- * second value of the pair is null. If an event does not match any of the dimension
- * values in the matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow
- * unit pricing. They also have an additional parameter `fixed_price_quantity`. If the
- * Price represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(tieredPackageWithMinimumPrice: Price.TieredPackageWithMinimumPrice) =
price(Price.ofTieredPackageWithMinimumPrice(tieredPackageWithMinimumPrice))
@@ -9015,224 +5131,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the
* key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls
- * into, where each tier range is defined by an upper and lower bound. For example, the
- * first ten units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40
- * (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6
- * units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to assess.
- * For example, this would allow you to assess a fee of 0.25% on every payment you
- * process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given
- * event depends on the tier range that the billing period falls into. Each tier range
- * is defined by an upper bound. For example, after $1.5M of payment volume is reached,
- * each individual payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total.
- * Similar to tiered pricing, the BPS parameters of a given event depends on the tier
- * range that it falls into, where each tier range is defined by an upper and lower
- * bound. For example, the first few payments may have a 0.8 BPS take-rate and all
- * payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model.
- * In a one-dimensional matrix, the second value is `null`. Every configuration has a
- * list of `matrix_values` which give the unit prices for specified property values. In
- * a one-dimensional matrix, the matrix values will have `dimension_values` where the
- * second value of the pair is null. If an event does not match any of the dimension
- * values in the matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow
- * unit pricing. They also have an additional parameter `fixed_price_quantity`. If the
- * Price represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(packageWithAllocationPrice: Price.PackageWithAllocationPrice) =
price(Price.ofPackageWithAllocationPrice(packageWithAllocationPrice))
@@ -9246,455 +5146,23 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the
* key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls
- * into, where each tier range is defined by an upper and lower bound. For example, the
- * first ten units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40
- * (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6
- * units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to assess.
- * For example, this would allow you to assess a fee of 0.25% on every payment you
- * process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given
- * event depends on the tier range that the billing period falls into. Each tier range
- * is defined by an upper bound. For example, after $1.5M of payment volume is reached,
- * each individual payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total.
- * Similar to tiered pricing, the BPS parameters of a given event depends on the tier
- * range that it falls into, where each tier range is defined by an upper and lower
- * bound. For example, the first few payments may have a 0.8 BPS take-rate and all
- * payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model.
- * In a one-dimensional matrix, the second value is `null`. Every configuration has a
- * list of `matrix_values` which give the unit prices for specified property values. In
- * a one-dimensional matrix, the matrix values will have `dimension_values` where the
- * second value of the pair is null. If an event does not match any of the dimension
- * values in the matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow
- * unit pricing. They also have an additional parameter `fixed_price_quantity`. If the
- * Price represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
- fun price(unitWithPercentPrice: Price.UnitWithPercentPrice) =
- price(Price.ofUnitWithPercentPrice(unitWithPercentPrice))
-
- /**
- * The Price resource represents a price that can be billed on a subscription, resulting
- * in a charge on an invoice in the form of an invoice line item. Prices take a quantity
- * and determine an amount to bill.
- *
- * Orb supports a few different pricing models out of the box. Each of these models is
- * serialized differently in a given Price object. The model_type field determines the
- * key for the configuration object that is present.
- *
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls
- * into, where each tier range is defined by an upper and lower bound. For example, the
- * first ten units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40
- * (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6
- * units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to assess.
- * For example, this would allow you to assess a fee of 0.25% on every payment you
- * process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given
- * event depends on the tier range that the billing period falls into. Each tier range
- * is defined by an upper bound. For example, after $1.5M of payment volume is reached,
- * each individual payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total.
- * Similar to tiered pricing, the BPS parameters of a given event depends on the tier
- * range that it falls into, where each tier range is defined by an upper and lower
- * bound. For example, the first few payments may have a 0.8 BPS take-rate and all
- * payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model.
- * In a one-dimensional matrix, the second value is `null`. Every configuration has a
- * list of `matrix_values` which give the unit prices for specified property values. In
- * a one-dimensional matrix, the matrix values will have `dimension_values` where the
- * second value of the pair is null. If an event does not match any of the dimension
- * values in the matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
+ fun price(unitWithPercentPrice: Price.UnitWithPercentPrice) =
+ price(Price.ofUnitWithPercentPrice(unitWithPercentPrice))
+
+ /**
+ * The Price resource represents a price that can be billed on a subscription, resulting
+ * in a charge on an invoice in the form of an invoice line item. Prices take a quantity
+ * and determine an amount to bill.
*
- * Fixed fees are prices that are applied independent of usage quantities, and follow
- * unit pricing. They also have an additional parameter `fixed_price_quantity`. If the
- * Price represents a fixed cost, this represents the quantity of units applied.
+ * Orb supports a few different pricing models out of the box. Each of these models is
+ * serialized differently in a given Price object. The model_type field determines the
+ * key for the configuration object that is present.
*
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(matrixWithAllocationPrice: Price.MatrixWithAllocationPrice) =
price(Price.ofMatrixWithAllocationPrice(matrixWithAllocationPrice))
@@ -9708,224 +5176,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the
* key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls
- * into, where each tier range is defined by an upper and lower bound. For example, the
- * first ten units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40
- * (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6
- * units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to assess.
- * For example, this would allow you to assess a fee of 0.25% on every payment you
- * process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given
- * event depends on the tier range that the billing period falls into. Each tier range
- * is defined by an upper bound. For example, after $1.5M of payment volume is reached,
- * each individual payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total.
- * Similar to tiered pricing, the BPS parameters of a given event depends on the tier
- * range that it falls into, where each tier range is defined by an upper and lower
- * bound. For example, the first few payments may have a 0.8 BPS take-rate and all
- * payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model.
- * In a one-dimensional matrix, the second value is `null`. Every configuration has a
- * list of `matrix_values` which give the unit prices for specified property values. In
- * a one-dimensional matrix, the matrix values will have `dimension_values` where the
- * second value of the pair is null. If an event does not match any of the dimension
- * values in the matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow
- * unit pricing. They also have an additional parameter `fixed_price_quantity`. If the
- * Price represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(tieredWithProrationPrice: Price.TieredWithProrationPrice) =
price(Price.ofTieredWithProrationPrice(tieredWithProrationPrice))
@@ -9939,224 +5191,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the
* key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls
- * into, where each tier range is defined by an upper and lower bound. For example, the
- * first ten units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40
- * (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6
- * units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to assess.
- * For example, this would allow you to assess a fee of 0.25% on every payment you
- * process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given
- * event depends on the tier range that the billing period falls into. Each tier range
- * is defined by an upper bound. For example, after $1.5M of payment volume is reached,
- * each individual payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total.
- * Similar to tiered pricing, the BPS parameters of a given event depends on the tier
- * range that it falls into, where each tier range is defined by an upper and lower
- * bound. For example, the first few payments may have a 0.8 BPS take-rate and all
- * payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model.
- * In a one-dimensional matrix, the second value is `null`. Every configuration has a
- * list of `matrix_values` which give the unit prices for specified property values. In
- * a one-dimensional matrix, the matrix values will have `dimension_values` where the
- * second value of the pair is null. If an event does not match any of the dimension
- * values in the matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow
- * unit pricing. They also have an additional parameter `fixed_price_quantity`. If the
- * Price represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(unitWithProrationPrice: Price.UnitWithProrationPrice) =
price(Price.ofUnitWithProrationPrice(unitWithProrationPrice))
@@ -10170,224 +5206,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the
* key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls
- * into, where each tier range is defined by an upper and lower bound. For example, the
- * first ten units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40
- * (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6
- * units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to assess.
- * For example, this would allow you to assess a fee of 0.25% on every payment you
- * process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given
- * event depends on the tier range that the billing period falls into. Each tier range
- * is defined by an upper bound. For example, after $1.5M of payment volume is reached,
- * each individual payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total.
- * Similar to tiered pricing, the BPS parameters of a given event depends on the tier
- * range that it falls into, where each tier range is defined by an upper and lower
- * bound. For example, the first few payments may have a 0.8 BPS take-rate and all
- * payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model.
- * In a one-dimensional matrix, the second value is `null`. Every configuration has a
- * list of `matrix_values` which give the unit prices for specified property values. In
- * a one-dimensional matrix, the matrix values will have `dimension_values` where the
- * second value of the pair is null. If an event does not match any of the dimension
- * values in the matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow
- * unit pricing. They also have an additional parameter `fixed_price_quantity`. If the
- * Price represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(groupedAllocationPrice: Price.GroupedAllocationPrice) =
price(Price.ofGroupedAllocationPrice(groupedAllocationPrice))
@@ -10401,224 +5221,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the
* key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls
- * into, where each tier range is defined by an upper and lower bound. For example, the
- * first ten units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40
- * (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6
- * units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to assess.
- * For example, this would allow you to assess a fee of 0.25% on every payment you
- * process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given
- * event depends on the tier range that the billing period falls into. Each tier range
- * is defined by an upper bound. For example, after $1.5M of payment volume is reached,
- * each individual payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total.
- * Similar to tiered pricing, the BPS parameters of a given event depends on the tier
- * range that it falls into, where each tier range is defined by an upper and lower
- * bound. For example, the first few payments may have a 0.8 BPS take-rate and all
- * payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model.
- * In a one-dimensional matrix, the second value is `null`. Every configuration has a
- * list of `matrix_values` which give the unit prices for specified property values. In
- * a one-dimensional matrix, the matrix values will have `dimension_values` where the
- * second value of the pair is null. If an event does not match any of the dimension
- * values in the matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow
- * unit pricing. They also have an additional parameter `fixed_price_quantity`. If the
- * Price represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(groupedWithProratedMinimumPrice: Price.GroupedWithProratedMinimumPrice) =
price(Price.ofGroupedWithProratedMinimumPrice(groupedWithProratedMinimumPrice))
@@ -10632,224 +5236,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the
* key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls
- * into, where each tier range is defined by an upper and lower bound. For example, the
- * first ten units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40
- * (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6
- * units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to assess.
- * For example, this would allow you to assess a fee of 0.25% on every payment you
- * process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given
- * event depends on the tier range that the billing period falls into. Each tier range
- * is defined by an upper bound. For example, after $1.5M of payment volume is reached,
- * each individual payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total.
- * Similar to tiered pricing, the BPS parameters of a given event depends on the tier
- * range that it falls into, where each tier range is defined by an upper and lower
- * bound. For example, the first few payments may have a 0.8 BPS take-rate and all
- * payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model.
- * In a one-dimensional matrix, the second value is `null`. Every configuration has a
- * list of `matrix_values` which give the unit prices for specified property values. In
- * a one-dimensional matrix, the matrix values will have `dimension_values` where the
- * second value of the pair is null. If an event does not match any of the dimension
- * values in the matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow
- * unit pricing. They also have an additional parameter `fixed_price_quantity`. If the
- * Price represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(groupedWithMeteredMinimumPrice: Price.GroupedWithMeteredMinimumPrice) =
price(Price.ofGroupedWithMeteredMinimumPrice(groupedWithMeteredMinimumPrice))
@@ -10863,224 +5251,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the
* key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls
- * into, where each tier range is defined by an upper and lower bound. For example, the
- * first ten units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40
- * (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6
- * units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to assess.
- * For example, this would allow you to assess a fee of 0.25% on every payment you
- * process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given
- * event depends on the tier range that the billing period falls into. Each tier range
- * is defined by an upper bound. For example, after $1.5M of payment volume is reached,
- * each individual payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total.
- * Similar to tiered pricing, the BPS parameters of a given event depends on the tier
- * range that it falls into, where each tier range is defined by an upper and lower
- * bound. For example, the first few payments may have a 0.8 BPS take-rate and all
- * payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model.
- * In a one-dimensional matrix, the second value is `null`. Every configuration has a
- * list of `matrix_values` which give the unit prices for specified property values. In
- * a one-dimensional matrix, the matrix values will have `dimension_values` where the
- * second value of the pair is null. If an event does not match any of the dimension
- * values in the matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow
- * unit pricing. They also have an additional parameter `fixed_price_quantity`. If the
- * Price represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(matrixWithDisplayNamePrice: Price.MatrixWithDisplayNamePrice) =
price(Price.ofMatrixWithDisplayNamePrice(matrixWithDisplayNamePrice))
@@ -11094,224 +5266,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the
* key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls
- * into, where each tier range is defined by an upper and lower bound. For example, the
- * first ten units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40
- * (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6
- * units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to assess.
- * For example, this would allow you to assess a fee of 0.25% on every payment you
- * process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given
- * event depends on the tier range that the billing period falls into. Each tier range
- * is defined by an upper bound. For example, after $1.5M of payment volume is reached,
- * each individual payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total.
- * Similar to tiered pricing, the BPS parameters of a given event depends on the tier
- * range that it falls into, where each tier range is defined by an upper and lower
- * bound. For example, the first few payments may have a 0.8 BPS take-rate and all
- * payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model.
- * In a one-dimensional matrix, the second value is `null`. Every configuration has a
- * list of `matrix_values` which give the unit prices for specified property values. In
- * a one-dimensional matrix, the matrix values will have `dimension_values` where the
- * second value of the pair is null. If an event does not match any of the dimension
- * values in the matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow
- * unit pricing. They also have an additional parameter `fixed_price_quantity`. If the
- * Price represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(bulkWithProrationPrice: Price.BulkWithProrationPrice) =
price(Price.ofBulkWithProrationPrice(bulkWithProrationPrice))
@@ -11325,459 +5281,12 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the
* key for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls
- * into, where each tier range is defined by an upper and lower bound. For example, the
- * first ten units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40
- * (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6
- * units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to assess.
- * For example, this would allow you to assess a fee of 0.25% on every payment you
- * process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given
- * event depends on the tier range that the billing period falls into. Each tier range
- * is defined by an upper bound. For example, after $1.5M of payment volume is reached,
- * each individual payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total.
- * Similar to tiered pricing, the BPS parameters of a given event depends on the tier
- * range that it falls into, where each tier range is defined by an upper and lower
- * bound. For example, the first few payments may have a 0.8 BPS take-rate and all
- * payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model.
- * In a one-dimensional matrix, the second value is `null`. Every configuration has a
- * list of `matrix_values` which give the unit prices for specified property values. In
- * a one-dimensional matrix, the matrix values will have `dimension_values` where the
- * second value of the pair is null. If an event does not match any of the dimension
- * values in the matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow
- * unit pricing. They also have an additional parameter `fixed_price_quantity`. If the
- * Price represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(groupedTieredPackagePrice: Price.GroupedTieredPackagePrice) =
price(Price.ofGroupedTieredPackagePrice(groupedTieredPackagePrice))
- /**
- * The Price resource represents a price that can be billed on a subscription, resulting
- * in a charge on an invoice in the form of an invoice line item. Prices take a quantity
- * and determine an amount to bill.
- *
- * Orb supports a few different pricing models out of the box. Each of these models is
- * serialized differently in a given Price object. The model_type field determines the
- * key for the configuration object that is present.
- *
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls
- * into, where each tier range is defined by an upper and lower bound. For example, the
- * first ten units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40
- * (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6
- * units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a
- * percent (the number of basis points to charge), as well as a cap per event to assess.
- * For example, this would allow you to assess a fee of 0.25% on every payment you
- * process, with a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given
- * event depends on the tier range that the billing period falls into. Each tier range
- * is defined by an upper bound. For example, after $1.5M of payment volume is reached,
- * each individual payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total.
- * Similar to tiered pricing, the BPS parameters of a given event depends on the tier
- * range that it falls into, where each tier range is defined by an upper and lower
- * bound. For example, the first few payments may have a 0.8 BPS take-rate and all
- * payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model.
- * In a one-dimensional matrix, the second value is `null`. Every configuration has a
- * list of `matrix_values` which give the unit prices for specified property values. In
- * a one-dimensional matrix, the matrix values will have `dimension_values` where the
- * second value of the pair is null. If an event does not match any of the dimension
- * values in the matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow
- * unit pricing. They also have an additional parameter `fixed_price_quantity`. If the
- * Price represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
- */
- fun price(maxGroupTieredPrice: Price.MaxGroupTieredPrice) =
- price(Price.ofMaxGroupTieredPrice(maxGroupTieredPrice))
-
fun quantity(quantity: Double) = quantity(JsonField.of(quantity))
fun quantity(quantity: JsonField) = apply { this.quantity = quantity }
@@ -14543,6 +8052,7 @@ private constructor(
)
}
+ /** The payment provider that attempted to collect the payment. */
class PaymentProvider
@JsonCreator
private constructor(
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 a22efe71..386d63f1 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
@@ -120,224 +120,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the key for
* the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls into,
- * where each tier range is defined by an upper and lower bound. For example, the first ten
- * units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For example,
- * if you've bought less than 10 units, they may each be $0.50 for a total of $5.00. Once you've
- * bought more than 10 units, all units may now be priced at $0.40 (i.e. 101 units total would
- * be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For example,
- * if the package size is set to 5, then 4 units will be billed as 5 and 6 units will be billed
- * at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a percent (the
- * number of basis points to charge), as well as a cap per event to assess. For example, this
- * would allow you to assess a fee of 0.25% on every payment you process, with a maximum charge
- * of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total quantity
- * across all events. Similar to bulk pricing, the BPS parameters of a given event depends on
- * the tier range that the billing period falls into. Each tier range is defined by an upper
- * bound. For example, after $1.5M of payment volume is reached, each individual payment may
- * have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total. Similar to
- * tiered pricing, the BPS parameters of a given event depends on the tier range that it falls
- * into, where each tier range is defined by an upper and lower bound. For example, the first
- * few payments may have a 0.8 BPS take-rate and all payments after a specific volume may incur
- * a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix. `dimensions`
- * defines the two event property values evaluated in this pricing model. In a one-dimensional
- * matrix, the second value is `null`. Every configuration has a list of `matrix_values` which
- * give the unit prices for specified property values. In a one-dimensional matrix, the matrix
- * values will have `dimension_values` where the second value of the pair is null. If an event
- * does not match any of the dimension values in the matrix, it will resort to the
- * `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow unit
- * pricing. They also have an additional parameter `fixed_price_quantity`. If the Price
- * represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(): Optional = Optional.ofNullable(price.getNullable("price"))
@@ -402,224 +186,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the key for
* the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls into,
- * where each tier range is defined by an upper and lower bound. For example, the first ten
- * units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For example,
- * if you've bought less than 10 units, they may each be $0.50 for a total of $5.00. Once you've
- * bought more than 10 units, all units may now be priced at $0.40 (i.e. 101 units total would
- * be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For example,
- * if the package size is set to 5, then 4 units will be billed as 5 and 6 units will be billed
- * at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a percent (the
- * number of basis points to charge), as well as a cap per event to assess. For example, this
- * would allow you to assess a fee of 0.25% on every payment you process, with a maximum charge
- * of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total quantity
- * across all events. Similar to bulk pricing, the BPS parameters of a given event depends on
- * the tier range that the billing period falls into. Each tier range is defined by an upper
- * bound. For example, after $1.5M of payment volume is reached, each individual payment may
- * have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total. Similar to
- * tiered pricing, the BPS parameters of a given event depends on the tier range that it falls
- * into, where each tier range is defined by an upper and lower bound. For example, the first
- * few payments may have a 0.8 BPS take-rate and all payments after a specific volume may incur
- * a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix. `dimensions`
- * defines the two event property values evaluated in this pricing model. In a one-dimensional
- * matrix, the second value is `null`. Every configuration has a list of `matrix_values` which
- * give the unit prices for specified property values. In a one-dimensional matrix, the matrix
- * values will have `dimension_values` where the second value of the pair is null. If an event
- * does not match any of the dimension values in the matrix, it will resort to the
- * `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow unit
- * pricing. They also have an additional parameter `fixed_price_quantity`. If the Price
- * represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
@JsonProperty("price") @ExcludeMissing fun _price(): JsonField = price
@@ -830,224 +398,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the key
* for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls into,
- * where each tier range is defined by an upper and lower bound. For example, the first ten
- * units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40 (i.e.
- * 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6 units
- * will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a percent
- * (the number of basis points to charge), as well as a cap per event to assess. For
- * example, this would allow you to assess a fee of 0.25% on every payment you process, with
- * a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given event
- * depends on the tier range that the billing period falls into. Each tier range is defined
- * by an upper bound. For example, after $1.5M of payment volume is reached, each individual
- * payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total. Similar
- * to tiered pricing, the BPS parameters of a given event depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For example,
- * the first few payments may have a 0.8 BPS take-rate and all payments after a specific
- * volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model. In a
- * one-dimensional matrix, the second value is `null`. Every configuration has a list of
- * `matrix_values` which give the unit prices for specified property values. In a
- * one-dimensional matrix, the matrix values will have `dimension_values` where the second
- * value of the pair is null. If an event does not match any of the dimension values in the
- * matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow unit
- * pricing. They also have an additional parameter `fixed_price_quantity`. If the Price
- * represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(price: Price?) = price(JsonField.ofNullable(price))
@@ -1060,224 +412,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the key
* for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls into,
- * where each tier range is defined by an upper and lower bound. For example, the first ten
- * units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40 (i.e.
- * 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6 units
- * will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a percent
- * (the number of basis points to charge), as well as a cap per event to assess. For
- * example, this would allow you to assess a fee of 0.25% on every payment you process, with
- * a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given event
- * depends on the tier range that the billing period falls into. Each tier range is defined
- * by an upper bound. For example, after $1.5M of payment volume is reached, each individual
- * payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total. Similar
- * to tiered pricing, the BPS parameters of a given event depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For example,
- * the first few payments may have a 0.8 BPS take-rate and all payments after a specific
- * volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model. In a
- * one-dimensional matrix, the second value is `null`. Every configuration has a list of
- * `matrix_values` which give the unit prices for specified property values. In a
- * one-dimensional matrix, the matrix values will have `dimension_values` where the second
- * value of the pair is null. If an event does not match any of the dimension values in the
- * matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow unit
- * pricing. They also have an additional parameter `fixed_price_quantity`. If the Price
- * represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * 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))
@@ -1290,224 +426,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the key
* for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls into,
- * where each tier range is defined by an upper and lower bound. For example, the first ten
- * units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40 (i.e.
- * 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6 units
- * will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a percent
- * (the number of basis points to charge), as well as a cap per event to assess. For
- * example, this would allow you to assess a fee of 0.25% on every payment you process, with
- * a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given event
- * depends on the tier range that the billing period falls into. Each tier range is defined
- * by an upper bound. For example, after $1.5M of payment volume is reached, each individual
- * payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total. Similar
- * to tiered pricing, the BPS parameters of a given event depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For example,
- * the first few payments may have a 0.8 BPS take-rate and all payments after a specific
- * volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model. In a
- * one-dimensional matrix, the second value is `null`. Every configuration has a list of
- * `matrix_values` which give the unit prices for specified property values. In a
- * one-dimensional matrix, the matrix values will have `dimension_values` where the second
- * value of the pair is null. If an event does not match any of the dimension values in the
- * matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow unit
- * pricing. They also have an additional parameter `fixed_price_quantity`. If the Price
- * represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(price: JsonField) = apply { this.price = price }
@@ -1520,224 +440,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the key
* for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls into,
- * where each tier range is defined by an upper and lower bound. For example, the first ten
- * units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40 (i.e.
- * 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6 units
- * will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a percent
- * (the number of basis points to charge), as well as a cap per event to assess. For
- * example, this would allow you to assess a fee of 0.25% on every payment you process, with
- * a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given event
- * depends on the tier range that the billing period falls into. Each tier range is defined
- * by an upper bound. For example, after $1.5M of payment volume is reached, each individual
- * payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total. Similar
- * to tiered pricing, the BPS parameters of a given event depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For example,
- * the first few payments may have a 0.8 BPS take-rate and all payments after a specific
- * volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model. In a
- * one-dimensional matrix, the second value is `null`. Every configuration has a list of
- * `matrix_values` which give the unit prices for specified property values. In a
- * one-dimensional matrix, the matrix values will have `dimension_values` where the second
- * value of the pair is null. If an event does not match any of the dimension values in the
- * matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow unit
- * pricing. They also have an additional parameter `fixed_price_quantity`. If the Price
- * represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(unitPrice: Price.UnitPrice) = price(Price.ofUnitPrice(unitPrice))
@@ -1750,224 +454,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the key
* for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls into,
- * where each tier range is defined by an upper and lower bound. For example, the first ten
- * units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40 (i.e.
- * 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6 units
- * will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a percent
- * (the number of basis points to charge), as well as a cap per event to assess. For
- * example, this would allow you to assess a fee of 0.25% on every payment you process, with
- * a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given event
- * depends on the tier range that the billing period falls into. Each tier range is defined
- * by an upper bound. For example, after $1.5M of payment volume is reached, each individual
- * payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total. Similar
- * to tiered pricing, the BPS parameters of a given event depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For example,
- * the first few payments may have a 0.8 BPS take-rate and all payments after a specific
- * volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model. In a
- * one-dimensional matrix, the second value is `null`. Every configuration has a list of
- * `matrix_values` which give the unit prices for specified property values. In a
- * one-dimensional matrix, the matrix values will have `dimension_values` where the second
- * value of the pair is null. If an event does not match any of the dimension values in the
- * matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow unit
- * pricing. They also have an additional parameter `fixed_price_quantity`. If the Price
- * represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(packagePrice: Price.PackagePrice) = price(Price.ofPackagePrice(packagePrice))
@@ -1980,224 +468,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the key
* for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls into,
- * where each tier range is defined by an upper and lower bound. For example, the first ten
- * units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40 (i.e.
- * 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6 units
- * will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a percent
- * (the number of basis points to charge), as well as a cap per event to assess. For
- * example, this would allow you to assess a fee of 0.25% on every payment you process, with
- * a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given event
- * depends on the tier range that the billing period falls into. Each tier range is defined
- * by an upper bound. For example, after $1.5M of payment volume is reached, each individual
- * payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total. Similar
- * to tiered pricing, the BPS parameters of a given event depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For example,
- * the first few payments may have a 0.8 BPS take-rate and all payments after a specific
- * volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model. In a
- * one-dimensional matrix, the second value is `null`. Every configuration has a list of
- * `matrix_values` which give the unit prices for specified property values. In a
- * one-dimensional matrix, the matrix values will have `dimension_values` where the second
- * value of the pair is null. If an event does not match any of the dimension values in the
- * matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow unit
- * pricing. They also have an additional parameter `fixed_price_quantity`. If the Price
- * represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(matrixPrice: Price.MatrixPrice) = price(Price.ofMatrixPrice(matrixPrice))
@@ -2210,224 +482,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the key
* for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls into,
- * where each tier range is defined by an upper and lower bound. For example, the first ten
- * units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40 (i.e.
- * 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6 units
- * will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a percent
- * (the number of basis points to charge), as well as a cap per event to assess. For
- * example, this would allow you to assess a fee of 0.25% on every payment you process, with
- * a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given event
- * depends on the tier range that the billing period falls into. Each tier range is defined
- * by an upper bound. For example, after $1.5M of payment volume is reached, each individual
- * payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total. Similar
- * to tiered pricing, the BPS parameters of a given event depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For example,
- * the first few payments may have a 0.8 BPS take-rate and all payments after a specific
- * volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model. In a
- * one-dimensional matrix, the second value is `null`. Every configuration has a list of
- * `matrix_values` which give the unit prices for specified property values. In a
- * one-dimensional matrix, the matrix values will have `dimension_values` where the second
- * value of the pair is null. If an event does not match any of the dimension values in the
- * matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow unit
- * pricing. They also have an additional parameter `fixed_price_quantity`. If the Price
- * represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(tieredPrice: Price.TieredPrice) = price(Price.ofTieredPrice(tieredPrice))
@@ -2440,685 +496,37 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the key
* for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
+ */
+ fun price(tieredBpsPrice: Price.TieredBpsPrice) =
+ price(Price.ofTieredBpsPrice(tieredBpsPrice))
+
+ /**
+ * The Price resource represents a price that can be billed on a subscription, resulting in
+ * a charge on an invoice in the form of an invoice line item. Prices take a quantity and
+ * determine an amount to bill.
*
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
+ * Orb supports a few different pricing models out of the box. Each of these models is
+ * serialized differently in a given Price object. The model_type field determines the key
+ * for the configuration object that is present.
*
- * ## Tiered pricing
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
+ */
+ fun price(bpsPrice: Price.BpsPrice) = price(Price.ofBpsPrice(bpsPrice))
+
+ /**
+ * The Price resource represents a price that can be billed on a subscription, resulting in
+ * a charge on an invoice in the form of an invoice line item. Prices take a quantity and
+ * determine an amount to bill.
*
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls into,
- * where each tier range is defined by an upper and lower bound. For example, the first ten
- * units may cost $0.50 each and all units thereafter may cost $0.10 each.
+ * Orb supports a few different pricing models out of the box. Each of these models is
+ * serialized differently in a given Price object. The model_type field determines the key
+ * for the configuration object that is present.
*
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40 (i.e.
- * 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6 units
- * will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a percent
- * (the number of basis points to charge), as well as a cap per event to assess. For
- * example, this would allow you to assess a fee of 0.25% on every payment you process, with
- * a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given event
- * depends on the tier range that the billing period falls into. Each tier range is defined
- * by an upper bound. For example, after $1.5M of payment volume is reached, each individual
- * payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total. Similar
- * to tiered pricing, the BPS parameters of a given event depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For example,
- * the first few payments may have a 0.8 BPS take-rate and all payments after a specific
- * volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model. In a
- * one-dimensional matrix, the second value is `null`. Every configuration has a list of
- * `matrix_values` which give the unit prices for specified property values. In a
- * one-dimensional matrix, the matrix values will have `dimension_values` where the second
- * value of the pair is null. If an event does not match any of the dimension values in the
- * matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow unit
- * pricing. They also have an additional parameter `fixed_price_quantity`. If the Price
- * represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
- */
- fun price(tieredBpsPrice: Price.TieredBpsPrice) =
- price(Price.ofTieredBpsPrice(tieredBpsPrice))
-
- /**
- * The Price resource represents a price that can be billed on a subscription, resulting in
- * a charge on an invoice in the form of an invoice line item. Prices take a quantity and
- * determine an amount to bill.
- *
- * Orb supports a few different pricing models out of the box. Each of these models is
- * serialized differently in a given Price object. The model_type field determines the key
- * for the configuration object that is present.
- *
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls into,
- * where each tier range is defined by an upper and lower bound. For example, the first ten
- * units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40 (i.e.
- * 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6 units
- * will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a percent
- * (the number of basis points to charge), as well as a cap per event to assess. For
- * example, this would allow you to assess a fee of 0.25% on every payment you process, with
- * a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given event
- * depends on the tier range that the billing period falls into. Each tier range is defined
- * by an upper bound. For example, after $1.5M of payment volume is reached, each individual
- * payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total. Similar
- * to tiered pricing, the BPS parameters of a given event depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For example,
- * the first few payments may have a 0.8 BPS take-rate and all payments after a specific
- * volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model. In a
- * one-dimensional matrix, the second value is `null`. Every configuration has a list of
- * `matrix_values` which give the unit prices for specified property values. In a
- * one-dimensional matrix, the matrix values will have `dimension_values` where the second
- * value of the pair is null. If an event does not match any of the dimension values in the
- * matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow unit
- * pricing. They also have an additional parameter `fixed_price_quantity`. If the Price
- * represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
- */
- fun price(bpsPrice: Price.BpsPrice) = price(Price.ofBpsPrice(bpsPrice))
-
- /**
- * The Price resource represents a price that can be billed on a subscription, resulting in
- * a charge on an invoice in the form of an invoice line item. Prices take a quantity and
- * determine an amount to bill.
- *
- * Orb supports a few different pricing models out of the box. Each of these models is
- * serialized differently in a given Price object. The model_type field determines the key
- * for the configuration object that is present.
- *
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls into,
- * where each tier range is defined by an upper and lower bound. For example, the first ten
- * units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40 (i.e.
- * 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6 units
- * will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a percent
- * (the number of basis points to charge), as well as a cap per event to assess. For
- * example, this would allow you to assess a fee of 0.25% on every payment you process, with
- * a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given event
- * depends on the tier range that the billing period falls into. Each tier range is defined
- * by an upper bound. For example, after $1.5M of payment volume is reached, each individual
- * payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total. Similar
- * to tiered pricing, the BPS parameters of a given event depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For example,
- * the first few payments may have a 0.8 BPS take-rate and all payments after a specific
- * volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model. In a
- * one-dimensional matrix, the second value is `null`. Every configuration has a list of
- * `matrix_values` which give the unit prices for specified property values. In a
- * one-dimensional matrix, the matrix values will have `dimension_values` where the second
- * value of the pair is null. If an event does not match any of the dimension values in the
- * matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow unit
- * pricing. They also have an additional parameter `fixed_price_quantity`. If the Price
- * represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(bulkBpsPrice: Price.BulkBpsPrice) = price(Price.ofBulkBpsPrice(bulkBpsPrice))
@@ -3131,224 +539,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the key
* for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls into,
- * where each tier range is defined by an upper and lower bound. For example, the first ten
- * units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40 (i.e.
- * 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6 units
- * will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a percent
- * (the number of basis points to charge), as well as a cap per event to assess. For
- * example, this would allow you to assess a fee of 0.25% on every payment you process, with
- * a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given event
- * depends on the tier range that the billing period falls into. Each tier range is defined
- * by an upper bound. For example, after $1.5M of payment volume is reached, each individual
- * payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total. Similar
- * to tiered pricing, the BPS parameters of a given event depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For example,
- * the first few payments may have a 0.8 BPS take-rate and all payments after a specific
- * volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model. In a
- * one-dimensional matrix, the second value is `null`. Every configuration has a list of
- * `matrix_values` which give the unit prices for specified property values. In a
- * one-dimensional matrix, the matrix values will have `dimension_values` where the second
- * value of the pair is null. If an event does not match any of the dimension values in the
- * matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow unit
- * pricing. They also have an additional parameter `fixed_price_quantity`. If the Price
- * represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(bulkPrice: Price.BulkPrice) = price(Price.ofBulkPrice(bulkPrice))
@@ -3361,224 +553,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the key
* for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls into,
- * where each tier range is defined by an upper and lower bound. For example, the first ten
- * units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40 (i.e.
- * 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6 units
- * will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a percent
- * (the number of basis points to charge), as well as a cap per event to assess. For
- * example, this would allow you to assess a fee of 0.25% on every payment you process, with
- * a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given event
- * depends on the tier range that the billing period falls into. Each tier range is defined
- * by an upper bound. For example, after $1.5M of payment volume is reached, each individual
- * payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total. Similar
- * to tiered pricing, the BPS parameters of a given event depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For example,
- * the first few payments may have a 0.8 BPS take-rate and all payments after a specific
- * volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model. In a
- * one-dimensional matrix, the second value is `null`. Every configuration has a list of
- * `matrix_values` which give the unit prices for specified property values. In a
- * one-dimensional matrix, the matrix values will have `dimension_values` where the second
- * value of the pair is null. If an event does not match any of the dimension values in the
- * matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow unit
- * pricing. They also have an additional parameter `fixed_price_quantity`. If the Price
- * represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(thresholdTotalAmountPrice: Price.ThresholdTotalAmountPrice) =
price(Price.ofThresholdTotalAmountPrice(thresholdTotalAmountPrice))
@@ -3592,224 +568,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the key
* for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls into,
- * where each tier range is defined by an upper and lower bound. For example, the first ten
- * units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40 (i.e.
- * 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6 units
- * will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a percent
- * (the number of basis points to charge), as well as a cap per event to assess. For
- * example, this would allow you to assess a fee of 0.25% on every payment you process, with
- * a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given event
- * depends on the tier range that the billing period falls into. Each tier range is defined
- * by an upper bound. For example, after $1.5M of payment volume is reached, each individual
- * payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total. Similar
- * to tiered pricing, the BPS parameters of a given event depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For example,
- * the first few payments may have a 0.8 BPS take-rate and all payments after a specific
- * volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model. In a
- * one-dimensional matrix, the second value is `null`. Every configuration has a list of
- * `matrix_values` which give the unit prices for specified property values. In a
- * one-dimensional matrix, the matrix values will have `dimension_values` where the second
- * value of the pair is null. If an event does not match any of the dimension values in the
- * matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow unit
- * pricing. They also have an additional parameter `fixed_price_quantity`. If the Price
- * represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(tieredPackagePrice: Price.TieredPackagePrice) =
price(Price.ofTieredPackagePrice(tieredPackagePrice))
@@ -3823,224 +583,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the key
* for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls into,
- * where each tier range is defined by an upper and lower bound. For example, the first ten
- * units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40 (i.e.
- * 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6 units
- * will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a percent
- * (the number of basis points to charge), as well as a cap per event to assess. For
- * example, this would allow you to assess a fee of 0.25% on every payment you process, with
- * a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given event
- * depends on the tier range that the billing period falls into. Each tier range is defined
- * by an upper bound. For example, after $1.5M of payment volume is reached, each individual
- * payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total. Similar
- * to tiered pricing, the BPS parameters of a given event depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For example,
- * the first few payments may have a 0.8 BPS take-rate and all payments after a specific
- * volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model. In a
- * one-dimensional matrix, the second value is `null`. Every configuration has a list of
- * `matrix_values` which give the unit prices for specified property values. In a
- * one-dimensional matrix, the matrix values will have `dimension_values` where the second
- * value of the pair is null. If an event does not match any of the dimension values in the
- * matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow unit
- * pricing. They also have an additional parameter `fixed_price_quantity`. If the Price
- * represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(groupedTieredPrice: Price.GroupedTieredPrice) =
price(Price.ofGroupedTieredPrice(groupedTieredPrice))
@@ -4054,224 +598,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the key
* for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls into,
- * where each tier range is defined by an upper and lower bound. For example, the first ten
- * units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40 (i.e.
- * 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6 units
- * will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a percent
- * (the number of basis points to charge), as well as a cap per event to assess. For
- * example, this would allow you to assess a fee of 0.25% on every payment you process, with
- * a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given event
- * depends on the tier range that the billing period falls into. Each tier range is defined
- * by an upper bound. For example, after $1.5M of payment volume is reached, each individual
- * payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total. Similar
- * to tiered pricing, the BPS parameters of a given event depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For example,
- * the first few payments may have a 0.8 BPS take-rate and all payments after a specific
- * volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model. In a
- * one-dimensional matrix, the second value is `null`. Every configuration has a list of
- * `matrix_values` which give the unit prices for specified property values. In a
- * one-dimensional matrix, the matrix values will have `dimension_values` where the second
- * value of the pair is null. If an event does not match any of the dimension values in the
- * matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow unit
- * pricing. They also have an additional parameter `fixed_price_quantity`. If the Price
- * represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(tieredWithMinimumPrice: Price.TieredWithMinimumPrice) =
price(Price.ofTieredWithMinimumPrice(tieredWithMinimumPrice))
@@ -4285,224 +613,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the key
* for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls into,
- * where each tier range is defined by an upper and lower bound. For example, the first ten
- * units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40 (i.e.
- * 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6 units
- * will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a percent
- * (the number of basis points to charge), as well as a cap per event to assess. For
- * example, this would allow you to assess a fee of 0.25% on every payment you process, with
- * a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given event
- * depends on the tier range that the billing period falls into. Each tier range is defined
- * by an upper bound. For example, after $1.5M of payment volume is reached, each individual
- * payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total. Similar
- * to tiered pricing, the BPS parameters of a given event depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For example,
- * the first few payments may have a 0.8 BPS take-rate and all payments after a specific
- * volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model. In a
- * one-dimensional matrix, the second value is `null`. Every configuration has a list of
- * `matrix_values` which give the unit prices for specified property values. In a
- * one-dimensional matrix, the matrix values will have `dimension_values` where the second
- * value of the pair is null. If an event does not match any of the dimension values in the
- * matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow unit
- * pricing. They also have an additional parameter `fixed_price_quantity`. If the Price
- * represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(tieredPackageWithMinimumPrice: Price.TieredPackageWithMinimumPrice) =
price(Price.ofTieredPackageWithMinimumPrice(tieredPackageWithMinimumPrice))
@@ -4516,224 +628,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the key
* for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls into,
- * where each tier range is defined by an upper and lower bound. For example, the first ten
- * units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40 (i.e.
- * 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6 units
- * will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a percent
- * (the number of basis points to charge), as well as a cap per event to assess. For
- * example, this would allow you to assess a fee of 0.25% on every payment you process, with
- * a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given event
- * depends on the tier range that the billing period falls into. Each tier range is defined
- * by an upper bound. For example, after $1.5M of payment volume is reached, each individual
- * payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total. Similar
- * to tiered pricing, the BPS parameters of a given event depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For example,
- * the first few payments may have a 0.8 BPS take-rate and all payments after a specific
- * volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model. In a
- * one-dimensional matrix, the second value is `null`. Every configuration has a list of
- * `matrix_values` which give the unit prices for specified property values. In a
- * one-dimensional matrix, the matrix values will have `dimension_values` where the second
- * value of the pair is null. If an event does not match any of the dimension values in the
- * matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow unit
- * pricing. They also have an additional parameter `fixed_price_quantity`. If the Price
- * represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(packageWithAllocationPrice: Price.PackageWithAllocationPrice) =
price(Price.ofPackageWithAllocationPrice(packageWithAllocationPrice))
@@ -4747,455 +643,23 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the key
* for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls into,
- * where each tier range is defined by an upper and lower bound. For example, the first ten
- * units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40 (i.e.
- * 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6 units
- * will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a percent
- * (the number of basis points to charge), as well as a cap per event to assess. For
- * example, this would allow you to assess a fee of 0.25% on every payment you process, with
- * a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given event
- * depends on the tier range that the billing period falls into. Each tier range is defined
- * by an upper bound. For example, after $1.5M of payment volume is reached, each individual
- * payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total. Similar
- * to tiered pricing, the BPS parameters of a given event depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For example,
- * the first few payments may have a 0.8 BPS take-rate and all payments after a specific
- * volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model. In a
- * one-dimensional matrix, the second value is `null`. Every configuration has a list of
- * `matrix_values` which give the unit prices for specified property values. In a
- * one-dimensional matrix, the matrix values will have `dimension_values` where the second
- * value of the pair is null. If an event does not match any of the dimension values in the
- * matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow unit
- * pricing. They also have an additional parameter `fixed_price_quantity`. If the Price
- * represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
- */
- fun price(unitWithPercentPrice: Price.UnitWithPercentPrice) =
- price(Price.ofUnitWithPercentPrice(unitWithPercentPrice))
-
- /**
- * The Price resource represents a price that can be billed on a subscription, resulting in
- * a charge on an invoice in the form of an invoice line item. Prices take a quantity and
- * determine an amount to bill.
- *
- * Orb supports a few different pricing models out of the box. Each of these models is
- * serialized differently in a given Price object. The model_type field determines the key
- * for the configuration object that is present.
- *
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls into,
- * where each tier range is defined by an upper and lower bound. For example, the first ten
- * units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40 (i.e.
- * 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6 units
- * will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a percent
- * (the number of basis points to charge), as well as a cap per event to assess. For
- * example, this would allow you to assess a fee of 0.25% on every payment you process, with
- * a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given event
- * depends on the tier range that the billing period falls into. Each tier range is defined
- * by an upper bound. For example, after $1.5M of payment volume is reached, each individual
- * payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total. Similar
- * to tiered pricing, the BPS parameters of a given event depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For example,
- * the first few payments may have a 0.8 BPS take-rate and all payments after a specific
- * volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model. In a
- * one-dimensional matrix, the second value is `null`. Every configuration has a list of
- * `matrix_values` which give the unit prices for specified property values. In a
- * one-dimensional matrix, the matrix values will have `dimension_values` where the second
- * value of the pair is null. If an event does not match any of the dimension values in the
- * matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
+ */
+ fun price(unitWithPercentPrice: Price.UnitWithPercentPrice) =
+ price(Price.ofUnitWithPercentPrice(unitWithPercentPrice))
+
+ /**
+ * The Price resource represents a price that can be billed on a subscription, resulting in
+ * a charge on an invoice in the form of an invoice line item. Prices take a quantity and
+ * determine an amount to bill.
*
- * Fixed fees are prices that are applied independent of usage quantities, and follow unit
- * pricing. They also have an additional parameter `fixed_price_quantity`. If the Price
- * represents a fixed cost, this represents the quantity of units applied.
+ * Orb supports a few different pricing models out of the box. Each of these models is
+ * serialized differently in a given Price object. The model_type field determines the key
+ * for the configuration object that is present.
*
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(matrixWithAllocationPrice: Price.MatrixWithAllocationPrice) =
price(Price.ofMatrixWithAllocationPrice(matrixWithAllocationPrice))
@@ -5209,224 +673,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the key
* for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls into,
- * where each tier range is defined by an upper and lower bound. For example, the first ten
- * units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40 (i.e.
- * 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6 units
- * will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a percent
- * (the number of basis points to charge), as well as a cap per event to assess. For
- * example, this would allow you to assess a fee of 0.25% on every payment you process, with
- * a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given event
- * depends on the tier range that the billing period falls into. Each tier range is defined
- * by an upper bound. For example, after $1.5M of payment volume is reached, each individual
- * payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total. Similar
- * to tiered pricing, the BPS parameters of a given event depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For example,
- * the first few payments may have a 0.8 BPS take-rate and all payments after a specific
- * volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model. In a
- * one-dimensional matrix, the second value is `null`. Every configuration has a list of
- * `matrix_values` which give the unit prices for specified property values. In a
- * one-dimensional matrix, the matrix values will have `dimension_values` where the second
- * value of the pair is null. If an event does not match any of the dimension values in the
- * matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow unit
- * pricing. They also have an additional parameter `fixed_price_quantity`. If the Price
- * represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(tieredWithProrationPrice: Price.TieredWithProrationPrice) =
price(Price.ofTieredWithProrationPrice(tieredWithProrationPrice))
@@ -5440,224 +688,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the key
* for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls into,
- * where each tier range is defined by an upper and lower bound. For example, the first ten
- * units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40 (i.e.
- * 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6 units
- * will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a percent
- * (the number of basis points to charge), as well as a cap per event to assess. For
- * example, this would allow you to assess a fee of 0.25% on every payment you process, with
- * a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given event
- * depends on the tier range that the billing period falls into. Each tier range is defined
- * by an upper bound. For example, after $1.5M of payment volume is reached, each individual
- * payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total. Similar
- * to tiered pricing, the BPS parameters of a given event depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For example,
- * the first few payments may have a 0.8 BPS take-rate and all payments after a specific
- * volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model. In a
- * one-dimensional matrix, the second value is `null`. Every configuration has a list of
- * `matrix_values` which give the unit prices for specified property values. In a
- * one-dimensional matrix, the matrix values will have `dimension_values` where the second
- * value of the pair is null. If an event does not match any of the dimension values in the
- * matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow unit
- * pricing. They also have an additional parameter `fixed_price_quantity`. If the Price
- * represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(unitWithProrationPrice: Price.UnitWithProrationPrice) =
price(Price.ofUnitWithProrationPrice(unitWithProrationPrice))
@@ -5671,224 +703,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the key
* for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls into,
- * where each tier range is defined by an upper and lower bound. For example, the first ten
- * units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40 (i.e.
- * 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6 units
- * will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a percent
- * (the number of basis points to charge), as well as a cap per event to assess. For
- * example, this would allow you to assess a fee of 0.25% on every payment you process, with
- * a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given event
- * depends on the tier range that the billing period falls into. Each tier range is defined
- * by an upper bound. For example, after $1.5M of payment volume is reached, each individual
- * payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total. Similar
- * to tiered pricing, the BPS parameters of a given event depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For example,
- * the first few payments may have a 0.8 BPS take-rate and all payments after a specific
- * volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model. In a
- * one-dimensional matrix, the second value is `null`. Every configuration has a list of
- * `matrix_values` which give the unit prices for specified property values. In a
- * one-dimensional matrix, the matrix values will have `dimension_values` where the second
- * value of the pair is null. If an event does not match any of the dimension values in the
- * matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow unit
- * pricing. They also have an additional parameter `fixed_price_quantity`. If the Price
- * represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(groupedAllocationPrice: Price.GroupedAllocationPrice) =
price(Price.ofGroupedAllocationPrice(groupedAllocationPrice))
@@ -5902,224 +718,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the key
* for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls into,
- * where each tier range is defined by an upper and lower bound. For example, the first ten
- * units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40 (i.e.
- * 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6 units
- * will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a percent
- * (the number of basis points to charge), as well as a cap per event to assess. For
- * example, this would allow you to assess a fee of 0.25% on every payment you process, with
- * a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given event
- * depends on the tier range that the billing period falls into. Each tier range is defined
- * by an upper bound. For example, after $1.5M of payment volume is reached, each individual
- * payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total. Similar
- * to tiered pricing, the BPS parameters of a given event depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For example,
- * the first few payments may have a 0.8 BPS take-rate and all payments after a specific
- * volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model. In a
- * one-dimensional matrix, the second value is `null`. Every configuration has a list of
- * `matrix_values` which give the unit prices for specified property values. In a
- * one-dimensional matrix, the matrix values will have `dimension_values` where the second
- * value of the pair is null. If an event does not match any of the dimension values in the
- * matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow unit
- * pricing. They also have an additional parameter `fixed_price_quantity`. If the Price
- * represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(groupedWithProratedMinimumPrice: Price.GroupedWithProratedMinimumPrice) =
price(Price.ofGroupedWithProratedMinimumPrice(groupedWithProratedMinimumPrice))
@@ -6133,224 +733,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the key
* for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls into,
- * where each tier range is defined by an upper and lower bound. For example, the first ten
- * units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40 (i.e.
- * 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6 units
- * will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a percent
- * (the number of basis points to charge), as well as a cap per event to assess. For
- * example, this would allow you to assess a fee of 0.25% on every payment you process, with
- * a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given event
- * depends on the tier range that the billing period falls into. Each tier range is defined
- * by an upper bound. For example, after $1.5M of payment volume is reached, each individual
- * payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total. Similar
- * to tiered pricing, the BPS parameters of a given event depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For example,
- * the first few payments may have a 0.8 BPS take-rate and all payments after a specific
- * volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model. In a
- * one-dimensional matrix, the second value is `null`. Every configuration has a list of
- * `matrix_values` which give the unit prices for specified property values. In a
- * one-dimensional matrix, the matrix values will have `dimension_values` where the second
- * value of the pair is null. If an event does not match any of the dimension values in the
- * matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow unit
- * pricing. They also have an additional parameter `fixed_price_quantity`. If the Price
- * represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(groupedWithMeteredMinimumPrice: Price.GroupedWithMeteredMinimumPrice) =
price(Price.ofGroupedWithMeteredMinimumPrice(groupedWithMeteredMinimumPrice))
@@ -6364,224 +748,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the key
* for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls into,
- * where each tier range is defined by an upper and lower bound. For example, the first ten
- * units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40 (i.e.
- * 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6 units
- * will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a percent
- * (the number of basis points to charge), as well as a cap per event to assess. For
- * example, this would allow you to assess a fee of 0.25% on every payment you process, with
- * a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given event
- * depends on the tier range that the billing period falls into. Each tier range is defined
- * by an upper bound. For example, after $1.5M of payment volume is reached, each individual
- * payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total. Similar
- * to tiered pricing, the BPS parameters of a given event depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For example,
- * the first few payments may have a 0.8 BPS take-rate and all payments after a specific
- * volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model. In a
- * one-dimensional matrix, the second value is `null`. Every configuration has a list of
- * `matrix_values` which give the unit prices for specified property values. In a
- * one-dimensional matrix, the matrix values will have `dimension_values` where the second
- * value of the pair is null. If an event does not match any of the dimension values in the
- * matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow unit
- * pricing. They also have an additional parameter `fixed_price_quantity`. If the Price
- * represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(matrixWithDisplayNamePrice: Price.MatrixWithDisplayNamePrice) =
price(Price.ofMatrixWithDisplayNamePrice(matrixWithDisplayNamePrice))
@@ -6595,224 +763,8 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the key
* for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls into,
- * where each tier range is defined by an upper and lower bound. For example, the first ten
- * units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40 (i.e.
- * 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6 units
- * will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a percent
- * (the number of basis points to charge), as well as a cap per event to assess. For
- * example, this would allow you to assess a fee of 0.25% on every payment you process, with
- * a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given event
- * depends on the tier range that the billing period falls into. Each tier range is defined
- * by an upper bound. For example, after $1.5M of payment volume is reached, each individual
- * payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total. Similar
- * to tiered pricing, the BPS parameters of a given event depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For example,
- * the first few payments may have a 0.8 BPS take-rate and all payments after a specific
- * volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model. In a
- * one-dimensional matrix, the second value is `null`. Every configuration has a list of
- * `matrix_values` which give the unit prices for specified property values. In a
- * one-dimensional matrix, the matrix values will have `dimension_values` where the second
- * value of the pair is null. If an event does not match any of the dimension values in the
- * matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow unit
- * pricing. They also have an additional parameter `fixed_price_quantity`. If the Price
- * represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(bulkWithProrationPrice: Price.BulkWithProrationPrice) =
price(Price.ofBulkWithProrationPrice(bulkWithProrationPrice))
@@ -6826,459 +778,12 @@ private constructor(
* serialized differently in a given Price object. The model_type field determines the key
* for the configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls into,
- * where each tier range is defined by an upper and lower bound. For example, the first ten
- * units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40 (i.e.
- * 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6 units
- * will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a percent
- * (the number of basis points to charge), as well as a cap per event to assess. For
- * example, this would allow you to assess a fee of 0.25% on every payment you process, with
- * a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given event
- * depends on the tier range that the billing period falls into. Each tier range is defined
- * by an upper bound. For example, after $1.5M of payment volume is reached, each individual
- * payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total. Similar
- * to tiered pricing, the BPS parameters of a given event depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For example,
- * the first few payments may have a 0.8 BPS take-rate and all payments after a specific
- * volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model. In a
- * one-dimensional matrix, the second value is `null`. Every configuration has a list of
- * `matrix_values` which give the unit prices for specified property values. In a
- * one-dimensional matrix, the matrix values will have `dimension_values` where the second
- * value of the pair is null. If an event does not match any of the dimension values in the
- * matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow unit
- * pricing. They also have an additional parameter `fixed_price_quantity`. If the Price
- * represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
fun price(groupedTieredPackagePrice: Price.GroupedTieredPackagePrice) =
price(Price.ofGroupedTieredPackagePrice(groupedTieredPackagePrice))
- /**
- * The Price resource represents a price that can be billed on a subscription, resulting in
- * a charge on an invoice in the form of an invoice line item. Prices take a quantity and
- * determine an amount to bill.
- *
- * Orb supports a few different pricing models out of the box. Each of these models is
- * serialized differently in a given Price object. The model_type field determines the key
- * for the configuration object that is present.
- *
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls into,
- * where each tier range is defined by an upper and lower bound. For example, the first ten
- * units may cost $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For
- * example, if you've bought less than 10 units, they may each be $0.50 for a total of
- * $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40 (i.e.
- * 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For
- * example, if the package size is set to 5, then 4 units will be billed as 5 and 6 units
- * will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a percent
- * (the number of basis points to charge), as well as a cap per event to assess. For
- * example, this would allow you to assess a fee of 0.25% on every payment you process, with
- * a maximum charge of $25 per payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total
- * quantity across all events. Similar to bulk pricing, the BPS parameters of a given event
- * depends on the tier range that the billing period falls into. Each tier range is defined
- * by an upper bound. For example, after $1.5M of payment volume is reached, each individual
- * payment may have a lower cap or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's
- * applicable parameter is a function of its marginal addition to the period total. Similar
- * to tiered pricing, the BPS parameters of a given event depends on the tier range that it
- * falls into, where each tier range is defined by an upper and lower bound. For example,
- * the first few payments may have a 0.8 BPS take-rate and all payments after a specific
- * volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix.
- * `dimensions` defines the two event property values evaluated in this pricing model. In a
- * one-dimensional matrix, the second value is `null`. Every configuration has a list of
- * `matrix_values` which give the unit prices for specified property values. In a
- * one-dimensional matrix, the matrix values will have `dimension_values` where the second
- * value of the pair is null. If an event does not match any of the dimension values in the
- * matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow unit
- * pricing. They also have an additional parameter `fixed_price_quantity`. If the Price
- * represents a fixed cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
- */
- fun price(maxGroupTieredPrice: Price.MaxGroupTieredPrice) =
- price(Price.ofMaxGroupTieredPrice(maxGroupTieredPrice))
-
fun quantity(quantity: Double) = quantity(JsonField.of(quantity))
fun quantity(quantity: JsonField) = apply { this.quantity = quantity }
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 dd4b8505..e1f38bfa 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
@@ -19,6 +19,20 @@ import java.util.Optional
import java.util.stream.Stream
import java.util.stream.StreamSupport
+/**
+ * This endpoint returns a list of all [`Invoice`](/core-concepts#invoice)s for an account in a list
+ * format.
+ *
+ * The list of invoices is ordered starting from the most recently issued invoice date. The response
+ * also includes [`pagination_metadata`](/api-reference/pagination), which lets the caller retrieve
+ * the next page of results if they exist.
+ *
+ * By default, this only returns invoices that are `issued`, `paid`, or `synced`.
+ *
+ * When fetching any `draft` invoices, this returns the last-computed invoice values for each draft
+ * invoice, which may not always be up-to-date since Orb regularly refreshes invoices
+ * asynchronously.
+ */
class InvoiceListPage
private constructor(
private val invoicesService: InvoiceService,
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceListPageAsync.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceListPageAsync.kt
index d52170e3..e11d16e9 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceListPageAsync.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceListPageAsync.kt
@@ -20,6 +20,20 @@ import java.util.concurrent.CompletableFuture
import java.util.concurrent.Executor
import java.util.function.Predicate
+/**
+ * This endpoint returns a list of all [`Invoice`](/core-concepts#invoice)s for an account in a list
+ * format.
+ *
+ * The list of invoices is ordered starting from the most recently issued invoice date. The response
+ * also includes [`pagination_metadata`](/api-reference/pagination), which lets the caller retrieve
+ * the next page of results if they exist.
+ *
+ * By default, this only returns invoices that are `issued`, `paid`, or `synced`.
+ *
+ * When fetching any `draft` invoices, this returns the last-computed invoice values for each draft
+ * invoice, which may not always be up-to-date since Orb regularly refreshes invoices
+ * asynchronously.
+ */
class InvoiceListPageAsync
private constructor(
private val invoicesService: InvoiceServiceAsync,
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 044128a5..638dfec3 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
@@ -17,11 +17,11 @@ import java.util.Objects
import java.util.Optional
/**
- * This endpoint returns a list of all [`Invoice`](../guides/concepts#invoice)s for an account in a
- * list format.
+ * This endpoint returns a list of all [`Invoice`](/core-concepts#invoice)s for an account in a list
+ * format.
*
* The list of invoices is ordered starting from the most recently issued invoice date. The response
- * also includes [`pagination_metadata`](../reference/pagination), which lets the caller retrieve
+ * also includes [`pagination_metadata`](/api-reference/pagination), which lets the caller retrieve
* the next page of results if they exist.
*
* By default, this only returns invoices that are `issued`, `paid`, or `synced`.
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/ItemCreateParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/ItemCreateParams.kt
index b191629f..afb248f1 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/ItemCreateParams.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/ItemCreateParams.kt
@@ -18,7 +18,7 @@ import com.withorb.api.core.immutableEmptyMap
import com.withorb.api.core.toImmutable
import java.util.Objects
-/** This endpoint is used to create an [Item](../guides/concepts#item). */
+/** This endpoint is used to create an [Item](/core-concepts#item). */
class ItemCreateParams
constructor(
private val body: ItemCreateBody,
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 23e1aea4..9f9e6278 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
@@ -19,6 +19,7 @@ import java.util.Optional
import java.util.stream.Stream
import java.util.stream.StreamSupport
+/** This endpoint returns a list of all Items, ordered in descending order by creation time. */
class ItemListPage
private constructor(
private val itemsService: ItemService,
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/ItemListPageAsync.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/ItemListPageAsync.kt
index 514ac79a..318ae80c 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/ItemListPageAsync.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/ItemListPageAsync.kt
@@ -20,6 +20,7 @@ import java.util.concurrent.CompletableFuture
import java.util.concurrent.Executor
import java.util.function.Predicate
+/** This endpoint returns a list of all Items, ordered in descending order by creation time. */
class ItemListPageAsync
private constructor(
private val itemsService: ItemServiceAsync,
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 ae2a213c..93f04dbb 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
@@ -20,9 +20,9 @@ import java.util.Objects
import java.util.Optional
/**
- * This endpoint is used to create a [metric](../guides/concepts##metric) using a SQL string. See
- * [SQL support](../guides/extensibility/advanced-metrics#sql-support) for a description of
- * constructing SQL queries with examples.
+ * This endpoint is used to create a [metric](/core-concepts###metric) using a SQL string. See
+ * [SQL support](/extensibility/advanced-metrics#sql-support) for a description of constructing SQL
+ * queries with examples.
*/
class MetricCreateParams
constructor(
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/MetricFetchParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/MetricFetchParams.kt
index 36a400f4..5d248bcf 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/MetricFetchParams.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/MetricFetchParams.kt
@@ -9,8 +9,8 @@ import com.withorb.api.core.http.QueryParams
import java.util.Objects
/**
- * This endpoint is used to list [metrics](../guides/concepts##metric). It returns information about
- * the metrics including its name, description, and item.
+ * This endpoint is used to list [metrics](/core-concepts#metric). It returns information about the
+ * metrics including its name, description, and item.
*/
class MetricFetchParams
constructor(
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 a07b78fd..a6da357b 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
@@ -19,6 +19,10 @@ import java.util.Optional
import java.util.stream.Stream
import java.util.stream.StreamSupport
+/**
+ * This endpoint is used to fetch [metric](/core-concepts##metric) details given a metric
+ * identifier. It returns information about the metrics including its name, description, and item.
+ */
class MetricListPage
private constructor(
private val metricsService: MetricService,
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/MetricListPageAsync.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/MetricListPageAsync.kt
index d6ab9691..ef1e160e 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/MetricListPageAsync.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/MetricListPageAsync.kt
@@ -20,6 +20,10 @@ import java.util.concurrent.CompletableFuture
import java.util.concurrent.Executor
import java.util.function.Predicate
+/**
+ * This endpoint is used to fetch [metric](/core-concepts##metric) details given a metric
+ * identifier. It returns information about the metrics including its name, description, and item.
+ */
class MetricListPageAsync
private constructor(
private val metricsService: MetricServiceAsync,
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 b052c588..a6ff3d27 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
@@ -11,7 +11,7 @@ import java.util.Objects
import java.util.Optional
/**
- * This endpoint is used to fetch [metric](../guides/concepts#metric) details given a metric
+ * This endpoint is used to fetch [metric](/core-concepts##metric) details given a metric
* identifier. It returns information about the metrics including its name, description, and item.
*/
class MetricListParams
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 cdf2114c..266c3e04 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
@@ -32,9 +32,9 @@ import java.util.Optional
import kotlin.jvm.optionals.getOrNull
/**
- * The [Plan](../guides/core-concepts.mdx#plan-and-price) resource represents a plan that can be
- * subscribed to by a customer. Plans define the billing behavior of the subscription. You can see
- * more about how to configure prices in the [Price resource](/reference/price).
+ * The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be subscribed to by
+ * a customer. Plans define the billing behavior of the subscription. You can see more about how to
+ * configure prices in the [Price resource](/reference/price).
*/
@NoAutoDetect
class Plan
@@ -130,7 +130,7 @@ private constructor(
fun createdAt(): OffsetDateTime = createdAt.getRequired("created_at")
/** An ISO 4217 currency string or custom pricing unit (`credits`) for this plan's prices. */
- fun currency(): String = currency.getRequired("currency")
+ @Deprecated("deprecated") fun currency(): String = currency.getRequired("currency")
/**
* The default memo text on the invoices corresponding to subscriptions on this plan. Note that
@@ -223,7 +223,10 @@ private constructor(
fun _createdAt(): JsonField = createdAt
/** An ISO 4217 currency string or custom pricing unit (`credits`) for this plan's prices. */
- @JsonProperty("currency") @ExcludeMissing fun _currency(): JsonField = currency
+ @Deprecated("deprecated")
+ @JsonProperty("currency")
+ @ExcludeMissing
+ fun _currency(): JsonField = currency
/**
* The default memo text on the invoices corresponding to subscriptions on this plan. Note that
@@ -505,11 +508,12 @@ private constructor(
/**
* An ISO 4217 currency string or custom pricing unit (`credits`) for this plan's prices.
*/
- fun currency(currency: String) = currency(JsonField.of(currency))
+ @Deprecated("deprecated") fun currency(currency: String) = currency(JsonField.of(currency))
/**
* An ISO 4217 currency string or custom pricing unit (`credits`) for this plan's prices.
*/
+ @Deprecated("deprecated")
fun currency(currency: JsonField) = apply { this.currency = currency }
/**
@@ -894,13 +898,6 @@ private constructor(
fun addPrice(groupedTieredPackagePrice: Price.GroupedTieredPackagePrice) =
addPrice(Price.ofGroupedTieredPackagePrice(groupedTieredPackagePrice))
- /**
- * Prices for this plan. If the plan has phases, this includes prices across all phases of
- * the plan.
- */
- fun addPrice(maxGroupTieredPrice: Price.MaxGroupTieredPrice) =
- addPrice(Price.ofMaxGroupTieredPrice(maxGroupTieredPrice))
-
fun product(product: Product) = product(JsonField.of(product))
fun product(product: JsonField) = apply { this.product = product }
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 ea189231..89a78812 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
@@ -492,13 +492,6 @@ constructor(
fun addPrice(newPlanGroupedTieredPackagePrice: Price.NewPlanGroupedTieredPackagePrice) =
addPrice(Price.ofNewPlanGroupedTieredPackagePrice(newPlanGroupedTieredPackagePrice))
- /**
- * Prices for this plan. If the plan has phases, this includes prices across all phases
- * of the plan.
- */
- fun addPrice(newPlanMaxGroupTieredPrice: Price.NewPlanMaxGroupTieredPrice) =
- addPrice(Price.ofNewPlanMaxGroupTieredPrice(newPlanMaxGroupTieredPrice))
-
/** Free-form text which is available on the invoice PDF and the Orb invoice portal. */
fun defaultInvoiceMemo(defaultInvoiceMemo: String?) =
defaultInvoiceMemo(JsonField.ofNullable(defaultInvoiceMemo))
@@ -852,14 +845,6 @@ constructor(
body.addPrice(newPlanGroupedTieredPackagePrice)
}
- /**
- * Prices for this plan. If the plan has phases, this includes prices across all phases of
- * the plan.
- */
- fun addPrice(newPlanMaxGroupTieredPrice: Price.NewPlanMaxGroupTieredPrice) = apply {
- body.addPrice(newPlanMaxGroupTieredPrice)
- }
-
/** Free-form text which is available on the invoice PDF and the Orb invoice portal. */
fun defaultInvoiceMemo(defaultInvoiceMemo: String?) = apply {
body.defaultInvoiceMemo(defaultInvoiceMemo)
@@ -1094,7 +1079,6 @@ constructor(
private val newPlanMatrixWithDisplayNamePrice: NewPlanMatrixWithDisplayNamePrice? = null,
private val newPlanBulkWithProrationPrice: NewPlanBulkWithProrationPrice? = null,
private val newPlanGroupedTieredPackagePrice: NewPlanGroupedTieredPackagePrice? = null,
- private val newPlanMaxGroupTieredPrice: NewPlanMaxGroupTieredPrice? = null,
private val _json: JsonValue? = null,
) {
@@ -1160,9 +1144,6 @@ constructor(
fun newPlanGroupedTieredPackagePrice(): Optional =
Optional.ofNullable(newPlanGroupedTieredPackagePrice)
- fun newPlanMaxGroupTieredPrice(): Optional =
- Optional.ofNullable(newPlanMaxGroupTieredPrice)
-
fun isNewPlanUnitPrice(): Boolean = newPlanUnitPrice != null
fun isNewPlanPackagePrice(): Boolean = newPlanPackagePrice != null
@@ -1209,8 +1190,6 @@ constructor(
fun isNewPlanGroupedTieredPackagePrice(): Boolean = newPlanGroupedTieredPackagePrice != null
- fun isNewPlanMaxGroupTieredPrice(): Boolean = newPlanMaxGroupTieredPrice != null
-
fun asNewPlanUnitPrice(): NewPlanUnitPrice = newPlanUnitPrice.getOrThrow("newPlanUnitPrice")
fun asNewPlanPackagePrice(): NewPlanPackagePrice =
@@ -1275,9 +1254,6 @@ constructor(
fun asNewPlanGroupedTieredPackagePrice(): NewPlanGroupedTieredPackagePrice =
newPlanGroupedTieredPackagePrice.getOrThrow("newPlanGroupedTieredPackagePrice")
- fun asNewPlanMaxGroupTieredPrice(): NewPlanMaxGroupTieredPrice =
- newPlanMaxGroupTieredPrice.getOrThrow("newPlanMaxGroupTieredPrice")
-
fun _json(): Optional = Optional.ofNullable(_json)
fun accept(visitor: Visitor): T {
@@ -1325,8 +1301,6 @@ constructor(
visitor.visitNewPlanBulkWithProrationPrice(newPlanBulkWithProrationPrice)
newPlanGroupedTieredPackagePrice != null ->
visitor.visitNewPlanGroupedTieredPackagePrice(newPlanGroupedTieredPackagePrice)
- newPlanMaxGroupTieredPrice != null ->
- visitor.visitNewPlanMaxGroupTieredPrice(newPlanMaxGroupTieredPrice)
else -> visitor.unknown(_json)
}
}
@@ -1456,12 +1430,6 @@ constructor(
) {
newPlanGroupedTieredPackagePrice.validate()
}
-
- override fun visitNewPlanMaxGroupTieredPrice(
- newPlanMaxGroupTieredPrice: NewPlanMaxGroupTieredPrice
- ) {
- newPlanMaxGroupTieredPrice.validate()
- }
}
)
validated = true
@@ -1472,10 +1440,10 @@ constructor(
return true
}
- return /* spotless:off */ other is Price && newPlanUnitPrice == other.newPlanUnitPrice && newPlanPackagePrice == other.newPlanPackagePrice && newPlanMatrixPrice == other.newPlanMatrixPrice && newPlanTieredPrice == other.newPlanTieredPrice && newPlanTieredBpsPrice == other.newPlanTieredBpsPrice && newPlanBpsPrice == other.newPlanBpsPrice && newPlanBulkBpsPrice == other.newPlanBulkBpsPrice && newPlanBulkPrice == other.newPlanBulkPrice && newPlanThresholdTotalAmountPrice == other.newPlanThresholdTotalAmountPrice && newPlanTieredPackagePrice == other.newPlanTieredPackagePrice && newPlanTieredWithMinimumPrice == other.newPlanTieredWithMinimumPrice && newPlanUnitWithPercentPrice == other.newPlanUnitWithPercentPrice && newPlanPackageWithAllocationPrice == other.newPlanPackageWithAllocationPrice && newPlanTierWithProrationPrice == other.newPlanTierWithProrationPrice && newPlanUnitWithProrationPrice == other.newPlanUnitWithProrationPrice && newPlanGroupedAllocationPrice == other.newPlanGroupedAllocationPrice && newPlanGroupedWithProratedMinimumPrice == other.newPlanGroupedWithProratedMinimumPrice && newPlanGroupedWithMeteredMinimumPrice == other.newPlanGroupedWithMeteredMinimumPrice && newPlanMatrixWithDisplayNamePrice == other.newPlanMatrixWithDisplayNamePrice && newPlanBulkWithProrationPrice == other.newPlanBulkWithProrationPrice && newPlanGroupedTieredPackagePrice == other.newPlanGroupedTieredPackagePrice && newPlanMaxGroupTieredPrice == other.newPlanMaxGroupTieredPrice /* spotless:on */
+ return /* spotless:off */ other is Price && newPlanUnitPrice == other.newPlanUnitPrice && newPlanPackagePrice == other.newPlanPackagePrice && newPlanMatrixPrice == other.newPlanMatrixPrice && newPlanTieredPrice == other.newPlanTieredPrice && newPlanTieredBpsPrice == other.newPlanTieredBpsPrice && newPlanBpsPrice == other.newPlanBpsPrice && newPlanBulkBpsPrice == other.newPlanBulkBpsPrice && newPlanBulkPrice == other.newPlanBulkPrice && newPlanThresholdTotalAmountPrice == other.newPlanThresholdTotalAmountPrice && newPlanTieredPackagePrice == other.newPlanTieredPackagePrice && newPlanTieredWithMinimumPrice == other.newPlanTieredWithMinimumPrice && newPlanUnitWithPercentPrice == other.newPlanUnitWithPercentPrice && newPlanPackageWithAllocationPrice == other.newPlanPackageWithAllocationPrice && newPlanTierWithProrationPrice == other.newPlanTierWithProrationPrice && newPlanUnitWithProrationPrice == other.newPlanUnitWithProrationPrice && newPlanGroupedAllocationPrice == other.newPlanGroupedAllocationPrice && newPlanGroupedWithProratedMinimumPrice == other.newPlanGroupedWithProratedMinimumPrice && newPlanGroupedWithMeteredMinimumPrice == other.newPlanGroupedWithMeteredMinimumPrice && newPlanMatrixWithDisplayNamePrice == other.newPlanMatrixWithDisplayNamePrice && newPlanBulkWithProrationPrice == other.newPlanBulkWithProrationPrice && newPlanGroupedTieredPackagePrice == other.newPlanGroupedTieredPackagePrice /* spotless:on */
}
- override fun hashCode(): Int = /* spotless:off */ Objects.hash(newPlanUnitPrice, newPlanPackagePrice, newPlanMatrixPrice, newPlanTieredPrice, newPlanTieredBpsPrice, newPlanBpsPrice, newPlanBulkBpsPrice, newPlanBulkPrice, newPlanThresholdTotalAmountPrice, newPlanTieredPackagePrice, newPlanTieredWithMinimumPrice, newPlanUnitWithPercentPrice, newPlanPackageWithAllocationPrice, newPlanTierWithProrationPrice, newPlanUnitWithProrationPrice, newPlanGroupedAllocationPrice, newPlanGroupedWithProratedMinimumPrice, newPlanGroupedWithMeteredMinimumPrice, newPlanMatrixWithDisplayNamePrice, newPlanBulkWithProrationPrice, newPlanGroupedTieredPackagePrice, newPlanMaxGroupTieredPrice) /* spotless:on */
+ override fun hashCode(): Int = /* spotless:off */ Objects.hash(newPlanUnitPrice, newPlanPackagePrice, newPlanMatrixPrice, newPlanTieredPrice, newPlanTieredBpsPrice, newPlanBpsPrice, newPlanBulkBpsPrice, newPlanBulkPrice, newPlanThresholdTotalAmountPrice, newPlanTieredPackagePrice, newPlanTieredWithMinimumPrice, newPlanUnitWithPercentPrice, newPlanPackageWithAllocationPrice, newPlanTierWithProrationPrice, newPlanUnitWithProrationPrice, newPlanGroupedAllocationPrice, newPlanGroupedWithProratedMinimumPrice, newPlanGroupedWithMeteredMinimumPrice, newPlanMatrixWithDisplayNamePrice, newPlanBulkWithProrationPrice, newPlanGroupedTieredPackagePrice) /* spotless:on */
override fun toString(): String =
when {
@@ -1514,8 +1482,6 @@ constructor(
"Price{newPlanBulkWithProrationPrice=$newPlanBulkWithProrationPrice}"
newPlanGroupedTieredPackagePrice != null ->
"Price{newPlanGroupedTieredPackagePrice=$newPlanGroupedTieredPackagePrice}"
- newPlanMaxGroupTieredPrice != null ->
- "Price{newPlanMaxGroupTieredPrice=$newPlanMaxGroupTieredPrice}"
_json != null -> "Price{_unknown=$_json}"
else -> throw IllegalStateException("Invalid Price")
}
@@ -1620,11 +1586,6 @@ constructor(
fun ofNewPlanGroupedTieredPackagePrice(
newPlanGroupedTieredPackagePrice: NewPlanGroupedTieredPackagePrice
) = Price(newPlanGroupedTieredPackagePrice = newPlanGroupedTieredPackagePrice)
-
- @JvmStatic
- fun ofNewPlanMaxGroupTieredPrice(
- newPlanMaxGroupTieredPrice: NewPlanMaxGroupTieredPrice
- ) = Price(newPlanMaxGroupTieredPrice = newPlanMaxGroupTieredPrice)
}
interface Visitor {
@@ -1697,10 +1658,6 @@ constructor(
newPlanGroupedTieredPackagePrice: NewPlanGroupedTieredPackagePrice
): T
- fun visitNewPlanMaxGroupTieredPrice(
- newPlanMaxGroupTieredPrice: NewPlanMaxGroupTieredPrice
- ): T
-
fun unknown(json: JsonValue?): T {
throw OrbInvalidDataException("Unknown Price: $json")
}
@@ -1884,14 +1841,6 @@ constructor(
return Price(newPlanGroupedTieredPackagePrice = it, _json = json)
}
}
- "max_group_tiered" -> {
- tryDeserialize(node, jacksonTypeRef()) {
- it.validate()
- }
- ?.let {
- return Price(newPlanMaxGroupTieredPrice = it, _json = json)
- }
- }
}
return Price(_json = json)
@@ -1945,8 +1894,6 @@ constructor(
generator.writeObject(value.newPlanBulkWithProrationPrice)
value.newPlanGroupedTieredPackagePrice != null ->
generator.writeObject(value.newPlanGroupedTieredPackagePrice)
- value.newPlanMaxGroupTieredPrice != null ->
- generator.writeObject(value.newPlanMaxGroupTieredPrice)
value._json != null -> generator.writeObject(value._json)
else -> throw IllegalStateException("Invalid Price")
}
@@ -2532,6 +2479,7 @@ constructor(
)
}
+ /** The cadence to bill for this price on. */
class Cadence
@JsonCreator
private constructor(
@@ -2887,6 +2835,7 @@ constructor(
)
}
+ /** The unit of billing period duration. */
class DurationUnit
@JsonCreator
private constructor(
@@ -3080,6 +3029,7 @@ constructor(
)
}
+ /** The unit of billing period duration. */
class DurationUnit
@JsonCreator
private constructor(
@@ -3839,6 +3789,7 @@ constructor(
)
}
+ /** The cadence to bill for this price on. */
class Cadence
@JsonCreator
private constructor(
@@ -4230,6 +4181,7 @@ constructor(
)
}
+ /** The unit of billing period duration. */
class DurationUnit
@JsonCreator
private constructor(
@@ -4423,6 +4375,7 @@ constructor(
)
}
+ /** The unit of billing period duration. */
class DurationUnit
@JsonCreator
private constructor(
@@ -5182,6 +5135,7 @@ constructor(
)
}
+ /** The cadence to bill for this price on. */
class Cadence
@JsonCreator
private constructor(
@@ -5793,6 +5747,7 @@ constructor(
)
}
+ /** The unit of billing period duration. */
class DurationUnit
@JsonCreator
private constructor(
@@ -5986,6 +5941,7 @@ constructor(
)
}
+ /** The unit of billing period duration. */
class DurationUnit
@JsonCreator
private constructor(
@@ -6745,6 +6701,7 @@ constructor(
)
}
+ /** The cadence to bill for this price on. */
class Cadence
@JsonCreator
private constructor(
@@ -7285,6 +7242,7 @@ constructor(
)
}
+ /** The unit of billing period duration. */
class DurationUnit
@JsonCreator
private constructor(
@@ -7478,6 +7436,7 @@ constructor(
)
}
+ /** The unit of billing period duration. */
class DurationUnit
@JsonCreator
private constructor(
@@ -8238,6 +8197,7 @@ constructor(
)
}
+ /** The cadence to bill for this price on. */
class Cadence
@JsonCreator
private constructor(
@@ -8806,6 +8766,7 @@ constructor(
)
}
+ /** The unit of billing period duration. */
class DurationUnit
@JsonCreator
private constructor(
@@ -8999,6 +8960,7 @@ constructor(
)
}
+ /** The unit of billing period duration. */
class DurationUnit
@JsonCreator
private constructor(
@@ -9889,6 +9851,7 @@ constructor(
"BpsConfig{bps=$bps, perUnitMaximum=$perUnitMaximum, additionalProperties=$additionalProperties}"
}
+ /** The cadence to bill for this price on. */
class Cadence
@JsonCreator
private constructor(
@@ -10137,6 +10100,7 @@ constructor(
)
}
+ /** The unit of billing period duration. */
class DurationUnit
@JsonCreator
private constructor(
@@ -10330,6 +10294,7 @@ constructor(
)
}
+ /** The unit of billing period duration. */
class DurationUnit
@JsonCreator
private constructor(
@@ -11385,6 +11350,7 @@ constructor(
"BulkBpsConfig{tiers=$tiers, additionalProperties=$additionalProperties}"
}
+ /** The cadence to bill for this price on. */
class Cadence
@JsonCreator
private constructor(
@@ -11633,6 +11599,7 @@ constructor(
)
}
+ /** The unit of billing period duration. */
class DurationUnit
@JsonCreator
private constructor(
@@ -11826,6 +11793,7 @@ constructor(
)
}
+ /** The unit of billing period duration. */
class DurationUnit
@JsonCreator
private constructor(
@@ -12847,6 +12815,7 @@ constructor(
"BulkConfig{tiers=$tiers, additionalProperties=$additionalProperties}"
}
+ /** The cadence to bill for this price on. */
class Cadence
@JsonCreator
private constructor(
@@ -13095,6 +13064,7 @@ constructor(
)
}
+ /** The unit of billing period duration. */
class DurationUnit
@JsonCreator
private constructor(
@@ -13288,6 +13258,7 @@ constructor(
)
}
+ /** The unit of billing period duration. */
class DurationUnit
@JsonCreator
private constructor(
@@ -14058,6 +14029,7 @@ constructor(
)
}
+ /** The cadence to bill for this price on. */
class Cadence
@JsonCreator
private constructor(
@@ -14390,6 +14362,7 @@ constructor(
)
}
+ /** The unit of billing period duration. */
class DurationUnit
@JsonCreator
private constructor(
@@ -14583,6 +14556,7 @@ constructor(
)
}
+ /** The unit of billing period duration. */
class DurationUnit
@JsonCreator
private constructor(
@@ -15346,6 +15320,7 @@ constructor(
)
}
+ /** The cadence to bill for this price on. */
class Cadence
@JsonCreator
private constructor(
@@ -15677,6 +15652,7 @@ constructor(
)
}
+ /** The unit of billing period duration. */
class DurationUnit
@JsonCreator
private constructor(
@@ -15870,6 +15846,7 @@ constructor(
)
}
+ /** The unit of billing period duration. */
class DurationUnit
@JsonCreator
private constructor(
@@ -16637,6 +16614,7 @@ constructor(
)
}
+ /** The cadence to bill for this price on. */
class Cadence
@JsonCreator
private constructor(
@@ -16968,6 +16946,7 @@ constructor(
)
}
+ /** The unit of billing period duration. */
class DurationUnit
@JsonCreator
private constructor(
@@ -17161,6 +17140,7 @@ constructor(
)
}
+ /** The unit of billing period duration. */
class DurationUnit
@JsonCreator
private constructor(
@@ -17926,6 +17906,7 @@ constructor(
)
}
+ /** The cadence to bill for this price on. */
class Cadence
@JsonCreator
private constructor(
@@ -18257,6 +18238,7 @@ constructor(
)
}
+ /** The unit of billing period duration. */
class DurationUnit
@JsonCreator
private constructor(
@@ -18450,6 +18432,7 @@ constructor(
)
}
+ /** The unit of billing period duration. */
class DurationUnit
@JsonCreator
private constructor(
@@ -19220,6 +19203,7 @@ constructor(
)
}
+ /** The cadence to bill for this price on. */
class Cadence
@JsonCreator
private constructor(
@@ -19552,6 +19536,7 @@ constructor(
)
}
+ /** The unit of billing period duration. */
class DurationUnit
@JsonCreator
private constructor(
@@ -19745,6 +19730,7 @@ constructor(
)
}
+ /** The unit of billing period duration. */
class DurationUnit
@JsonCreator
private constructor(
@@ -20513,6 +20499,7 @@ constructor(
)
}
+ /** The cadence to bill for this price on. */
class Cadence
@JsonCreator
private constructor(
@@ -20845,6 +20832,7 @@ constructor(
)
}
+ /** The unit of billing period duration. */
class DurationUnit
@JsonCreator
private constructor(
@@ -21038,6 +21026,7 @@ constructor(
)
}
+ /** The unit of billing period duration. */
class DurationUnit
@JsonCreator
private constructor(
@@ -21805,6 +21794,7 @@ constructor(
)
}
+ /** The cadence to bill for this price on. */
class Cadence
@JsonCreator
private constructor(
@@ -22136,6 +22126,7 @@ constructor(
)
}
+ /** The unit of billing period duration. */
class DurationUnit
@JsonCreator
private constructor(
@@ -22329,6 +22320,7 @@ constructor(
)
}
+ /** The unit of billing period duration. */
class DurationUnit
@JsonCreator
private constructor(
@@ -23096,6 +23088,7 @@ constructor(
)
}
+ /** The cadence to bill for this price on. */
class Cadence
@JsonCreator
private constructor(
@@ -23427,6 +23420,7 @@ constructor(
)
}
+ /** The unit of billing period duration. */
class DurationUnit
@JsonCreator
private constructor(
@@ -23620,6 +23614,7 @@ constructor(
)
}
+ /** The unit of billing period duration. */
class DurationUnit
@JsonCreator
private constructor(
@@ -24397,6 +24392,7 @@ constructor(
)
}
+ /** The cadence to bill for this price on. */
class Cadence
@JsonCreator
private constructor(
@@ -24731,6 +24727,7 @@ constructor(
)
}
+ /** The unit of billing period duration. */
class DurationUnit
@JsonCreator
private constructor(
@@ -24924,6 +24921,7 @@ constructor(
)
}
+ /** The unit of billing period duration. */
class DurationUnit
@JsonCreator
private constructor(
@@ -25699,6 +25697,7 @@ constructor(
)
}
+ /** The cadence to bill for this price on. */
class Cadence
@JsonCreator
private constructor(
@@ -26032,6 +26031,7 @@ constructor(
)
}
+ /** The unit of billing period duration. */
class DurationUnit
@JsonCreator
private constructor(
@@ -26225,6 +26225,7 @@ constructor(
)
}
+ /** The unit of billing period duration. */
class DurationUnit
@JsonCreator
private constructor(
@@ -26995,6 +26996,7 @@ constructor(
)
}
+ /** The cadence to bill for this price on. */
class Cadence
@JsonCreator
private constructor(
@@ -27327,6 +27329,7 @@ constructor(
)
}
+ /** The unit of billing period duration. */
class DurationUnit
@JsonCreator
private constructor(
@@ -27520,6 +27523,7 @@ constructor(
)
}
+ /** The unit of billing period duration. */
class DurationUnit
@JsonCreator
private constructor(
@@ -28370,6 +28374,7 @@ constructor(
"BulkWithProrationConfig{additionalProperties=$additionalProperties}"
}
+ /** The cadence to bill for this price on. */
class Cadence
@JsonCreator
private constructor(
@@ -28618,6 +28623,7 @@ constructor(
)
}
+ /** The unit of billing period duration. */
class DurationUnit
@JsonCreator
private constructor(
@@ -28811,6 +28817,7 @@ constructor(
)
}
+ /** The unit of billing period duration. */
class DurationUnit
@JsonCreator
private constructor(
@@ -29581,6 +29588,7 @@ constructor(
)
}
+ /** The cadence to bill for this price on. */
class Cadence
@JsonCreator
private constructor(
@@ -29913,6 +29921,7 @@ constructor(
)
}
+ /** The unit of billing period duration. */
class DurationUnit
@JsonCreator
private constructor(
@@ -30106,6 +30115,7 @@ constructor(
)
}
+ /** The unit of billing period duration. */
class DurationUnit
@JsonCreator
private constructor(
@@ -30284,1364 +30294,77 @@ constructor(
override fun toString() =
"NewPlanGroupedTieredPackagePrice{cadence=$cadence, groupedTieredPackageConfig=$groupedTieredPackageConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, currency=$currency, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}"
}
+ }
- @NoAutoDetect
- class NewPlanMaxGroupTieredPrice
- @JsonCreator
- private constructor(
- @JsonProperty("cadence")
- @ExcludeMissing
- private val cadence: JsonField = JsonMissing.of(),
- @JsonProperty("item_id")
- @ExcludeMissing
- private val itemId: JsonField = JsonMissing.of(),
- @JsonProperty("max_group_tiered_config")
- @ExcludeMissing
- private val maxGroupTieredConfig: JsonField = JsonMissing.of(),
- @JsonProperty("model_type")
- @ExcludeMissing
- private val modelType: JsonField = JsonMissing.of(),
- @JsonProperty("name")
- @ExcludeMissing
- private val name: JsonField = JsonMissing.of(),
- @JsonProperty("billable_metric_id")
- @ExcludeMissing
- private val billableMetricId: JsonField = JsonMissing.of(),
- @JsonProperty("billed_in_advance")
- @ExcludeMissing
- private val billedInAdvance: JsonField = JsonMissing.of(),
- @JsonProperty("billing_cycle_configuration")
- @ExcludeMissing
- private val billingCycleConfiguration: JsonField =
- JsonMissing.of(),
- @JsonProperty("conversion_rate")
- @ExcludeMissing
- private val conversionRate: JsonField = JsonMissing.of(),
- @JsonProperty("currency")
- @ExcludeMissing
- private val currency: JsonField = JsonMissing.of(),
- @JsonProperty("external_price_id")
- @ExcludeMissing
- private val externalPriceId: JsonField = JsonMissing.of(),
- @JsonProperty("fixed_price_quantity")
- @ExcludeMissing
- private val fixedPriceQuantity: JsonField = JsonMissing.of(),
- @JsonProperty("invoice_grouping_key")
- @ExcludeMissing
- private val invoiceGroupingKey: JsonField = JsonMissing.of(),
- @JsonProperty("invoicing_cycle_configuration")
- @ExcludeMissing
- private val invoicingCycleConfiguration: JsonField =
- JsonMissing.of(),
- @JsonProperty("metadata")
- @ExcludeMissing
- private val metadata: JsonField = JsonMissing.of(),
- @JsonAnySetter
- private val additionalProperties: Map = immutableEmptyMap(),
- ) {
+ /**
+ * User-specified key/value pairs for the resource. Individual keys can be removed by setting
+ * the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to
+ * `null`.
+ */
+ @NoAutoDetect
+ class Metadata
+ @JsonCreator
+ private constructor(
+ @JsonAnySetter
+ private val additionalProperties: Map = immutableEmptyMap(),
+ ) {
- /** The cadence to bill for this price on. */
- fun cadence(): Cadence = cadence.getRequired("cadence")
+ @JsonAnyGetter
+ @ExcludeMissing
+ fun _additionalProperties(): Map = additionalProperties
- /** The id of the item the plan will be associated with. */
- fun itemId(): String = itemId.getRequired("item_id")
+ private var validated: Boolean = false
- fun maxGroupTieredConfig(): MaxGroupTieredConfig =
- maxGroupTieredConfig.getRequired("max_group_tiered_config")
+ fun validate(): Metadata = apply {
+ if (validated) {
+ return@apply
+ }
- fun modelType(): ModelType = modelType.getRequired("model_type")
+ validated = true
+ }
- /** The name of the price. */
- fun name(): String = name.getRequired("name")
+ fun toBuilder() = Builder().from(this)
- /**
- * The id of the billable metric for the price. Only needed if the price is usage-based.
- */
- fun billableMetricId(): Optional =
- Optional.ofNullable(billableMetricId.getNullable("billable_metric_id"))
+ companion object {
- /**
- * 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.
- */
- fun billedInAdvance(): Optional =
- Optional.ofNullable(billedInAdvance.getNullable("billed_in_advance"))
+ @JvmStatic fun builder() = Builder()
+ }
- /**
- * For custom cadence: specifies the duration of the billing period in days or months.
- */
- fun billingCycleConfiguration(): Optional =
- Optional.ofNullable(
- billingCycleConfiguration.getNullable("billing_cycle_configuration")
- )
+ class Builder {
- /** The per unit conversion rate of the price currency to the invoicing currency. */
- fun conversionRate(): Optional =
- Optional.ofNullable(conversionRate.getNullable("conversion_rate"))
+ private var additionalProperties: MutableMap = mutableMapOf()
- /**
- * An ISO 4217 currency string, or custom pricing unit identifier, in which this price
- * is billed.
- */
- fun currency(): Optional = Optional.ofNullable(currency.getNullable("currency"))
+ @JvmSynthetic
+ internal fun from(metadata: Metadata) = apply {
+ additionalProperties = metadata.additionalProperties.toMutableMap()
+ }
- /** An alias for the price. */
- fun externalPriceId(): Optional =
- Optional.ofNullable(externalPriceId.getNullable("external_price_id"))
+ fun additionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.clear()
+ putAllAdditionalProperties(additionalProperties)
+ }
- /**
- * If the Price represents a fixed cost, this represents the quantity of units applied.
- */
- fun fixedPriceQuantity(): Optional =
- Optional.ofNullable(fixedPriceQuantity.getNullable("fixed_price_quantity"))
+ fun putAdditionalProperty(key: String, value: JsonValue) = apply {
+ additionalProperties.put(key, value)
+ }
- /** The property used to group this price on an invoice */
- fun invoiceGroupingKey(): Optional =
- Optional.ofNullable(invoiceGroupingKey.getNullable("invoice_grouping_key"))
+ fun putAllAdditionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.putAll(additionalProperties)
+ }
- /**
- * Within each billing cycle, specifies the cadence at which invoices are produced. If
- * unspecified, a single invoice is produced per billing cycle.
- */
- fun invoicingCycleConfiguration(): Optional =
- Optional.ofNullable(
- invoicingCycleConfiguration.getNullable("invoicing_cycle_configuration")
- )
+ fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) }
- /**
- * User-specified key/value pairs for the resource. Individual keys can be removed by
- * setting the value to `null`, and the entire metadata mapping can be cleared by
- * setting `metadata` to `null`.
- */
- fun metadata(): Optional =
- Optional.ofNullable(metadata.getNullable("metadata"))
+ fun removeAllAdditionalProperties(keys: Set) = apply {
+ keys.forEach(::removeAdditionalProperty)
+ }
- /** The cadence to bill for this price on. */
- @JsonProperty("cadence") @ExcludeMissing fun _cadence(): JsonField = cadence
+ fun build(): Metadata = Metadata(additionalProperties.toImmutable())
+ }
- /** The id of the item the plan will be associated with. */
- @JsonProperty("item_id") @ExcludeMissing fun _itemId(): JsonField = itemId
-
- @JsonProperty("max_group_tiered_config")
- @ExcludeMissing
- fun _maxGroupTieredConfig(): JsonField = maxGroupTieredConfig
-
- @JsonProperty("model_type")
- @ExcludeMissing
- fun _modelType(): JsonField = modelType
-
- /** The name of the price. */
- @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name
-
- /**
- * The id of the billable metric for the price. Only needed if the price is usage-based.
- */
- @JsonProperty("billable_metric_id")
- @ExcludeMissing
- fun _billableMetricId(): JsonField = billableMetricId
-
- /**
- * 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.
- */
- @JsonProperty("billed_in_advance")
- @ExcludeMissing
- fun _billedInAdvance(): JsonField = billedInAdvance
-
- /**
- * For custom cadence: specifies the duration of the billing period in days or months.
- */
- @JsonProperty("billing_cycle_configuration")
- @ExcludeMissing
- fun _billingCycleConfiguration(): JsonField =
- billingCycleConfiguration
-
- /** The per unit conversion rate of the price currency to the invoicing currency. */
- @JsonProperty("conversion_rate")
- @ExcludeMissing
- fun _conversionRate(): JsonField = conversionRate
-
- /**
- * An ISO 4217 currency string, or custom pricing unit identifier, in which this price
- * is billed.
- */
- @JsonProperty("currency") @ExcludeMissing fun _currency(): JsonField = currency
-
- /** An alias for the price. */
- @JsonProperty("external_price_id")
- @ExcludeMissing
- fun _externalPriceId(): JsonField = externalPriceId
-
- /**
- * If the Price represents a fixed cost, this represents the quantity of units applied.
- */
- @JsonProperty("fixed_price_quantity")
- @ExcludeMissing
- fun _fixedPriceQuantity(): JsonField = fixedPriceQuantity
-
- /** The property used to group this price on an invoice */
- @JsonProperty("invoice_grouping_key")
- @ExcludeMissing
- fun _invoiceGroupingKey(): JsonField = invoiceGroupingKey
-
- /**
- * Within each billing cycle, specifies the cadence at which invoices are produced. If
- * unspecified, a single invoice is produced per billing cycle.
- */
- @JsonProperty("invoicing_cycle_configuration")
- @ExcludeMissing
- fun _invoicingCycleConfiguration(): JsonField =
- invoicingCycleConfiguration
-
- /**
- * User-specified key/value pairs for the resource. Individual keys can be removed by
- * setting the value to `null`, and the entire metadata mapping can be cleared by
- * setting `metadata` to `null`.
- */
- @JsonProperty("metadata")
- @ExcludeMissing
- fun _metadata(): JsonField = metadata
-
- @JsonAnyGetter
- @ExcludeMissing
- fun _additionalProperties(): Map = additionalProperties
-
- private var validated: Boolean = false
-
- fun validate(): NewPlanMaxGroupTieredPrice = apply {
- if (validated) {
- return@apply
- }
-
- cadence()
- itemId()
- maxGroupTieredConfig().validate()
- modelType()
- name()
- billableMetricId()
- billedInAdvance()
- billingCycleConfiguration().ifPresent { it.validate() }
- conversionRate()
- currency()
- externalPriceId()
- fixedPriceQuantity()
- invoiceGroupingKey()
- invoicingCycleConfiguration().ifPresent { it.validate() }
- metadata().ifPresent { it.validate() }
- validated = true
- }
-
- fun toBuilder() = Builder().from(this)
-
- companion object {
-
- @JvmStatic fun builder() = Builder()
- }
-
- class Builder {
-
- private var cadence: JsonField? = null
- private var itemId: JsonField? = null
- private var maxGroupTieredConfig: JsonField? = null
- private var modelType: JsonField? = null
- private var name: JsonField? = null
- private var billableMetricId: JsonField = JsonMissing.of()
- private var billedInAdvance: JsonField = JsonMissing.of()
- private var billingCycleConfiguration: JsonField =
- JsonMissing.of()
- private var conversionRate: JsonField = JsonMissing.of()
- private var currency: JsonField = JsonMissing.of()
- private var externalPriceId: JsonField = JsonMissing.of()
- private var fixedPriceQuantity: JsonField = JsonMissing.of()
- private var invoiceGroupingKey: JsonField = JsonMissing.of()
- private var invoicingCycleConfiguration: JsonField =
- JsonMissing.of()
- private var metadata: JsonField = JsonMissing.of()
- private var additionalProperties: MutableMap = mutableMapOf()
-
- @JvmSynthetic
- internal fun from(newPlanMaxGroupTieredPrice: NewPlanMaxGroupTieredPrice) = apply {
- cadence = newPlanMaxGroupTieredPrice.cadence
- itemId = newPlanMaxGroupTieredPrice.itemId
- maxGroupTieredConfig = newPlanMaxGroupTieredPrice.maxGroupTieredConfig
- modelType = newPlanMaxGroupTieredPrice.modelType
- name = newPlanMaxGroupTieredPrice.name
- billableMetricId = newPlanMaxGroupTieredPrice.billableMetricId
- billedInAdvance = newPlanMaxGroupTieredPrice.billedInAdvance
- billingCycleConfiguration = newPlanMaxGroupTieredPrice.billingCycleConfiguration
- conversionRate = newPlanMaxGroupTieredPrice.conversionRate
- currency = newPlanMaxGroupTieredPrice.currency
- externalPriceId = newPlanMaxGroupTieredPrice.externalPriceId
- fixedPriceQuantity = newPlanMaxGroupTieredPrice.fixedPriceQuantity
- invoiceGroupingKey = newPlanMaxGroupTieredPrice.invoiceGroupingKey
- invoicingCycleConfiguration =
- newPlanMaxGroupTieredPrice.invoicingCycleConfiguration
- metadata = newPlanMaxGroupTieredPrice.metadata
- additionalProperties =
- newPlanMaxGroupTieredPrice.additionalProperties.toMutableMap()
- }
-
- /** The cadence to bill for this price on. */
- fun cadence(cadence: Cadence) = cadence(JsonField.of(cadence))
-
- /** The cadence to bill for this price on. */
- fun cadence(cadence: JsonField) = apply { this.cadence = cadence }
-
- /** The id of the item the plan will be associated with. */
- fun itemId(itemId: String) = itemId(JsonField.of(itemId))
-
- /** The id of the item the plan will be associated with. */
- fun itemId(itemId: JsonField) = apply { this.itemId = itemId }
-
- fun maxGroupTieredConfig(maxGroupTieredConfig: MaxGroupTieredConfig) =
- maxGroupTieredConfig(JsonField.of(maxGroupTieredConfig))
-
- fun maxGroupTieredConfig(maxGroupTieredConfig: JsonField) =
- apply {
- this.maxGroupTieredConfig = maxGroupTieredConfig
- }
-
- fun modelType(modelType: ModelType) = modelType(JsonField.of(modelType))
-
- fun modelType(modelType: JsonField) = apply {
- this.modelType = modelType
- }
-
- /** The name of the price. */
- fun name(name: String) = name(JsonField.of(name))
-
- /** The name of the price. */
- fun name(name: JsonField) = apply { this.name = name }
-
- /**
- * The id of the billable metric for the price. Only needed if the price is
- * usage-based.
- */
- fun billableMetricId(billableMetricId: String?) =
- billableMetricId(JsonField.ofNullable(billableMetricId))
-
- /**
- * The id of the billable metric for the price. Only needed if the price is
- * usage-based.
- */
- fun billableMetricId(billableMetricId: Optional) =
- billableMetricId(billableMetricId.orElse(null))
-
- /**
- * The id of the billable metric for the price. Only needed if the price is
- * usage-based.
- */
- fun billableMetricId(billableMetricId: JsonField) = apply {
- this.billableMetricId = billableMetricId
- }
-
- /**
- * 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.
- */
- fun billedInAdvance(billedInAdvance: Boolean?) =
- billedInAdvance(JsonField.ofNullable(billedInAdvance))
-
- /**
- * 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.
- */
- fun billedInAdvance(billedInAdvance: Boolean) =
- billedInAdvance(billedInAdvance as Boolean?)
-
- /**
- * 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?)
-
- /**
- * 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.
- */
- fun billedInAdvance(billedInAdvance: JsonField) = apply {
- this.billedInAdvance = billedInAdvance
- }
-
- /**
- * For custom cadence: specifies the duration of the billing period in days or
- * months.
- */
- fun billingCycleConfiguration(
- billingCycleConfiguration: BillingCycleConfiguration?
- ) = billingCycleConfiguration(JsonField.ofNullable(billingCycleConfiguration))
-
- /**
- * For custom cadence: specifies the duration of the billing period in days or
- * months.
- */
- fun billingCycleConfiguration(
- billingCycleConfiguration: Optional
- ) = billingCycleConfiguration(billingCycleConfiguration.orElse(null))
-
- /**
- * For custom cadence: specifies the duration of the billing period in days or
- * months.
- */
- fun billingCycleConfiguration(
- billingCycleConfiguration: JsonField
- ) = apply { this.billingCycleConfiguration = billingCycleConfiguration }
-
- /** The per unit conversion rate of the price currency to the invoicing currency. */
- fun conversionRate(conversionRate: Double?) =
- conversionRate(JsonField.ofNullable(conversionRate))
-
- /** The per unit conversion rate of the price currency to the invoicing currency. */
- fun conversionRate(conversionRate: Double) =
- 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?)
-
- /** The per unit conversion rate of the price currency to the invoicing currency. */
- fun conversionRate(conversionRate: JsonField) = apply {
- this.conversionRate = conversionRate
- }
-
- /**
- * An ISO 4217 currency string, or custom pricing unit identifier, in which this
- * price is billed.
- */
- fun currency(currency: String?) = currency(JsonField.ofNullable(currency))
-
- /**
- * An ISO 4217 currency string, or custom pricing unit identifier, in which this
- * price is billed.
- */
- fun currency(currency: Optional) = currency(currency.orElse(null))
-
- /**
- * An ISO 4217 currency string, or custom pricing unit identifier, in which this
- * price is billed.
- */
- fun currency(currency: JsonField) = apply { this.currency = currency }
-
- /** An alias for the price. */
- fun externalPriceId(externalPriceId: String?) =
- externalPriceId(JsonField.ofNullable(externalPriceId))
-
- /** An alias for the price. */
- fun externalPriceId(externalPriceId: Optional) =
- externalPriceId(externalPriceId.orElse(null))
-
- /** An alias for the price. */
- fun externalPriceId(externalPriceId: JsonField) = apply {
- this.externalPriceId = externalPriceId
- }
-
- /**
- * If the Price represents a fixed cost, this represents the quantity of units
- * applied.
- */
- fun fixedPriceQuantity(fixedPriceQuantity: Double?) =
- fixedPriceQuantity(JsonField.ofNullable(fixedPriceQuantity))
-
- /**
- * If the Price represents a fixed cost, this represents the quantity of units
- * applied.
- */
- fun fixedPriceQuantity(fixedPriceQuantity: Double) =
- fixedPriceQuantity(fixedPriceQuantity as Double?)
-
- /**
- * 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?)
-
- /**
- * If the Price represents a fixed cost, this represents the quantity of units
- * applied.
- */
- fun fixedPriceQuantity(fixedPriceQuantity: JsonField) = apply {
- this.fixedPriceQuantity = fixedPriceQuantity
- }
-
- /** The property used to group this price on an invoice */
- fun invoiceGroupingKey(invoiceGroupingKey: String?) =
- invoiceGroupingKey(JsonField.ofNullable(invoiceGroupingKey))
-
- /** The property used to group this price on an invoice */
- fun invoiceGroupingKey(invoiceGroupingKey: Optional) =
- invoiceGroupingKey(invoiceGroupingKey.orElse(null))
-
- /** The property used to group this price on an invoice */
- fun invoiceGroupingKey(invoiceGroupingKey: JsonField) = apply {
- this.invoiceGroupingKey = invoiceGroupingKey
- }
-
- /**
- * Within each billing cycle, specifies the cadence at which invoices are produced.
- * If unspecified, a single invoice is produced per billing cycle.
- */
- fun invoicingCycleConfiguration(
- invoicingCycleConfiguration: InvoicingCycleConfiguration?
- ) = invoicingCycleConfiguration(JsonField.ofNullable(invoicingCycleConfiguration))
-
- /**
- * Within each billing cycle, specifies the cadence at which invoices are produced.
- * If unspecified, a single invoice is produced per billing cycle.
- */
- fun invoicingCycleConfiguration(
- invoicingCycleConfiguration: Optional
- ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null))
-
- /**
- * Within each billing cycle, specifies the cadence at which invoices are produced.
- * If unspecified, a single invoice is produced per billing cycle.
- */
- fun invoicingCycleConfiguration(
- invoicingCycleConfiguration: JsonField
- ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration }
-
- /**
- * User-specified key/value pairs for the resource. Individual keys can be removed
- * by setting the value to `null`, and the entire metadata mapping can be cleared by
- * setting `metadata` to `null`.
- */
- fun metadata(metadata: Metadata?) = metadata(JsonField.ofNullable(metadata))
-
- /**
- * User-specified key/value pairs for the resource. Individual keys can be removed
- * by setting the value to `null`, and the entire metadata mapping can be cleared by
- * setting `metadata` to `null`.
- */
- fun metadata(metadata: Optional) = metadata(metadata.orElse(null))
-
- /**
- * User-specified key/value pairs for the resource. Individual keys can be removed
- * by setting the value to `null`, and the entire metadata mapping can be cleared by
- * setting `metadata` to `null`.
- */
- fun metadata(metadata: JsonField) = apply { this.metadata = metadata }
-
- fun additionalProperties(additionalProperties: Map) = apply {
- this.additionalProperties.clear()
- putAllAdditionalProperties(additionalProperties)
- }
-
- fun putAdditionalProperty(key: String, value: JsonValue) = apply {
- additionalProperties.put(key, value)
- }
-
- fun putAllAdditionalProperties(additionalProperties: Map) =
- apply {
- this.additionalProperties.putAll(additionalProperties)
- }
-
- fun removeAdditionalProperty(key: String) = apply {
- additionalProperties.remove(key)
- }
-
- fun removeAllAdditionalProperties(keys: Set) = apply {
- keys.forEach(::removeAdditionalProperty)
- }
-
- fun build(): NewPlanMaxGroupTieredPrice =
- NewPlanMaxGroupTieredPrice(
- checkRequired("cadence", cadence),
- checkRequired("itemId", itemId),
- checkRequired("maxGroupTieredConfig", maxGroupTieredConfig),
- checkRequired("modelType", modelType),
- checkRequired("name", name),
- billableMetricId,
- billedInAdvance,
- billingCycleConfiguration,
- conversionRate,
- currency,
- externalPriceId,
- fixedPriceQuantity,
- invoiceGroupingKey,
- invoicingCycleConfiguration,
- metadata,
- additionalProperties.toImmutable(),
- )
- }
-
- class Cadence
- @JsonCreator
- private constructor(
- private val value: JsonField,
- ) : Enum {
-
- @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value
-
- companion object {
-
- @JvmField val ANNUAL = of("annual")
-
- @JvmField val SEMI_ANNUAL = of("semi_annual")
-
- @JvmField val MONTHLY = of("monthly")
-
- @JvmField val QUARTERLY = of("quarterly")
-
- @JvmField val ONE_TIME = of("one_time")
-
- @JvmField val CUSTOM = of("custom")
-
- @JvmStatic fun of(value: String) = Cadence(JsonField.of(value))
- }
-
- enum class Known {
- ANNUAL,
- SEMI_ANNUAL,
- MONTHLY,
- QUARTERLY,
- ONE_TIME,
- CUSTOM,
- }
-
- enum class Value {
- ANNUAL,
- SEMI_ANNUAL,
- MONTHLY,
- QUARTERLY,
- ONE_TIME,
- CUSTOM,
- _UNKNOWN,
- }
-
- fun value(): Value =
- when (this) {
- ANNUAL -> Value.ANNUAL
- SEMI_ANNUAL -> Value.SEMI_ANNUAL
- MONTHLY -> Value.MONTHLY
- QUARTERLY -> Value.QUARTERLY
- ONE_TIME -> Value.ONE_TIME
- CUSTOM -> Value.CUSTOM
- else -> Value._UNKNOWN
- }
-
- fun known(): Known =
- when (this) {
- ANNUAL -> Known.ANNUAL
- SEMI_ANNUAL -> Known.SEMI_ANNUAL
- MONTHLY -> Known.MONTHLY
- QUARTERLY -> Known.QUARTERLY
- ONE_TIME -> Known.ONE_TIME
- CUSTOM -> Known.CUSTOM
- else -> throw OrbInvalidDataException("Unknown Cadence: $value")
- }
-
- fun asString(): String = _value().asStringOrThrow()
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return /* spotless:off */ other is Cadence && value == other.value /* spotless:on */
- }
-
- override fun hashCode() = value.hashCode()
-
- override fun toString() = value.toString()
- }
-
- @NoAutoDetect
- class MaxGroupTieredConfig
- @JsonCreator
- private constructor(
- @JsonAnySetter
- private val additionalProperties: Map = immutableEmptyMap(),
- ) {
-
- @JsonAnyGetter
- @ExcludeMissing
- fun _additionalProperties(): Map = additionalProperties
-
- private var validated: Boolean = false
-
- fun validate(): MaxGroupTieredConfig = apply {
- if (validated) {
- return@apply
- }
-
- validated = true
- }
-
- fun toBuilder() = Builder().from(this)
-
- companion object {
-
- @JvmStatic fun builder() = Builder()
- }
-
- class Builder {
-
- private var additionalProperties: MutableMap = mutableMapOf()
-
- @JvmSynthetic
- internal fun from(maxGroupTieredConfig: MaxGroupTieredConfig) = apply {
- additionalProperties =
- maxGroupTieredConfig.additionalProperties.toMutableMap()
- }
-
- fun additionalProperties(additionalProperties: Map) = apply {
- this.additionalProperties.clear()
- putAllAdditionalProperties(additionalProperties)
- }
-
- fun putAdditionalProperty(key: String, value: JsonValue) = apply {
- additionalProperties.put(key, value)
- }
-
- fun putAllAdditionalProperties(additionalProperties: Map) =
- apply {
- this.additionalProperties.putAll(additionalProperties)
- }
-
- fun removeAdditionalProperty(key: String) = apply {
- additionalProperties.remove(key)
- }
-
- fun removeAllAdditionalProperties(keys: Set) = apply {
- keys.forEach(::removeAdditionalProperty)
- }
-
- fun build(): MaxGroupTieredConfig =
- MaxGroupTieredConfig(additionalProperties.toImmutable())
- }
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return /* spotless:off */ other is MaxGroupTieredConfig && additionalProperties == other.additionalProperties /* spotless:on */
- }
-
- /* spotless:off */
- private val hashCode: Int by lazy { Objects.hash(additionalProperties) }
- /* spotless:on */
-
- override fun hashCode(): Int = hashCode
-
- override fun toString() =
- "MaxGroupTieredConfig{additionalProperties=$additionalProperties}"
- }
-
- class ModelType
- @JsonCreator
- private constructor(
- private val value: JsonField,
- ) : Enum {
-
- @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value
-
- companion object {
-
- @JvmField val MAX_GROUP_TIERED = of("max_group_tiered")
-
- @JvmStatic fun of(value: String) = ModelType(JsonField.of(value))
- }
-
- enum class Known {
- MAX_GROUP_TIERED,
- }
-
- enum class Value {
- MAX_GROUP_TIERED,
- _UNKNOWN,
- }
-
- fun value(): Value =
- when (this) {
- MAX_GROUP_TIERED -> Value.MAX_GROUP_TIERED
- else -> Value._UNKNOWN
- }
-
- fun known(): Known =
- when (this) {
- MAX_GROUP_TIERED -> Known.MAX_GROUP_TIERED
- else -> throw OrbInvalidDataException("Unknown ModelType: $value")
- }
-
- fun asString(): String = _value().asStringOrThrow()
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return /* spotless:off */ other is ModelType && value == other.value /* spotless:on */
- }
-
- override fun hashCode() = value.hashCode()
-
- override fun toString() = value.toString()
- }
-
- /**
- * For custom cadence: specifies the duration of the billing period in days or months.
- */
- @NoAutoDetect
- class BillingCycleConfiguration
- @JsonCreator
- private constructor(
- @JsonProperty("duration")
- @ExcludeMissing
- private val duration: JsonField = JsonMissing.of(),
- @JsonProperty("duration_unit")
- @ExcludeMissing
- private val durationUnit: JsonField = JsonMissing.of(),
- @JsonAnySetter
- private val additionalProperties: Map = immutableEmptyMap(),
- ) {
-
- /** The duration of the billing period. */
- fun duration(): Long = duration.getRequired("duration")
-
- /** The unit of billing period duration. */
- fun durationUnit(): DurationUnit = durationUnit.getRequired("duration_unit")
-
- /** The duration of the billing period. */
- @JsonProperty("duration")
- @ExcludeMissing
- fun _duration(): JsonField = duration
-
- /** The unit of billing period duration. */
- @JsonProperty("duration_unit")
- @ExcludeMissing
- fun _durationUnit(): JsonField = durationUnit
-
- @JsonAnyGetter
- @ExcludeMissing
- fun _additionalProperties(): Map = additionalProperties
-
- private var validated: Boolean = false
-
- fun validate(): BillingCycleConfiguration = apply {
- if (validated) {
- return@apply
- }
-
- duration()
- durationUnit()
- validated = true
- }
-
- fun toBuilder() = Builder().from(this)
-
- companion object {
-
- @JvmStatic fun builder() = Builder()
- }
-
- class Builder {
-
- private var duration: JsonField? = null
- private var durationUnit: JsonField? = null
- private var additionalProperties: MutableMap = mutableMapOf()
-
- @JvmSynthetic
- internal fun from(billingCycleConfiguration: BillingCycleConfiguration) =
- apply {
- duration = billingCycleConfiguration.duration
- durationUnit = billingCycleConfiguration.durationUnit
- additionalProperties =
- billingCycleConfiguration.additionalProperties.toMutableMap()
- }
-
- /** The duration of the billing period. */
- fun duration(duration: Long) = duration(JsonField.of(duration))
-
- /** The duration of the billing period. */
- fun duration(duration: JsonField) = apply { this.duration = duration }
-
- /** The unit of billing period duration. */
- fun durationUnit(durationUnit: DurationUnit) =
- durationUnit(JsonField.of(durationUnit))
-
- /** The unit of billing period duration. */
- fun durationUnit(durationUnit: JsonField) = apply {
- this.durationUnit = durationUnit
- }
-
- fun additionalProperties(additionalProperties: Map) = apply {
- this.additionalProperties.clear()
- putAllAdditionalProperties(additionalProperties)
- }
-
- fun putAdditionalProperty(key: String, value: JsonValue) = apply {
- additionalProperties.put(key, value)
- }
-
- fun putAllAdditionalProperties(additionalProperties: Map) =
- apply {
- this.additionalProperties.putAll(additionalProperties)
- }
-
- fun removeAdditionalProperty(key: String) = apply {
- additionalProperties.remove(key)
- }
-
- fun removeAllAdditionalProperties(keys: Set) = apply {
- keys.forEach(::removeAdditionalProperty)
- }
-
- fun build(): BillingCycleConfiguration =
- BillingCycleConfiguration(
- checkRequired("duration", duration),
- checkRequired("durationUnit", durationUnit),
- additionalProperties.toImmutable(),
- )
- }
-
- class DurationUnit
- @JsonCreator
- private constructor(
- private val value: JsonField,
- ) : Enum {
-
- @com.fasterxml.jackson.annotation.JsonValue
- fun _value(): JsonField = value
-
- companion object {
-
- @JvmField val DAY = of("day")
-
- @JvmField val MONTH = of("month")
-
- @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value))
- }
-
- enum class Known {
- DAY,
- MONTH,
- }
-
- enum class Value {
- DAY,
- MONTH,
- _UNKNOWN,
- }
-
- fun value(): Value =
- when (this) {
- DAY -> Value.DAY
- MONTH -> Value.MONTH
- else -> Value._UNKNOWN
- }
-
- fun known(): Known =
- when (this) {
- DAY -> Known.DAY
- MONTH -> Known.MONTH
- else -> throw OrbInvalidDataException("Unknown DurationUnit: $value")
- }
-
- fun asString(): String = _value().asStringOrThrow()
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return /* spotless:off */ other is DurationUnit && value == other.value /* spotless:on */
- }
-
- override fun hashCode() = value.hashCode()
-
- override fun toString() = value.toString()
- }
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return /* spotless:off */ other is BillingCycleConfiguration && duration == other.duration && durationUnit == other.durationUnit && additionalProperties == other.additionalProperties /* spotless:on */
- }
-
- /* spotless:off */
- private val hashCode: Int by lazy { Objects.hash(duration, durationUnit, additionalProperties) }
- /* spotless:on */
-
- override fun hashCode(): Int = hashCode
-
- override fun toString() =
- "BillingCycleConfiguration{duration=$duration, durationUnit=$durationUnit, additionalProperties=$additionalProperties}"
- }
-
- /**
- * Within each billing cycle, specifies the cadence at which invoices are produced. If
- * unspecified, a single invoice is produced per billing cycle.
- */
- @NoAutoDetect
- class InvoicingCycleConfiguration
- @JsonCreator
- private constructor(
- @JsonProperty("duration")
- @ExcludeMissing
- private val duration: JsonField = JsonMissing.of(),
- @JsonProperty("duration_unit")
- @ExcludeMissing
- private val durationUnit: JsonField = JsonMissing.of(),
- @JsonAnySetter
- private val additionalProperties: Map = immutableEmptyMap(),
- ) {
-
- /** The duration of the billing period. */
- fun duration(): Long = duration.getRequired("duration")
-
- /** The unit of billing period duration. */
- fun durationUnit(): DurationUnit = durationUnit.getRequired("duration_unit")
-
- /** The duration of the billing period. */
- @JsonProperty("duration")
- @ExcludeMissing
- fun _duration(): JsonField = duration
-
- /** The unit of billing period duration. */
- @JsonProperty("duration_unit")
- @ExcludeMissing
- fun _durationUnit(): JsonField = durationUnit
-
- @JsonAnyGetter
- @ExcludeMissing
- fun _additionalProperties(): Map = additionalProperties
-
- private var validated: Boolean = false
-
- fun validate(): InvoicingCycleConfiguration = apply {
- if (validated) {
- return@apply
- }
-
- duration()
- durationUnit()
- validated = true
- }
-
- fun toBuilder() = Builder().from(this)
-
- companion object {
-
- @JvmStatic fun builder() = Builder()
- }
-
- class Builder {
-
- private var duration: JsonField? = null
- private var durationUnit: JsonField? = null
- private var additionalProperties: MutableMap = mutableMapOf()
-
- @JvmSynthetic
- internal fun from(invoicingCycleConfiguration: InvoicingCycleConfiguration) =
- apply {
- duration = invoicingCycleConfiguration.duration
- durationUnit = invoicingCycleConfiguration.durationUnit
- additionalProperties =
- invoicingCycleConfiguration.additionalProperties.toMutableMap()
- }
-
- /** The duration of the billing period. */
- fun duration(duration: Long) = duration(JsonField.of(duration))
-
- /** The duration of the billing period. */
- fun duration(duration: JsonField) = apply { this.duration = duration }
-
- /** The unit of billing period duration. */
- fun durationUnit(durationUnit: DurationUnit) =
- durationUnit(JsonField.of(durationUnit))
-
- /** The unit of billing period duration. */
- fun durationUnit(durationUnit: JsonField) = apply {
- this.durationUnit = durationUnit
- }
-
- fun additionalProperties(additionalProperties: Map) = apply {
- this.additionalProperties.clear()
- putAllAdditionalProperties(additionalProperties)
- }
-
- fun putAdditionalProperty(key: String, value: JsonValue) = apply {
- additionalProperties.put(key, value)
- }
-
- fun putAllAdditionalProperties(additionalProperties: Map) =
- apply {
- this.additionalProperties.putAll(additionalProperties)
- }
-
- fun removeAdditionalProperty(key: String) = apply {
- additionalProperties.remove(key)
- }
-
- fun removeAllAdditionalProperties(keys: Set) = apply {
- keys.forEach(::removeAdditionalProperty)
- }
-
- fun build(): InvoicingCycleConfiguration =
- InvoicingCycleConfiguration(
- checkRequired("duration", duration),
- checkRequired("durationUnit", durationUnit),
- additionalProperties.toImmutable(),
- )
- }
-
- class DurationUnit
- @JsonCreator
- private constructor(
- private val value: JsonField,
- ) : Enum {
-
- @com.fasterxml.jackson.annotation.JsonValue
- fun _value(): JsonField = value
-
- companion object {
-
- @JvmField val DAY = of("day")
-
- @JvmField val MONTH = of("month")
-
- @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value))
- }
-
- enum class Known {
- DAY,
- MONTH,
- }
-
- enum class Value {
- DAY,
- MONTH,
- _UNKNOWN,
- }
-
- fun value(): Value =
- when (this) {
- DAY -> Value.DAY
- MONTH -> Value.MONTH
- else -> Value._UNKNOWN
- }
-
- fun known(): Known =
- when (this) {
- DAY -> Known.DAY
- MONTH -> Known.MONTH
- else -> throw OrbInvalidDataException("Unknown DurationUnit: $value")
- }
-
- fun asString(): String = _value().asStringOrThrow()
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return /* spotless:off */ other is DurationUnit && value == other.value /* spotless:on */
- }
-
- override fun hashCode() = value.hashCode()
-
- override fun toString() = value.toString()
- }
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return /* spotless:off */ other is InvoicingCycleConfiguration && duration == other.duration && durationUnit == other.durationUnit && additionalProperties == other.additionalProperties /* spotless:on */
- }
-
- /* spotless:off */
- private val hashCode: Int by lazy { Objects.hash(duration, durationUnit, additionalProperties) }
- /* spotless:on */
-
- override fun hashCode(): Int = hashCode
-
- override fun toString() =
- "InvoicingCycleConfiguration{duration=$duration, durationUnit=$durationUnit, additionalProperties=$additionalProperties}"
- }
-
- /**
- * User-specified key/value pairs for the resource. Individual keys can be removed by
- * setting the value to `null`, and the entire metadata mapping can be cleared by
- * setting `metadata` to `null`.
- */
- @NoAutoDetect
- class Metadata
- @JsonCreator
- private constructor(
- @JsonAnySetter
- private val additionalProperties: Map = immutableEmptyMap(),
- ) {
-
- @JsonAnyGetter
- @ExcludeMissing
- fun _additionalProperties(): Map = additionalProperties
-
- private var validated: Boolean = false
-
- fun validate(): Metadata = apply {
- if (validated) {
- return@apply
- }
-
- validated = true
- }
-
- fun toBuilder() = Builder().from(this)
-
- companion object {
-
- @JvmStatic fun builder() = Builder()
- }
-
- class Builder {
-
- private var additionalProperties: MutableMap = mutableMapOf()
-
- @JvmSynthetic
- internal fun from(metadata: Metadata) = apply {
- additionalProperties = metadata.additionalProperties.toMutableMap()
- }
-
- fun additionalProperties(additionalProperties: Map) = apply {
- this.additionalProperties.clear()
- putAllAdditionalProperties(additionalProperties)
- }
-
- fun putAdditionalProperty(key: String, value: JsonValue) = apply {
- additionalProperties.put(key, value)
- }
-
- fun putAllAdditionalProperties(additionalProperties: Map) =
- apply {
- this.additionalProperties.putAll(additionalProperties)
- }
-
- fun removeAdditionalProperty(key: String) = apply {
- additionalProperties.remove(key)
- }
-
- fun removeAllAdditionalProperties(keys: Set) = apply {
- keys.forEach(::removeAdditionalProperty)
- }
-
- fun build(): Metadata = Metadata(additionalProperties.toImmutable())
- }
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return /* spotless:off */ other is Metadata && additionalProperties == other.additionalProperties /* spotless:on */
- }
-
- /* spotless:off */
- private val hashCode: Int by lazy { Objects.hash(additionalProperties) }
- /* spotless:on */
-
- override fun hashCode(): Int = hashCode
-
- override fun toString() = "Metadata{additionalProperties=$additionalProperties}"
- }
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return /* spotless:off */ other is NewPlanMaxGroupTieredPrice && cadence == other.cadence && itemId == other.itemId && maxGroupTieredConfig == other.maxGroupTieredConfig && modelType == other.modelType && name == other.name && billableMetricId == other.billableMetricId && billedInAdvance == other.billedInAdvance && billingCycleConfiguration == other.billingCycleConfiguration && conversionRate == other.conversionRate && currency == other.currency && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && metadata == other.metadata && additionalProperties == other.additionalProperties /* spotless:on */
- }
-
- /* spotless:off */
- private val hashCode: Int by lazy { Objects.hash(cadence, itemId, maxGroupTieredConfig, modelType, name, billableMetricId, billedInAdvance, billingCycleConfiguration, conversionRate, currency, externalPriceId, fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, metadata, additionalProperties) }
- /* spotless:on */
-
- override fun hashCode(): Int = hashCode
-
- override fun toString() =
- "NewPlanMaxGroupTieredPrice{cadence=$cadence, itemId=$itemId, maxGroupTieredConfig=$maxGroupTieredConfig, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, currency=$currency, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}"
- }
- }
-
- /**
- * User-specified key/value pairs for the resource. Individual keys can be removed by setting
- * the value to `null`, and the entire metadata mapping can be cleared by setting `metadata` to
- * `null`.
- */
- @NoAutoDetect
- class Metadata
- @JsonCreator
- private constructor(
- @JsonAnySetter
- private val additionalProperties: Map = immutableEmptyMap(),
- ) {
-
- @JsonAnyGetter
- @ExcludeMissing
- fun _additionalProperties(): Map = additionalProperties
-
- private var validated: Boolean = false
-
- fun validate(): Metadata = apply {
- if (validated) {
- return@apply
- }
-
- validated = true
- }
-
- fun toBuilder() = Builder().from(this)
-
- companion object {
-
- @JvmStatic fun builder() = Builder()
- }
-
- class Builder {
-
- private var additionalProperties: MutableMap = mutableMapOf()
-
- @JvmSynthetic
- internal fun from(metadata: Metadata) = apply {
- additionalProperties = metadata.additionalProperties.toMutableMap()
- }
-
- fun additionalProperties(additionalProperties: Map) = apply {
- this.additionalProperties.clear()
- putAllAdditionalProperties(additionalProperties)
- }
-
- fun putAdditionalProperty(key: String, value: JsonValue) = apply {
- additionalProperties.put(key, value)
- }
-
- fun putAllAdditionalProperties(additionalProperties: Map) = apply {
- this.additionalProperties.putAll(additionalProperties)
- }
-
- fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) }
-
- fun removeAllAdditionalProperties(keys: Set) = apply {
- keys.forEach(::removeAdditionalProperty)
- }
-
- fun build(): Metadata = Metadata(additionalProperties.toImmutable())
- }
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
return /* spotless:off */ other is Metadata && additionalProperties == other.additionalProperties /* spotless:on */
}
@@ -31655,6 +30378,10 @@ constructor(
override fun toString() = "Metadata{additionalProperties=$additionalProperties}"
}
+ /**
+ * The status of the plan to create (either active or draft). If not specified, this defaults to
+ * active.
+ */
class Status
@JsonCreator
private constructor(
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/PlanExternalPlanIdFetchParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/PlanExternalPlanIdFetchParams.kt
index 75dff095..998fc69d 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/PlanExternalPlanIdFetchParams.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/PlanExternalPlanIdFetchParams.kt
@@ -9,7 +9,7 @@ import com.withorb.api.core.http.QueryParams
import java.util.Objects
/**
- * This endpoint is used to fetch [plan](../guides/concepts##plan-and-price) details given an
+ * This endpoint is used to fetch [plan](/core-concepts##plan-and-price) details given an
* external_plan_id identifier. It returns information about the prices included in the plan and
* their configuration, as well as the product that the plan is attached to.
*
@@ -20,9 +20,9 @@ import java.util.Objects
* ## Serialized prices
*
* Orb supports a few different pricing models out of the box. Each of these models is serialized
- * differently in a given [Price](../guides/concepts#plan-and-price) object. The `model_type` field
+ * differently in a given [Price](/core-concepts#plan-and-price) object. The `model_type` field
* determines the key for the configuration object that is present. A detailed explanation of price
- * types can be found in the [Price schema](../guides/concepts#plan-and-price). "
+ * types can be found in the [Price schema](/core-concepts#plan-and-price). "
*/
class PlanExternalPlanIdFetchParams
constructor(
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/PlanFetchParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/PlanFetchParams.kt
index cb608468..6a7efb9a 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/PlanFetchParams.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/PlanFetchParams.kt
@@ -9,16 +9,16 @@ import com.withorb.api.core.http.QueryParams
import java.util.Objects
/**
- * This endpoint is used to fetch [plan](../guides/concepts##plan-and-price) details given a plan
+ * This endpoint is used to fetch [plan](/core-concepts#plan-and-price) details given a plan
* identifier. It returns information about the prices included in the plan and their configuration,
* as well as the product that the plan is attached to.
*
* ## Serialized prices
*
* Orb supports a few different pricing models out of the box. Each of these models is serialized
- * differently in a given [Price](../guides/concepts#plan-and-price) object. The `model_type` field
+ * differently in a given [Price](/core-concepts#plan-and-price) object. The `model_type` field
* determines the key for the configuration object that is present. A detailed explanation of price
- * types can be found in the [Price schema](../guides/concepts#plan-and-price).
+ * types can be found in the [Price schema](/core-concepts#plan-and-price).
*
* ## Phases
*
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 67a94ad6..16dc93f6 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
@@ -19,6 +19,12 @@ import java.util.Optional
import java.util.stream.Stream
import java.util.stream.StreamSupport
+/**
+ * This endpoint returns a list of all [plans](/core-concepts#plan-and-price) for an account in a
+ * list format. The list of plans is ordered starting from the most recently created plan. The
+ * response also includes [`pagination_metadata`](/api-reference/pagination), which lets the caller
+ * retrieve the next page of results if they exist.
+ */
class PlanListPage
private constructor(
private val plansService: PlanService,
diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/PlanListPageAsync.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/PlanListPageAsync.kt
index 52faf357..978b5a14 100644
--- a/orb-java-core/src/main/kotlin/com/withorb/api/models/PlanListPageAsync.kt
+++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/PlanListPageAsync.kt
@@ -20,6 +20,12 @@ import java.util.concurrent.CompletableFuture
import java.util.concurrent.Executor
import java.util.function.Predicate
+/**
+ * This endpoint returns a list of all [plans](/core-concepts#plan-and-price) for an account in a
+ * list format. The list of plans is ordered starting from the most recently created plan. The
+ * response also includes [`pagination_metadata`](/api-reference/pagination), which lets the caller
+ * retrieve the next page of results if they exist.
+ */
class PlanListPageAsync
private constructor(
private val plansService: PlanServiceAsync,
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 00393917..89887f8e 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
@@ -15,9 +15,9 @@ import java.util.Objects
import java.util.Optional
/**
- * This endpoint returns a list of all [plans](../guides/concepts##plan-and-price) for an account in
- * a list format. The list of plans is ordered starting from the most recently created plan. The
- * response also includes [`pagination_metadata`](../reference/pagination), which lets the caller
+ * This endpoint returns a list of all [plans](/core-concepts#plan-and-price) for an account in a
+ * list format. The list of plans is ordered starting from the most recently created plan. The
+ * response also includes [`pagination_metadata`](/api-reference/pagination), which lets the caller
* retrieve the next page of results if they exist.
*/
class PlanListParams
@@ -286,6 +286,7 @@ constructor(
)
}
+ /** The plan status to filter to ('active', 'archived', or 'draft'). */
class Status
@JsonCreator
private constructor(
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 6017afd2..7d4950d1 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
@@ -40,220 +40,8 @@ import kotlin.jvm.optionals.getOrNull
* differently in a given Price object. The model_type field determines the key for the
* configuration object that is present.
*
- * ## Unit pricing
- *
- * With unit pricing, each unit costs a fixed amount.
- *
- * ```json
- * {
- * ...
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "0.50"
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered pricing
- *
- * In tiered pricing, the cost of a given unit depends on the tier range that it falls into, where
- * each tier range is defined by an upper and lower bound. For example, the first ten units may cost
- * $0.50 each and all units thereafter may cost $0.10 each.
- *
- * ```json
- * {
- * ...
- * "model_type": "tiered",
- * "tiered_config": {
- * "tiers": [
- * {
- * "first_unit": 1,
- * "last_unit": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "first_unit": 11,
- * "last_unit": null,
- * "unit_amount": "0.10"
- * }
- * ]
- * }
- * ...
- * ```
- *
- * ## Bulk pricing
- *
- * Bulk pricing applies when the number of units determine the cost of all units. For example, if
- * you've bought less than 10 units, they may each be $0.50 for a total of $5.00. Once you've bought
- * more than 10 units, all units may now be priced at $0.40 (i.e. 101 units total would be $40.40).
- *
- * ```json
- * {
- * ...
- * "model_type": "bulk",
- * "bulk_config": {
- * "tiers": [
- * {
- * "maximum_units": 10,
- * "unit_amount": "0.50"
- * },
- * {
- * "maximum_units": 1000,
- * "unit_amount": "0.40"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Package pricing
- *
- * Package pricing defines the size or granularity of a unit for billing purposes. For example, if
- * the package size is set to 5, then 4 units will be billed as 5 and 6 units will be billed at 10.
- *
- * ```json
- * {
- * ...
- * "model_type": "package",
- * "package_config": {
- * "package_amount": "0.80",
- * "package_size": 10
- * }
- * ...
- * }
- * ```
- *
- * ## BPS pricing
- *
- * BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a percent (the
- * number of basis points to charge), as well as a cap per event to assess. For example, this would
- * allow you to assess a fee of 0.25% on every payment you process, with a maximum charge of $25 per
- * payment.
- *
- * ```json
- * {
- * ...
- * "model_type": "bps",
- * "bps_config": {
- * "bps": 125,
- * "per_unit_maximum": "11.00"
- * }
- * ...
- * }
- * ```
- *
- * ## Bulk BPS pricing
- *
- * Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total quantity
- * across all events. Similar to bulk pricing, the BPS parameters of a given event depends on the
- * tier range that the billing period falls into. Each tier range is defined by an upper bound. For
- * example, after $1.5M of payment volume is reached, each individual payment may have a lower cap
- * or a smaller take-rate.
- *
- * ```json
- * ...
- * "model_type": "bulk_bps",
- * "bulk_bps_config": {
- * "tiers": [
- * {
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Tiered BPS pricing
- *
- * Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's applicable
- * parameter is a function of its marginal addition to the period total. Similar to tiered pricing,
- * the BPS parameters of a given event depends on the tier range that it falls into, where each tier
- * range is defined by an upper and lower bound. For example, the first few payments may have a 0.8
- * BPS take-rate and all payments after a specific volume may incur a take-rate of 0.5 BPS each.
- *
- * ```json
- * ...
- * "model_type": "tiered_bps",
- * "tiered_bps_config": {
- * "tiers": [
- * {
- * "minimum_amount": "0",
- * "maximum_amount": "1000000.00",
- * "bps": 125,
- * "per_unit_maximum": "19.00"
- * },
- * {
- * "minimum_amount": "1000000.00",
- * "maximum_amount": null,
- * "bps": 115,
- * "per_unit_maximum": "4.00"
- * }
- * ]
- * }
- * ...
- * }
- * ```
- *
- * ## Matrix pricing
- *
- * Matrix pricing defines a set of unit prices in a one or two-dimensional matrix. `dimensions`
- * defines the two event property values evaluated in this pricing model. In a one-dimensional
- * matrix, the second value is `null`. Every configuration has a list of `matrix_values` which give
- * the unit prices for specified property values. In a one-dimensional matrix, the matrix values
- * will have `dimension_values` where the second value of the pair is null. If an event does not
- * match any of the dimension values in the matrix, it will resort to the `default_unit_amount`.
- *
- * ```json
- * {
- * "model_type": "matrix"
- * "matrix_config": {
- * "default_unit_amount": "3.00",
- * "dimensions": [
- * "cluster_name",
- * "region"
- * ],
- * "matrix_values": [
- * {
- * "dimension_values": [
- * "alpha",
- * "west"
- * ],
- * "unit_amount": "2.00"
- * },
- * ...
- * ]
- * }
- * }
- * ```
- *
- * ## Fixed fees
- *
- * Fixed fees are prices that are applied independent of usage quantities, and follow unit pricing.
- * They also have an additional parameter `fixed_price_quantity`. If the Price represents a fixed
- * cost, this represents the quantity of units applied.
- *
- * ```json
- * {
- * ...
- * "id": "price_id",
- * "model_type": "unit",
- * "unit_config": {
- * "unit_amount": "2.00"
- * },
- * "fixed_price_quantity": 3.0
- * ...
- * }
- * ```
+ * For more on the types of prices, see
+ * [the core concepts documentation](/core-concepts#plan-and-price)
*/
@JsonDeserialize(using = Price.Deserializer::class)
@JsonSerialize(using = Price.Serializer::class)
@@ -283,7 +71,6 @@ private constructor(
private val matrixWithDisplayNamePrice: MatrixWithDisplayNamePrice? = null,
private val bulkWithProrationPrice: BulkWithProrationPrice? = null,
private val groupedTieredPackagePrice: GroupedTieredPackagePrice? = null,
- private val maxGroupTieredPrice: MaxGroupTieredPrice? = null,
private val _json: JsonValue? = null,
) {
@@ -349,9 +136,6 @@ private constructor(
fun groupedTieredPackagePrice(): Optional =
Optional.ofNullable(groupedTieredPackagePrice)
- fun maxGroupTieredPrice(): Optional =
- Optional.ofNullable(maxGroupTieredPrice)
-
fun isUnitPrice(): Boolean = unitPrice != null
fun isPackagePrice(): Boolean = packagePrice != null
@@ -400,8 +184,6 @@ private constructor(
fun isGroupedTieredPackagePrice(): Boolean = groupedTieredPackagePrice != null
- fun isMaxGroupTieredPrice(): Boolean = maxGroupTieredPrice != null
-
fun asUnitPrice(): UnitPrice = unitPrice.getOrThrow("unitPrice")
fun asPackagePrice(): PackagePrice = packagePrice.getOrThrow("packagePrice")
@@ -466,9 +248,6 @@ private constructor(
fun asGroupedTieredPackagePrice(): GroupedTieredPackagePrice =
groupedTieredPackagePrice.getOrThrow("groupedTieredPackagePrice")
- fun asMaxGroupTieredPrice(): MaxGroupTieredPrice =
- maxGroupTieredPrice.getOrThrow("maxGroupTieredPrice")
-
fun _json(): Optional = Optional.ofNullable(_json)
fun accept(visitor: Visitor): T {
@@ -510,7 +289,6 @@ private constructor(
visitor.visitBulkWithProrationPrice(bulkWithProrationPrice)
groupedTieredPackagePrice != null ->
visitor.visitGroupedTieredPackagePrice(groupedTieredPackagePrice)
- maxGroupTieredPrice != null -> visitor.visitMaxGroupTieredPrice(maxGroupTieredPrice)
else -> visitor.unknown(_json)
}
}
@@ -645,10 +423,6 @@ private constructor(
) {
groupedTieredPackagePrice.validate()
}
-
- override fun visitMaxGroupTieredPrice(maxGroupTieredPrice: MaxGroupTieredPrice) {
- maxGroupTieredPrice.validate()
- }
}
)
validated = true
@@ -659,10 +433,10 @@ private constructor(
return true
}
- return /* spotless:off */ other is Price && unitPrice == other.unitPrice && packagePrice == other.packagePrice && matrixPrice == other.matrixPrice && tieredPrice == other.tieredPrice && tieredBpsPrice == other.tieredBpsPrice && bpsPrice == other.bpsPrice && bulkBpsPrice == other.bulkBpsPrice && bulkPrice == other.bulkPrice && thresholdTotalAmountPrice == other.thresholdTotalAmountPrice && tieredPackagePrice == other.tieredPackagePrice && groupedTieredPrice == other.groupedTieredPrice && tieredWithMinimumPrice == other.tieredWithMinimumPrice && tieredPackageWithMinimumPrice == other.tieredPackageWithMinimumPrice && packageWithAllocationPrice == other.packageWithAllocationPrice && unitWithPercentPrice == other.unitWithPercentPrice && matrixWithAllocationPrice == other.matrixWithAllocationPrice && tieredWithProrationPrice == other.tieredWithProrationPrice && unitWithProrationPrice == other.unitWithProrationPrice && groupedAllocationPrice == other.groupedAllocationPrice && groupedWithProratedMinimumPrice == other.groupedWithProratedMinimumPrice && groupedWithMeteredMinimumPrice == other.groupedWithMeteredMinimumPrice && matrixWithDisplayNamePrice == other.matrixWithDisplayNamePrice && bulkWithProrationPrice == other.bulkWithProrationPrice && groupedTieredPackagePrice == other.groupedTieredPackagePrice && maxGroupTieredPrice == other.maxGroupTieredPrice /* spotless:on */
+ return /* spotless:off */ other is Price && unitPrice == other.unitPrice && packagePrice == other.packagePrice && matrixPrice == other.matrixPrice && tieredPrice == other.tieredPrice && tieredBpsPrice == other.tieredBpsPrice && bpsPrice == other.bpsPrice && bulkBpsPrice == other.bulkBpsPrice && bulkPrice == other.bulkPrice && thresholdTotalAmountPrice == other.thresholdTotalAmountPrice && tieredPackagePrice == other.tieredPackagePrice && groupedTieredPrice == other.groupedTieredPrice && tieredWithMinimumPrice == other.tieredWithMinimumPrice && tieredPackageWithMinimumPrice == other.tieredPackageWithMinimumPrice && packageWithAllocationPrice == other.packageWithAllocationPrice && unitWithPercentPrice == other.unitWithPercentPrice && matrixWithAllocationPrice == other.matrixWithAllocationPrice && tieredWithProrationPrice == other.tieredWithProrationPrice && unitWithProrationPrice == other.unitWithProrationPrice && groupedAllocationPrice == other.groupedAllocationPrice && groupedWithProratedMinimumPrice == other.groupedWithProratedMinimumPrice && groupedWithMeteredMinimumPrice == other.groupedWithMeteredMinimumPrice && matrixWithDisplayNamePrice == other.matrixWithDisplayNamePrice && bulkWithProrationPrice == other.bulkWithProrationPrice && groupedTieredPackagePrice == other.groupedTieredPackagePrice /* spotless:on */
}
- override fun hashCode(): Int = /* spotless:off */ Objects.hash(unitPrice, packagePrice, matrixPrice, tieredPrice, tieredBpsPrice, bpsPrice, bulkBpsPrice, bulkPrice, thresholdTotalAmountPrice, tieredPackagePrice, groupedTieredPrice, tieredWithMinimumPrice, tieredPackageWithMinimumPrice, packageWithAllocationPrice, unitWithPercentPrice, matrixWithAllocationPrice, tieredWithProrationPrice, unitWithProrationPrice, groupedAllocationPrice, groupedWithProratedMinimumPrice, groupedWithMeteredMinimumPrice, matrixWithDisplayNamePrice, bulkWithProrationPrice, groupedTieredPackagePrice, maxGroupTieredPrice) /* spotless:on */
+ override fun hashCode(): Int = /* spotless:off */ Objects.hash(unitPrice, packagePrice, matrixPrice, tieredPrice, tieredBpsPrice, bpsPrice, bulkBpsPrice, bulkPrice, thresholdTotalAmountPrice, tieredPackagePrice, groupedTieredPrice, tieredWithMinimumPrice, tieredPackageWithMinimumPrice, packageWithAllocationPrice, unitWithPercentPrice, matrixWithAllocationPrice, tieredWithProrationPrice, unitWithProrationPrice, groupedAllocationPrice, groupedWithProratedMinimumPrice, groupedWithMeteredMinimumPrice, matrixWithDisplayNamePrice, bulkWithProrationPrice, groupedTieredPackagePrice) /* spotless:on */
override fun toString(): String =
when {
@@ -703,7 +477,6 @@ private constructor(
"Price{bulkWithProrationPrice=$bulkWithProrationPrice}"
groupedTieredPackagePrice != null ->
"Price{groupedTieredPackagePrice=$groupedTieredPackagePrice}"
- maxGroupTieredPrice != null -> "Price{maxGroupTieredPrice=$maxGroupTieredPrice}"
_json != null -> "Price{_unknown=$_json}"
else -> throw IllegalStateException("Invalid Price")
}
@@ -796,10 +569,6 @@ private constructor(
@JvmStatic
fun ofGroupedTieredPackagePrice(groupedTieredPackagePrice: GroupedTieredPackagePrice) =
Price(groupedTieredPackagePrice = groupedTieredPackagePrice)
-
- @JvmStatic
- fun ofMaxGroupTieredPrice(maxGroupTieredPrice: MaxGroupTieredPrice) =
- Price(maxGroupTieredPrice = maxGroupTieredPrice)
}
interface Visitor {
@@ -862,8 +631,6 @@ private constructor(
fun visitGroupedTieredPackagePrice(groupedTieredPackagePrice: GroupedTieredPackagePrice): T
- fun visitMaxGroupTieredPrice(maxGroupTieredPrice: MaxGroupTieredPrice): T
-
fun unknown(json: JsonValue?): T {
throw OrbInvalidDataException("Unknown Price: $json")
}
@@ -1038,12 +805,6 @@ private constructor(
return Price(groupedTieredPackagePrice = it, _json = json)
}
}
- "max_group_tiered" -> {
- tryDeserialize(node, jacksonTypeRef()) { it.validate() }
- ?.let {
- return Price(maxGroupTieredPrice = it, _json = json)
- }
- }
}
return Price(_json = json)
@@ -1096,8 +857,6 @@ private constructor(
generator.writeObject(value.bulkWithProrationPrice)
value.groupedTieredPackagePrice != null ->
generator.writeObject(value.groupedTieredPackagePrice)
- value.maxGroupTieredPrice != null ->
- generator.writeObject(value.maxGroupTieredPrice)
value._json != null -> generator.writeObject(value._json)
else -> throw IllegalStateException("Invalid Price")
}
@@ -33640,2072 +33399,14 @@ private constructor(
keys.forEach(::removeAdditionalProperty)
}
- fun build(): Minimum =
- Minimum(
- checkRequired("appliesToPriceIds", appliesToPriceIds).map {
- it.toImmutable()
- },
- checkRequired("minimumAmount", minimumAmount),
- additionalProperties.toImmutable(),
- )
- }
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return /* spotless:off */ other is Minimum && appliesToPriceIds == other.appliesToPriceIds && minimumAmount == other.minimumAmount && additionalProperties == other.additionalProperties /* spotless:on */
- }
-
- /* spotless:off */
- private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, minimumAmount, additionalProperties) }
- /* spotless:on */
-
- override fun hashCode(): Int = hashCode
-
- override fun toString() =
- "Minimum{appliesToPriceIds=$appliesToPriceIds, minimumAmount=$minimumAmount, additionalProperties=$additionalProperties}"
- }
-
- class ModelType
- @JsonCreator
- private constructor(
- private val value: JsonField,
- ) : Enum {
-
- @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value
-
- companion object {
-
- @JvmField val MATRIX_WITH_ALLOCATION = of("matrix_with_allocation")
-
- @JvmStatic fun of(value: String) = ModelType(JsonField.of(value))
- }
-
- enum class Known {
- MATRIX_WITH_ALLOCATION,
- }
-
- enum class Value {
- MATRIX_WITH_ALLOCATION,
- _UNKNOWN,
- }
-
- fun value(): Value =
- when (this) {
- MATRIX_WITH_ALLOCATION -> Value.MATRIX_WITH_ALLOCATION
- else -> Value._UNKNOWN
- }
-
- fun known(): Known =
- when (this) {
- MATRIX_WITH_ALLOCATION -> Known.MATRIX_WITH_ALLOCATION
- else -> throw OrbInvalidDataException("Unknown ModelType: $value")
- }
-
- fun asString(): String = _value().asStringOrThrow()
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return /* spotless:off */ other is ModelType && value == other.value /* spotless:on */
- }
-
- override fun hashCode() = value.hashCode()
-
- override fun toString() = value.toString()
- }
-
- class PriceType
- @JsonCreator
- private constructor(
- private val value: JsonField,
- ) : Enum {
-
- @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value
-
- companion object {
-
- @JvmField val USAGE_PRICE = of("usage_price")
-
- @JvmField val FIXED_PRICE = of("fixed_price")
-
- @JvmStatic fun of(value: String) = PriceType(JsonField.of(value))
- }
-
- enum class Known {
- USAGE_PRICE,
- FIXED_PRICE,
- }
-
- enum class Value {
- USAGE_PRICE,
- FIXED_PRICE,
- _UNKNOWN,
- }
-
- fun value(): Value =
- when (this) {
- USAGE_PRICE -> Value.USAGE_PRICE
- FIXED_PRICE -> Value.FIXED_PRICE
- else -> Value._UNKNOWN
- }
-
- fun known(): Known =
- when (this) {
- USAGE_PRICE -> Known.USAGE_PRICE
- FIXED_PRICE -> Known.FIXED_PRICE
- else -> throw OrbInvalidDataException("Unknown PriceType: $value")
- }
-
- fun asString(): String = _value().asStringOrThrow()
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return /* spotless:off */ other is PriceType && value == other.value /* spotless:on */
- }
-
- override fun hashCode() = value.hashCode()
-
- override fun toString() = value.toString()
- }
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return /* spotless:off */ other is MatrixWithAllocationPrice && id == other.id && billableMetric == other.billableMetric && billingCycleConfiguration == other.billingCycleConfiguration && cadence == other.cadence && conversionRate == other.conversionRate && createdAt == other.createdAt && creditAllocation == other.creditAllocation && currency == other.currency && discount == other.discount && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoicingCycleConfiguration == other.invoicingCycleConfiguration && item == other.item && matrixWithAllocationConfig == other.matrixWithAllocationConfig && maximum == other.maximum && maximumAmount == other.maximumAmount && metadata == other.metadata && minimum == other.minimum && minimumAmount == other.minimumAmount && modelType == other.modelType && name == other.name && planPhaseOrder == other.planPhaseOrder && priceType == other.priceType && additionalProperties == other.additionalProperties /* spotless:on */
- }
-
- /* spotless:off */
- private val hashCode: Int by lazy { Objects.hash(id, billableMetric, billingCycleConfiguration, cadence, conversionRate, createdAt, creditAllocation, currency, discount, externalPriceId, fixedPriceQuantity, invoicingCycleConfiguration, item, matrixWithAllocationConfig, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, additionalProperties) }
- /* spotless:on */
-
- override fun hashCode(): Int = hashCode
-
- override fun toString() =
- "MatrixWithAllocationPrice{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, cadence=$cadence, conversionRate=$conversionRate, createdAt=$createdAt, creditAllocation=$creditAllocation, currency=$currency, discount=$discount, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoicingCycleConfiguration=$invoicingCycleConfiguration, item=$item, matrixWithAllocationConfig=$matrixWithAllocationConfig, maximum=$maximum, maximumAmount=$maximumAmount, metadata=$metadata, minimum=$minimum, minimumAmount=$minimumAmount, modelType=$modelType, name=$name, planPhaseOrder=$planPhaseOrder, priceType=$priceType, additionalProperties=$additionalProperties}"
- }
-
- @NoAutoDetect
- class TieredWithProrationPrice
- @JsonCreator
- private constructor(
- @JsonProperty("id") @ExcludeMissing private val id: JsonField = JsonMissing.of(),
- @JsonProperty("billable_metric")
- @ExcludeMissing
- private val billableMetric: JsonField = JsonMissing.of(),
- @JsonProperty("billing_cycle_configuration")
- @ExcludeMissing
- private val billingCycleConfiguration: JsonField =
- JsonMissing.of(),
- @JsonProperty("cadence")
- @ExcludeMissing
- private val cadence: JsonField = JsonMissing.of(),
- @JsonProperty("conversion_rate")
- @ExcludeMissing
- private val conversionRate: JsonField = JsonMissing.of(),
- @JsonProperty("created_at")
- @ExcludeMissing
- private val createdAt: JsonField = JsonMissing.of(),
- @JsonProperty("credit_allocation")
- @ExcludeMissing
- private val creditAllocation: JsonField = JsonMissing.of(),
- @JsonProperty("currency")
- @ExcludeMissing
- private val currency: JsonField = JsonMissing.of(),
- @JsonProperty("discount")
- @ExcludeMissing
- private val discount: JsonField = JsonMissing.of(),
- @JsonProperty("external_price_id")
- @ExcludeMissing
- private val externalPriceId: JsonField = JsonMissing.of(),
- @JsonProperty("fixed_price_quantity")
- @ExcludeMissing
- private val fixedPriceQuantity: JsonField = JsonMissing.of(),
- @JsonProperty("invoicing_cycle_configuration")
- @ExcludeMissing
- private val invoicingCycleConfiguration: JsonField =
- JsonMissing.of(),
- @JsonProperty("item") @ExcludeMissing private val item: JsonField- = JsonMissing.of(),
- @JsonProperty("maximum")
- @ExcludeMissing
- private val maximum: JsonField = JsonMissing.of(),
- @JsonProperty("maximum_amount")
- @ExcludeMissing
- private val maximumAmount: JsonField = JsonMissing.of(),
- @JsonProperty("metadata")
- @ExcludeMissing
- private val metadata: JsonField = JsonMissing.of(),
- @JsonProperty("minimum")
- @ExcludeMissing
- private val minimum: JsonField = JsonMissing.of(),
- @JsonProperty("minimum_amount")
- @ExcludeMissing
- private val minimumAmount: JsonField = JsonMissing.of(),
- @JsonProperty("model_type")
- @ExcludeMissing
- private val modelType: JsonField = JsonMissing.of(),
- @JsonProperty("name")
- @ExcludeMissing
- private val name: JsonField = JsonMissing.of(),
- @JsonProperty("plan_phase_order")
- @ExcludeMissing
- private val planPhaseOrder: JsonField = JsonMissing.of(),
- @JsonProperty("price_type")
- @ExcludeMissing
- private val priceType: JsonField = JsonMissing.of(),
- @JsonProperty("tiered_with_proration_config")
- @ExcludeMissing
- private val tieredWithProrationConfig: JsonField =
- JsonMissing.of(),
- @JsonAnySetter
- private val additionalProperties: Map = immutableEmptyMap(),
- ) {
-
- fun id(): String = id.getRequired("id")
-
- fun billableMetric(): Optional =
- Optional.ofNullable(billableMetric.getNullable("billable_metric"))
-
- fun billingCycleConfiguration(): BillingCycleConfiguration =
- billingCycleConfiguration.getRequired("billing_cycle_configuration")
-
- fun cadence(): Cadence = cadence.getRequired("cadence")
-
- fun conversionRate(): Optional =
- Optional.ofNullable(conversionRate.getNullable("conversion_rate"))
-
- fun createdAt(): OffsetDateTime = createdAt.getRequired("created_at")
-
- fun creditAllocation(): Optional =
- Optional.ofNullable(creditAllocation.getNullable("credit_allocation"))
-
- fun currency(): String = currency.getRequired("currency")
-
- fun discount(): Optional = Optional.ofNullable(discount.getNullable("discount"))
-
- fun externalPriceId(): Optional