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 @@ -[![Maven Central](https://img.shields.io/maven-central/v/com.withorb.api/orb-java)](https://central.sonatype.com/artifact/com.withorb.api/orb-java/0.22.0) +[![Maven Central](https://img.shields.io/maven-central/v/com.withorb.api/orb-java)](https://central.sonatype.com/artifact/com.withorb.api/orb-java/0.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 = - Optional.ofNullable(externalPriceId.getNullable("external_price_id")) - - fun fixedPriceQuantity(): Optional = - Optional.ofNullable(fixedPriceQuantity.getNullable("fixed_price_quantity")) - - fun invoicingCycleConfiguration(): Optional = - Optional.ofNullable( - invoicingCycleConfiguration.getNullable("invoicing_cycle_configuration") - ) - - fun item(): Item = item.getRequired("item") - - fun maximum(): Optional = Optional.ofNullable(maximum.getNullable("maximum")) - - fun maximumAmount(): Optional = - Optional.ofNullable(maximumAmount.getNullable("maximum_amount")) - - /** - * User specified key-value pairs for the resource. If not present, this defaults to an - * empty dictionary. 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.getRequired("metadata") - - fun minimum(): Optional = Optional.ofNullable(minimum.getNullable("minimum")) - - fun minimumAmount(): Optional = - Optional.ofNullable(minimumAmount.getNullable("minimum_amount")) - - fun modelType(): ModelType = modelType.getRequired("model_type") - - fun name(): String = name.getRequired("name") - - fun planPhaseOrder(): Optional = - Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) - - fun priceType(): PriceType = priceType.getRequired("price_type") - - fun tieredWithProrationConfig(): TieredWithProrationConfig = - tieredWithProrationConfig.getRequired("tiered_with_proration_config") - - @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id - - @JsonProperty("billable_metric") - @ExcludeMissing - fun _billableMetric(): JsonField = billableMetric - - @JsonProperty("billing_cycle_configuration") - @ExcludeMissing - fun _billingCycleConfiguration(): JsonField = - billingCycleConfiguration - - @JsonProperty("cadence") @ExcludeMissing fun _cadence(): JsonField = cadence - - @JsonProperty("conversion_rate") - @ExcludeMissing - fun _conversionRate(): JsonField = conversionRate - - @JsonProperty("created_at") - @ExcludeMissing - fun _createdAt(): JsonField = createdAt - - @JsonProperty("credit_allocation") - @ExcludeMissing - fun _creditAllocation(): JsonField = creditAllocation - - @JsonProperty("currency") @ExcludeMissing fun _currency(): JsonField = currency - - @JsonProperty("discount") @ExcludeMissing fun _discount(): JsonField = discount - - @JsonProperty("external_price_id") - @ExcludeMissing - fun _externalPriceId(): JsonField = externalPriceId - - @JsonProperty("fixed_price_quantity") - @ExcludeMissing - fun _fixedPriceQuantity(): JsonField = fixedPriceQuantity - - @JsonProperty("invoicing_cycle_configuration") - @ExcludeMissing - fun _invoicingCycleConfiguration(): JsonField = - invoicingCycleConfiguration - - @JsonProperty("item") @ExcludeMissing fun _item(): JsonField = item - - @JsonProperty("maximum") @ExcludeMissing fun _maximum(): JsonField = maximum - - @JsonProperty("maximum_amount") - @ExcludeMissing - fun _maximumAmount(): JsonField = maximumAmount - - /** - * User specified key-value pairs for the resource. If not present, this defaults to an - * empty dictionary. 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 - - @JsonProperty("minimum") @ExcludeMissing fun _minimum(): JsonField = minimum - - @JsonProperty("minimum_amount") - @ExcludeMissing - fun _minimumAmount(): JsonField = minimumAmount - - @JsonProperty("model_type") - @ExcludeMissing - fun _modelType(): JsonField = modelType - - @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name - - @JsonProperty("plan_phase_order") - @ExcludeMissing - fun _planPhaseOrder(): JsonField = planPhaseOrder - - @JsonProperty("price_type") - @ExcludeMissing - fun _priceType(): JsonField = priceType - - @JsonProperty("tiered_with_proration_config") - @ExcludeMissing - fun _tieredWithProrationConfig(): JsonField = - tieredWithProrationConfig - - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = additionalProperties - - private var validated: Boolean = false - - fun validate(): TieredWithProrationPrice = apply { - if (validated) { - return@apply - } - - id() - billableMetric().ifPresent { it.validate() } - billingCycleConfiguration().validate() - cadence() - conversionRate() - createdAt() - creditAllocation().ifPresent { it.validate() } - currency() - discount().ifPresent { it.validate() } - externalPriceId() - fixedPriceQuantity() - invoicingCycleConfiguration().ifPresent { it.validate() } - item().validate() - maximum().ifPresent { it.validate() } - maximumAmount() - metadata().validate() - minimum().ifPresent { it.validate() } - minimumAmount() - modelType() - name() - planPhaseOrder() - priceType() - tieredWithProrationConfig().validate() - validated = true - } - - fun toBuilder() = Builder().from(this) - - companion object { - - @JvmStatic fun builder() = Builder() - } - - class Builder { - - private var id: JsonField? = null - private var billableMetric: JsonField? = null - private var billingCycleConfiguration: JsonField? = null - private var cadence: JsonField? = null - private var conversionRate: JsonField? = null - private var createdAt: JsonField? = null - private var creditAllocation: JsonField? = null - private var currency: JsonField? = null - private var discount: JsonField? = null - private var externalPriceId: JsonField? = null - private var fixedPriceQuantity: JsonField? = null - private var invoicingCycleConfiguration: JsonField? = null - private var item: JsonField? = null - private var maximum: JsonField? = null - private var maximumAmount: JsonField? = null - private var metadata: JsonField? = null - private var minimum: JsonField? = null - private var minimumAmount: JsonField? = null - private var modelType: JsonField? = null - private var name: JsonField? = null - private var planPhaseOrder: JsonField? = null - private var priceType: JsonField? = null - private var tieredWithProrationConfig: JsonField? = null - private var additionalProperties: MutableMap = mutableMapOf() - - @JvmSynthetic - internal fun from(tieredWithProrationPrice: TieredWithProrationPrice) = apply { - id = tieredWithProrationPrice.id - billableMetric = tieredWithProrationPrice.billableMetric - billingCycleConfiguration = tieredWithProrationPrice.billingCycleConfiguration - cadence = tieredWithProrationPrice.cadence - conversionRate = tieredWithProrationPrice.conversionRate - createdAt = tieredWithProrationPrice.createdAt - creditAllocation = tieredWithProrationPrice.creditAllocation - currency = tieredWithProrationPrice.currency - discount = tieredWithProrationPrice.discount - externalPriceId = tieredWithProrationPrice.externalPriceId - fixedPriceQuantity = tieredWithProrationPrice.fixedPriceQuantity - invoicingCycleConfiguration = tieredWithProrationPrice.invoicingCycleConfiguration - item = tieredWithProrationPrice.item - maximum = tieredWithProrationPrice.maximum - maximumAmount = tieredWithProrationPrice.maximumAmount - metadata = tieredWithProrationPrice.metadata - minimum = tieredWithProrationPrice.minimum - minimumAmount = tieredWithProrationPrice.minimumAmount - modelType = tieredWithProrationPrice.modelType - name = tieredWithProrationPrice.name - planPhaseOrder = tieredWithProrationPrice.planPhaseOrder - priceType = tieredWithProrationPrice.priceType - tieredWithProrationConfig = tieredWithProrationPrice.tieredWithProrationConfig - additionalProperties = tieredWithProrationPrice.additionalProperties.toMutableMap() - } - - fun id(id: String) = id(JsonField.of(id)) - - fun id(id: JsonField) = apply { this.id = id } - - fun billableMetric(billableMetric: BillableMetric?) = - billableMetric(JsonField.ofNullable(billableMetric)) - - fun billableMetric(billableMetric: Optional) = - billableMetric(billableMetric.orElse(null)) - - fun billableMetric(billableMetric: JsonField) = apply { - this.billableMetric = billableMetric - } - - fun billingCycleConfiguration(billingCycleConfiguration: BillingCycleConfiguration) = - billingCycleConfiguration(JsonField.of(billingCycleConfiguration)) - - fun billingCycleConfiguration( - billingCycleConfiguration: JsonField - ) = apply { this.billingCycleConfiguration = billingCycleConfiguration } - - fun cadence(cadence: Cadence) = cadence(JsonField.of(cadence)) - - fun cadence(cadence: JsonField) = apply { this.cadence = cadence } - - fun conversionRate(conversionRate: Double?) = - conversionRate(JsonField.ofNullable(conversionRate)) - - fun conversionRate(conversionRate: Double) = conversionRate(conversionRate as Double?) - - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun conversionRate(conversionRate: Optional) = - conversionRate(conversionRate.orElse(null) as Double?) - - fun conversionRate(conversionRate: JsonField) = apply { - this.conversionRate = conversionRate - } - - fun createdAt(createdAt: OffsetDateTime) = createdAt(JsonField.of(createdAt)) - - fun createdAt(createdAt: JsonField) = apply { - this.createdAt = createdAt - } - - fun creditAllocation(creditAllocation: CreditAllocation?) = - creditAllocation(JsonField.ofNullable(creditAllocation)) - - fun creditAllocation(creditAllocation: Optional) = - creditAllocation(creditAllocation.orElse(null)) - - fun creditAllocation(creditAllocation: JsonField) = apply { - this.creditAllocation = creditAllocation - } - - fun currency(currency: String) = currency(JsonField.of(currency)) - - fun currency(currency: JsonField) = apply { this.currency = currency } - - fun discount(discount: Discount?) = discount(JsonField.ofNullable(discount)) - - fun discount(discount: Optional) = discount(discount.orElse(null)) - - fun discount(discount: JsonField) = apply { this.discount = discount } - - fun discount(percentageDiscount: PercentageDiscount) = - discount(Discount.ofPercentageDiscount(percentageDiscount)) - - fun discount(trialDiscount: TrialDiscount) = - discount(Discount.ofTrialDiscount(trialDiscount)) - - fun discount(usageDiscount: Discount.UsageDiscount) = - discount(Discount.ofUsageDiscount(usageDiscount)) - - fun discount(amountDiscount: AmountDiscount) = - discount(Discount.ofAmountDiscount(amountDiscount)) - - fun externalPriceId(externalPriceId: String?) = - externalPriceId(JsonField.ofNullable(externalPriceId)) - - fun externalPriceId(externalPriceId: Optional) = - externalPriceId(externalPriceId.orElse(null)) - - fun externalPriceId(externalPriceId: JsonField) = apply { - this.externalPriceId = externalPriceId - } - - fun fixedPriceQuantity(fixedPriceQuantity: Double?) = - fixedPriceQuantity(JsonField.ofNullable(fixedPriceQuantity)) - - fun fixedPriceQuantity(fixedPriceQuantity: Double) = - fixedPriceQuantity(fixedPriceQuantity as Double?) - - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun fixedPriceQuantity(fixedPriceQuantity: Optional) = - fixedPriceQuantity(fixedPriceQuantity.orElse(null) as Double?) - - fun fixedPriceQuantity(fixedPriceQuantity: JsonField) = apply { - this.fixedPriceQuantity = fixedPriceQuantity - } - - fun invoicingCycleConfiguration( - invoicingCycleConfiguration: InvoicingCycleConfiguration? - ) = invoicingCycleConfiguration(JsonField.ofNullable(invoicingCycleConfiguration)) - - fun invoicingCycleConfiguration( - invoicingCycleConfiguration: Optional - ) = invoicingCycleConfiguration(invoicingCycleConfiguration.orElse(null)) - - fun invoicingCycleConfiguration( - invoicingCycleConfiguration: JsonField - ) = apply { this.invoicingCycleConfiguration = invoicingCycleConfiguration } - - fun item(item: Item) = item(JsonField.of(item)) - - fun item(item: JsonField) = apply { this.item = item } - - fun maximum(maximum: Maximum?) = maximum(JsonField.ofNullable(maximum)) - - fun maximum(maximum: Optional) = maximum(maximum.orElse(null)) - - fun maximum(maximum: JsonField) = apply { this.maximum = maximum } - - fun maximumAmount(maximumAmount: String?) = - maximumAmount(JsonField.ofNullable(maximumAmount)) - - fun maximumAmount(maximumAmount: Optional) = - maximumAmount(maximumAmount.orElse(null)) - - fun maximumAmount(maximumAmount: JsonField) = apply { - this.maximumAmount = maximumAmount - } - - /** - * User specified key-value pairs for the resource. If not present, this defaults to an - * empty dictionary. 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.of(metadata)) - - /** - * User specified key-value pairs for the resource. If not present, this defaults to an - * empty dictionary. 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 minimum(minimum: Minimum?) = minimum(JsonField.ofNullable(minimum)) - - fun minimum(minimum: Optional) = minimum(minimum.orElse(null)) - - fun minimum(minimum: JsonField) = apply { this.minimum = minimum } - - fun minimumAmount(minimumAmount: String?) = - minimumAmount(JsonField.ofNullable(minimumAmount)) - - fun minimumAmount(minimumAmount: Optional) = - minimumAmount(minimumAmount.orElse(null)) - - fun minimumAmount(minimumAmount: JsonField) = apply { - this.minimumAmount = minimumAmount - } - - fun modelType(modelType: ModelType) = modelType(JsonField.of(modelType)) - - fun modelType(modelType: JsonField) = apply { this.modelType = modelType } - - fun name(name: String) = name(JsonField.of(name)) - - fun name(name: JsonField) = apply { this.name = name } - - fun planPhaseOrder(planPhaseOrder: Long?) = - planPhaseOrder(JsonField.ofNullable(planPhaseOrder)) - - fun planPhaseOrder(planPhaseOrder: Long) = planPhaseOrder(planPhaseOrder as Long?) - - @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 - fun planPhaseOrder(planPhaseOrder: Optional) = - planPhaseOrder(planPhaseOrder.orElse(null) as Long?) - - fun planPhaseOrder(planPhaseOrder: JsonField) = apply { - this.planPhaseOrder = planPhaseOrder - } - - fun priceType(priceType: PriceType) = priceType(JsonField.of(priceType)) - - fun priceType(priceType: JsonField) = apply { this.priceType = priceType } - - fun tieredWithProrationConfig(tieredWithProrationConfig: TieredWithProrationConfig) = - tieredWithProrationConfig(JsonField.of(tieredWithProrationConfig)) - - fun tieredWithProrationConfig( - tieredWithProrationConfig: JsonField - ) = apply { this.tieredWithProrationConfig = tieredWithProrationConfig } - - 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(): TieredWithProrationPrice = - TieredWithProrationPrice( - checkRequired("id", id), - checkRequired("billableMetric", billableMetric), - checkRequired("billingCycleConfiguration", billingCycleConfiguration), - checkRequired("cadence", cadence), - checkRequired("conversionRate", conversionRate), - checkRequired("createdAt", createdAt), - checkRequired("creditAllocation", creditAllocation), - checkRequired("currency", currency), - checkRequired("discount", discount), - checkRequired("externalPriceId", externalPriceId), - checkRequired("fixedPriceQuantity", fixedPriceQuantity), - checkRequired("invoicingCycleConfiguration", invoicingCycleConfiguration), - checkRequired("item", item), - checkRequired("maximum", maximum), - checkRequired("maximumAmount", maximumAmount), - checkRequired("metadata", metadata), - checkRequired("minimum", minimum), - checkRequired("minimumAmount", minimumAmount), - checkRequired("modelType", modelType), - checkRequired("name", name), - checkRequired("planPhaseOrder", planPhaseOrder), - checkRequired("priceType", priceType), - checkRequired("tieredWithProrationConfig", tieredWithProrationConfig), - additionalProperties.toImmutable(), - ) - } - - @NoAutoDetect - class BillableMetric - @JsonCreator - private constructor( - @JsonProperty("id") - @ExcludeMissing - private val id: JsonField = JsonMissing.of(), - @JsonAnySetter - private val additionalProperties: Map = immutableEmptyMap(), - ) { - - fun id(): String = id.getRequired("id") - - @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id - - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = additionalProperties - - private var validated: Boolean = false - - fun validate(): BillableMetric = apply { - if (validated) { - return@apply - } - - id() - validated = true - } - - fun toBuilder() = Builder().from(this) - - companion object { - - @JvmStatic fun builder() = Builder() - } - - class Builder { - - private var id: JsonField? = null - private var additionalProperties: MutableMap = mutableMapOf() - - @JvmSynthetic - internal fun from(billableMetric: BillableMetric) = apply { - id = billableMetric.id - additionalProperties = billableMetric.additionalProperties.toMutableMap() - } - - fun id(id: String) = id(JsonField.of(id)) - - fun id(id: JsonField) = apply { this.id = id } - - fun additionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.clear() - putAllAdditionalProperties(additionalProperties) - } - - fun putAdditionalProperty(key: String, value: JsonValue) = apply { - additionalProperties.put(key, value) - } - - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { - this.additionalProperties.putAll(additionalProperties) - } - - fun removeAdditionalProperty(key: String) = apply { - additionalProperties.remove(key) - } - - fun removeAllAdditionalProperties(keys: Set) = apply { - keys.forEach(::removeAdditionalProperty) - } - - fun build(): BillableMetric = - BillableMetric(checkRequired("id", id), additionalProperties.toImmutable()) - } - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is BillableMetric && id == other.id && additionalProperties == other.additionalProperties /* spotless:on */ - } - - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, additionalProperties) } - /* spotless:on */ - - override fun hashCode(): Int = hashCode - - override fun toString() = - "BillableMetric{id=$id, additionalProperties=$additionalProperties}" - } - - @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(), - ) { - - fun duration(): Long = duration.getRequired("duration") - - fun durationUnit(): DurationUnit = durationUnit.getRequired("duration_unit") - - @JsonProperty("duration") @ExcludeMissing fun _duration(): JsonField = 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() - } - - fun duration(duration: Long) = duration(JsonField.of(duration)) - - fun duration(duration: JsonField) = apply { this.duration = duration } - - fun durationUnit(durationUnit: DurationUnit) = - durationUnit(JsonField.of(durationUnit)) - - 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}" - } - - class Cadence - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { - - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - - companion object { - - @JvmField val ONE_TIME = of("one_time") - - @JvmField val MONTHLY = of("monthly") - - @JvmField val QUARTERLY = of("quarterly") - - @JvmField val SEMI_ANNUAL = of("semi_annual") - - @JvmField val ANNUAL = of("annual") - - @JvmField val CUSTOM = of("custom") - - @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) - } - - enum class Known { - ONE_TIME, - MONTHLY, - QUARTERLY, - SEMI_ANNUAL, - ANNUAL, - CUSTOM, - } - - enum class Value { - ONE_TIME, - MONTHLY, - QUARTERLY, - SEMI_ANNUAL, - ANNUAL, - CUSTOM, - _UNKNOWN, - } - - fun value(): Value = - when (this) { - ONE_TIME -> Value.ONE_TIME - MONTHLY -> Value.MONTHLY - QUARTERLY -> Value.QUARTERLY - SEMI_ANNUAL -> Value.SEMI_ANNUAL - ANNUAL -> Value.ANNUAL - CUSTOM -> Value.CUSTOM - else -> Value._UNKNOWN - } - - fun known(): Known = - when (this) { - ONE_TIME -> Known.ONE_TIME - MONTHLY -> Known.MONTHLY - QUARTERLY -> Known.QUARTERLY - SEMI_ANNUAL -> Known.SEMI_ANNUAL - ANNUAL -> Known.ANNUAL - 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 CreditAllocation - @JsonCreator - private constructor( - @JsonProperty("allows_rollover") - @ExcludeMissing - private val allowsRollover: JsonField = JsonMissing.of(), - @JsonProperty("currency") - @ExcludeMissing - private val currency: JsonField = JsonMissing.of(), - @JsonAnySetter - private val additionalProperties: Map = immutableEmptyMap(), - ) { - - fun allowsRollover(): Boolean = allowsRollover.getRequired("allows_rollover") - - fun currency(): String = currency.getRequired("currency") - - @JsonProperty("allows_rollover") - @ExcludeMissing - fun _allowsRollover(): JsonField = allowsRollover - - @JsonProperty("currency") @ExcludeMissing fun _currency(): JsonField = currency - - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = additionalProperties - - private var validated: Boolean = false - - fun validate(): CreditAllocation = apply { - if (validated) { - return@apply - } - - allowsRollover() - currency() - validated = true - } - - fun toBuilder() = Builder().from(this) - - companion object { - - @JvmStatic fun builder() = Builder() - } - - class Builder { - - private var allowsRollover: JsonField? = null - private var currency: JsonField? = null - private var additionalProperties: MutableMap = mutableMapOf() - - @JvmSynthetic - internal fun from(creditAllocation: CreditAllocation) = apply { - allowsRollover = creditAllocation.allowsRollover - currency = creditAllocation.currency - additionalProperties = creditAllocation.additionalProperties.toMutableMap() - } - - fun allowsRollover(allowsRollover: Boolean) = - allowsRollover(JsonField.of(allowsRollover)) - - fun allowsRollover(allowsRollover: JsonField) = apply { - this.allowsRollover = allowsRollover - } - - fun currency(currency: String) = currency(JsonField.of(currency)) - - fun currency(currency: JsonField) = apply { this.currency = currency } - - 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(): CreditAllocation = - CreditAllocation( - checkRequired("allowsRollover", allowsRollover), - checkRequired("currency", currency), - additionalProperties.toImmutable(), - ) - } - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is CreditAllocation && allowsRollover == other.allowsRollover && currency == other.currency && additionalProperties == other.additionalProperties /* spotless:on */ - } - - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(allowsRollover, currency, additionalProperties) } - /* spotless:on */ - - override fun hashCode(): Int = hashCode - - override fun toString() = - "CreditAllocation{allowsRollover=$allowsRollover, currency=$currency, additionalProperties=$additionalProperties}" - } - - @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(), - ) { - - fun duration(): Long = duration.getRequired("duration") - - fun durationUnit(): DurationUnit = durationUnit.getRequired("duration_unit") - - @JsonProperty("duration") @ExcludeMissing fun _duration(): JsonField = 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() - } - - fun duration(duration: Long) = duration(JsonField.of(duration)) - - fun duration(duration: JsonField) = apply { this.duration = duration } - - fun durationUnit(durationUnit: DurationUnit) = - durationUnit(JsonField.of(durationUnit)) - - 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}" - } - - @NoAutoDetect - class Item - @JsonCreator - private constructor( - @JsonProperty("id") - @ExcludeMissing - private val id: JsonField = JsonMissing.of(), - @JsonProperty("name") - @ExcludeMissing - private val name: JsonField = JsonMissing.of(), - @JsonAnySetter - private val additionalProperties: Map = immutableEmptyMap(), - ) { - - fun id(): String = id.getRequired("id") - - fun name(): String = name.getRequired("name") - - @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id - - @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name - - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = additionalProperties - - private var validated: Boolean = false - - fun validate(): Item = apply { - if (validated) { - return@apply - } - - id() - name() - validated = true - } - - fun toBuilder() = Builder().from(this) - - companion object { - - @JvmStatic fun builder() = Builder() - } - - class Builder { - - private var id: JsonField? = null - private var name: JsonField? = null - private var additionalProperties: MutableMap = mutableMapOf() - - @JvmSynthetic - internal fun from(item: Item) = apply { - id = item.id - name = item.name - additionalProperties = item.additionalProperties.toMutableMap() - } - - fun id(id: String) = id(JsonField.of(id)) - - fun id(id: JsonField) = apply { this.id = id } - - fun name(name: String) = name(JsonField.of(name)) - - fun name(name: JsonField) = apply { this.name = name } - - 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(): Item = - Item( - checkRequired("id", id), - checkRequired("name", name), - additionalProperties.toImmutable(), - ) - } - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is Item && id == other.id && name == other.name && additionalProperties == other.additionalProperties /* spotless:on */ - } - - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, name, additionalProperties) } - /* spotless:on */ - - override fun hashCode(): Int = hashCode - - override fun toString() = - "Item{id=$id, name=$name, additionalProperties=$additionalProperties}" - } - - @NoAutoDetect - class Maximum - @JsonCreator - private constructor( - @JsonProperty("applies_to_price_ids") - @ExcludeMissing - private val appliesToPriceIds: JsonField> = JsonMissing.of(), - @JsonProperty("maximum_amount") - @ExcludeMissing - private val maximumAmount: JsonField = JsonMissing.of(), - @JsonAnySetter - private val additionalProperties: Map = immutableEmptyMap(), - ) { - - /** - * List of price_ids that this maximum amount applies to. For plan/plan phase maximums, - * this can be a subset of prices. - */ - fun appliesToPriceIds(): List = - appliesToPriceIds.getRequired("applies_to_price_ids") - - /** Maximum amount applied */ - fun maximumAmount(): String = maximumAmount.getRequired("maximum_amount") - - /** - * List of price_ids that this maximum amount applies to. For plan/plan phase maximums, - * this can be a subset of prices. - */ - @JsonProperty("applies_to_price_ids") - @ExcludeMissing - fun _appliesToPriceIds(): JsonField> = appliesToPriceIds - - /** Maximum amount applied */ - @JsonProperty("maximum_amount") - @ExcludeMissing - fun _maximumAmount(): JsonField = maximumAmount - - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = additionalProperties - - private var validated: Boolean = false - - fun validate(): Maximum = apply { - if (validated) { - return@apply - } - - appliesToPriceIds() - maximumAmount() - validated = true - } - - fun toBuilder() = Builder().from(this) - - companion object { - - @JvmStatic fun builder() = Builder() - } - - class Builder { - - private var appliesToPriceIds: JsonField>? = null - private var maximumAmount: JsonField? = null - private var additionalProperties: MutableMap = mutableMapOf() - - @JvmSynthetic - internal fun from(maximum: Maximum) = apply { - appliesToPriceIds = maximum.appliesToPriceIds.map { it.toMutableList() } - maximumAmount = maximum.maximumAmount - additionalProperties = maximum.additionalProperties.toMutableMap() - } - - /** - * List of price_ids that this maximum amount applies to. For plan/plan phase - * maximums, this can be a subset of prices. - */ - fun appliesToPriceIds(appliesToPriceIds: List) = - appliesToPriceIds(JsonField.of(appliesToPriceIds)) - - /** - * List of price_ids that this maximum amount applies to. For plan/plan phase - * maximums, this can be a subset of prices. - */ - fun appliesToPriceIds(appliesToPriceIds: JsonField>) = apply { - this.appliesToPriceIds = appliesToPriceIds.map { it.toMutableList() } - } - - /** - * List of price_ids that this maximum amount applies to. For plan/plan phase - * maximums, this can be a subset of prices. - */ - fun addAppliesToPriceId(appliesToPriceId: String) = apply { - appliesToPriceIds = - (appliesToPriceIds ?: JsonField.of(mutableListOf())).apply { - asKnown() - .orElseThrow { - IllegalStateException( - "Field was set to non-list type: ${javaClass.simpleName}" - ) - } - .add(appliesToPriceId) - } - } - - /** Maximum amount applied */ - fun maximumAmount(maximumAmount: String) = - maximumAmount(JsonField.of(maximumAmount)) - - /** Maximum amount applied */ - fun maximumAmount(maximumAmount: JsonField) = apply { - this.maximumAmount = maximumAmount - } - - 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(): Maximum = - Maximum( - checkRequired("appliesToPriceIds", appliesToPriceIds).map { - it.toImmutable() - }, - checkRequired("maximumAmount", maximumAmount), - additionalProperties.toImmutable(), - ) - } - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is Maximum && appliesToPriceIds == other.appliesToPriceIds && maximumAmount == other.maximumAmount && additionalProperties == other.additionalProperties /* spotless:on */ - } - - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, maximumAmount, additionalProperties) } - /* spotless:on */ - - override fun hashCode(): Int = hashCode - - override fun toString() = - "Maximum{appliesToPriceIds=$appliesToPriceIds, maximumAmount=$maximumAmount, additionalProperties=$additionalProperties}" - } - - /** - * User specified key-value pairs for the resource. If not present, this defaults to an - * empty dictionary. 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}" - } - - @NoAutoDetect - class Minimum - @JsonCreator - private constructor( - @JsonProperty("applies_to_price_ids") - @ExcludeMissing - private val appliesToPriceIds: JsonField> = JsonMissing.of(), - @JsonProperty("minimum_amount") - @ExcludeMissing - private val minimumAmount: JsonField = JsonMissing.of(), - @JsonAnySetter - private val additionalProperties: Map = immutableEmptyMap(), - ) { - - /** - * List of price_ids that this minimum amount applies to. For plan/plan phase minimums, - * this can be a subset of prices. - */ - fun appliesToPriceIds(): List = - appliesToPriceIds.getRequired("applies_to_price_ids") - - /** Minimum amount applied */ - fun minimumAmount(): String = minimumAmount.getRequired("minimum_amount") - - /** - * List of price_ids that this minimum amount applies to. For plan/plan phase minimums, - * this can be a subset of prices. - */ - @JsonProperty("applies_to_price_ids") - @ExcludeMissing - fun _appliesToPriceIds(): JsonField> = appliesToPriceIds - - /** Minimum amount applied */ - @JsonProperty("minimum_amount") - @ExcludeMissing - fun _minimumAmount(): JsonField = minimumAmount - - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = additionalProperties - - private var validated: Boolean = false - - fun validate(): Minimum = apply { - if (validated) { - return@apply - } - - appliesToPriceIds() - minimumAmount() - validated = true - } - - fun toBuilder() = Builder().from(this) - - companion object { - - @JvmStatic fun builder() = Builder() - } - - class Builder { - - private var appliesToPriceIds: JsonField>? = null - private var minimumAmount: JsonField? = null - private var additionalProperties: MutableMap = mutableMapOf() - - @JvmSynthetic - internal fun from(minimum: Minimum) = apply { - appliesToPriceIds = minimum.appliesToPriceIds.map { it.toMutableList() } - minimumAmount = minimum.minimumAmount - additionalProperties = minimum.additionalProperties.toMutableMap() - } - - /** - * List of price_ids that this minimum amount applies to. For plan/plan phase - * minimums, this can be a subset of prices. - */ - fun appliesToPriceIds(appliesToPriceIds: List) = - appliesToPriceIds(JsonField.of(appliesToPriceIds)) - - /** - * List of price_ids that this minimum amount applies to. For plan/plan phase - * minimums, this can be a subset of prices. - */ - fun appliesToPriceIds(appliesToPriceIds: JsonField>) = apply { - this.appliesToPriceIds = appliesToPriceIds.map { it.toMutableList() } - } - - /** - * List of price_ids that this minimum amount applies to. For plan/plan phase - * minimums, this can be a subset of prices. - */ - fun addAppliesToPriceId(appliesToPriceId: String) = apply { - appliesToPriceIds = - (appliesToPriceIds ?: JsonField.of(mutableListOf())).apply { - asKnown() - .orElseThrow { - IllegalStateException( - "Field was set to non-list type: ${javaClass.simpleName}" - ) - } - .add(appliesToPriceId) - } - } - - /** Minimum amount applied */ - fun minimumAmount(minimumAmount: String) = - minimumAmount(JsonField.of(minimumAmount)) - - /** Minimum amount applied */ - fun minimumAmount(minimumAmount: JsonField) = apply { - this.minimumAmount = minimumAmount - } - - 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(): 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 TIERED_WITH_PRORATION = of("tiered_with_proration") - - @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) - } - - enum class Known { - TIERED_WITH_PRORATION, - } - - enum class Value { - TIERED_WITH_PRORATION, - _UNKNOWN, - } - - fun value(): Value = - when (this) { - TIERED_WITH_PRORATION -> Value.TIERED_WITH_PRORATION - else -> Value._UNKNOWN - } - - fun known(): Known = - when (this) { - TIERED_WITH_PRORATION -> Known.TIERED_WITH_PRORATION - 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() - } - - @NoAutoDetect - class TieredWithProrationConfig - @JsonCreator - private constructor( - @JsonAnySetter - private val additionalProperties: Map = immutableEmptyMap(), - ) { - - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = additionalProperties - - private var validated: Boolean = false - - fun validate(): TieredWithProrationConfig = 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(tieredWithProrationConfig: TieredWithProrationConfig) = apply { - additionalProperties = - tieredWithProrationConfig.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(): TieredWithProrationConfig = - TieredWithProrationConfig(additionalProperties.toImmutable()) + fun build(): Minimum = + Minimum( + checkRequired("appliesToPriceIds", appliesToPriceIds).map { + it.toImmutable() + }, + checkRequired("minimumAmount", minimumAmount), + additionalProperties.toImmutable(), + ) } override fun equals(other: Any?): Boolean { @@ -35713,17 +33414,125 @@ private constructor( return true } - return /* spotless:off */ other is TieredWithProrationConfig && additionalProperties == other.additionalProperties /* spotless:on */ + 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(additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, minimumAmount, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "TieredWithProrationConfig{additionalProperties=$additionalProperties}" + "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 { @@ -35731,21 +33540,21 @@ private constructor( return true } - return /* spotless:off */ other is TieredWithProrationPrice && 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 && 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 && tieredWithProrationConfig == other.tieredWithProrationConfig && additionalProperties == other.additionalProperties /* spotless:on */ + 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, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, tieredWithProrationConfig, additionalProperties) } + 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() = - "TieredWithProrationPrice{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, maximum=$maximum, maximumAmount=$maximumAmount, metadata=$metadata, minimum=$minimum, minimumAmount=$minimumAmount, modelType=$modelType, name=$name, planPhaseOrder=$planPhaseOrder, priceType=$priceType, tieredWithProrationConfig=$tieredWithProrationConfig, additionalProperties=$additionalProperties}" + "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 UnitWithProrationPrice + class TieredWithProrationPrice @JsonCreator private constructor( @JsonProperty("id") @ExcludeMissing private val id: JsonField = JsonMissing.of(), @@ -35812,9 +33621,10 @@ private constructor( @JsonProperty("price_type") @ExcludeMissing private val priceType: JsonField = JsonMissing.of(), - @JsonProperty("unit_with_proration_config") + @JsonProperty("tiered_with_proration_config") @ExcludeMissing - private val unitWithProrationConfig: JsonField = JsonMissing.of(), + private val tieredWithProrationConfig: JsonField = + JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { @@ -35880,8 +33690,8 @@ private constructor( fun priceType(): PriceType = priceType.getRequired("price_type") - fun unitWithProrationConfig(): UnitWithProrationConfig = - unitWithProrationConfig.getRequired("unit_with_proration_config") + fun tieredWithProrationConfig(): TieredWithProrationConfig = + tieredWithProrationConfig.getRequired("tiered_with_proration_config") @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id @@ -35960,9 +33770,10 @@ private constructor( @ExcludeMissing fun _priceType(): JsonField = priceType - @JsonProperty("unit_with_proration_config") + @JsonProperty("tiered_with_proration_config") @ExcludeMissing - fun _unitWithProrationConfig(): JsonField = unitWithProrationConfig + fun _tieredWithProrationConfig(): JsonField = + tieredWithProrationConfig @JsonAnyGetter @ExcludeMissing @@ -35970,7 +33781,7 @@ private constructor( private var validated: Boolean = false - fun validate(): UnitWithProrationPrice = apply { + fun validate(): TieredWithProrationPrice = apply { if (validated) { return@apply } @@ -35997,7 +33808,7 @@ private constructor( name() planPhaseOrder() priceType() - unitWithProrationConfig().validate() + tieredWithProrationConfig().validate() validated = true } @@ -36032,35 +33843,35 @@ private constructor( private var name: JsonField? = null private var planPhaseOrder: JsonField? = null private var priceType: JsonField? = null - private var unitWithProrationConfig: JsonField? = null + private var tieredWithProrationConfig: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(unitWithProrationPrice: UnitWithProrationPrice) = apply { - id = unitWithProrationPrice.id - billableMetric = unitWithProrationPrice.billableMetric - billingCycleConfiguration = unitWithProrationPrice.billingCycleConfiguration - cadence = unitWithProrationPrice.cadence - conversionRate = unitWithProrationPrice.conversionRate - createdAt = unitWithProrationPrice.createdAt - creditAllocation = unitWithProrationPrice.creditAllocation - currency = unitWithProrationPrice.currency - discount = unitWithProrationPrice.discount - externalPriceId = unitWithProrationPrice.externalPriceId - fixedPriceQuantity = unitWithProrationPrice.fixedPriceQuantity - invoicingCycleConfiguration = unitWithProrationPrice.invoicingCycleConfiguration - item = unitWithProrationPrice.item - maximum = unitWithProrationPrice.maximum - maximumAmount = unitWithProrationPrice.maximumAmount - metadata = unitWithProrationPrice.metadata - minimum = unitWithProrationPrice.minimum - minimumAmount = unitWithProrationPrice.minimumAmount - modelType = unitWithProrationPrice.modelType - name = unitWithProrationPrice.name - planPhaseOrder = unitWithProrationPrice.planPhaseOrder - priceType = unitWithProrationPrice.priceType - unitWithProrationConfig = unitWithProrationPrice.unitWithProrationConfig - additionalProperties = unitWithProrationPrice.additionalProperties.toMutableMap() + internal fun from(tieredWithProrationPrice: TieredWithProrationPrice) = apply { + id = tieredWithProrationPrice.id + billableMetric = tieredWithProrationPrice.billableMetric + billingCycleConfiguration = tieredWithProrationPrice.billingCycleConfiguration + cadence = tieredWithProrationPrice.cadence + conversionRate = tieredWithProrationPrice.conversionRate + createdAt = tieredWithProrationPrice.createdAt + creditAllocation = tieredWithProrationPrice.creditAllocation + currency = tieredWithProrationPrice.currency + discount = tieredWithProrationPrice.discount + externalPriceId = tieredWithProrationPrice.externalPriceId + fixedPriceQuantity = tieredWithProrationPrice.fixedPriceQuantity + invoicingCycleConfiguration = tieredWithProrationPrice.invoicingCycleConfiguration + item = tieredWithProrationPrice.item + maximum = tieredWithProrationPrice.maximum + maximumAmount = tieredWithProrationPrice.maximumAmount + metadata = tieredWithProrationPrice.metadata + minimum = tieredWithProrationPrice.minimum + minimumAmount = tieredWithProrationPrice.minimumAmount + modelType = tieredWithProrationPrice.modelType + name = tieredWithProrationPrice.name + planPhaseOrder = tieredWithProrationPrice.planPhaseOrder + priceType = tieredWithProrationPrice.priceType + tieredWithProrationConfig = tieredWithProrationPrice.tieredWithProrationConfig + additionalProperties = tieredWithProrationPrice.additionalProperties.toMutableMap() } fun id(id: String) = id(JsonField.of(id)) @@ -36250,12 +34061,12 @@ private constructor( fun priceType(priceType: JsonField) = apply { this.priceType = priceType } - fun unitWithProrationConfig(unitWithProrationConfig: UnitWithProrationConfig) = - unitWithProrationConfig(JsonField.of(unitWithProrationConfig)) + fun tieredWithProrationConfig(tieredWithProrationConfig: TieredWithProrationConfig) = + tieredWithProrationConfig(JsonField.of(tieredWithProrationConfig)) - fun unitWithProrationConfig( - unitWithProrationConfig: JsonField - ) = apply { this.unitWithProrationConfig = unitWithProrationConfig } + fun tieredWithProrationConfig( + tieredWithProrationConfig: JsonField + ) = apply { this.tieredWithProrationConfig = tieredWithProrationConfig } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -36276,8 +34087,8 @@ private constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): UnitWithProrationPrice = - UnitWithProrationPrice( + fun build(): TieredWithProrationPrice = + TieredWithProrationPrice( checkRequired("id", id), checkRequired("billableMetric", billableMetric), checkRequired("billingCycleConfiguration", billingCycleConfiguration), @@ -36300,7 +34111,7 @@ private constructor( checkRequired("name", name), checkRequired("planPhaseOrder", planPhaseOrder), checkRequired("priceType", priceType), - checkRequired("unitWithProrationConfig", unitWithProrationConfig), + checkRequired("tieredWithProrationConfig", tieredWithProrationConfig), additionalProperties.toImmutable(), ) } @@ -37493,29 +35304,29 @@ private constructor( companion object { - @JvmField val UNIT_WITH_PRORATION = of("unit_with_proration") + @JvmField val TIERED_WITH_PRORATION = of("tiered_with_proration") @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } enum class Known { - UNIT_WITH_PRORATION, + TIERED_WITH_PRORATION, } enum class Value { - UNIT_WITH_PRORATION, + TIERED_WITH_PRORATION, _UNKNOWN, } fun value(): Value = when (this) { - UNIT_WITH_PRORATION -> Value.UNIT_WITH_PRORATION + TIERED_WITH_PRORATION -> Value.TIERED_WITH_PRORATION else -> Value._UNKNOWN } fun known(): Known = when (this) { - UNIT_WITH_PRORATION -> Known.UNIT_WITH_PRORATION + TIERED_WITH_PRORATION -> Known.TIERED_WITH_PRORATION else -> throw OrbInvalidDataException("Unknown ModelType: $value") } @@ -37592,7 +35403,7 @@ private constructor( } @NoAutoDetect - class UnitWithProrationConfig + class TieredWithProrationConfig @JsonCreator private constructor( @JsonAnySetter @@ -37605,7 +35416,7 @@ private constructor( private var validated: Boolean = false - fun validate(): UnitWithProrationConfig = apply { + fun validate(): TieredWithProrationConfig = apply { if (validated) { return@apply } @@ -37625,9 +35436,9 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(unitWithProrationConfig: UnitWithProrationConfig) = apply { + internal fun from(tieredWithProrationConfig: TieredWithProrationConfig) = apply { additionalProperties = - unitWithProrationConfig.additionalProperties.toMutableMap() + tieredWithProrationConfig.additionalProperties.toMutableMap() } fun additionalProperties(additionalProperties: Map) = apply { @@ -37652,8 +35463,8 @@ private constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): UnitWithProrationConfig = - UnitWithProrationConfig(additionalProperties.toImmutable()) + fun build(): TieredWithProrationConfig = + TieredWithProrationConfig(additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { @@ -37661,7 +35472,7 @@ private constructor( return true } - return /* spotless:off */ other is UnitWithProrationConfig && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is TieredWithProrationConfig && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ @@ -37671,7 +35482,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "UnitWithProrationConfig{additionalProperties=$additionalProperties}" + "TieredWithProrationConfig{additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { @@ -37679,21 +35490,21 @@ private constructor( return true } - return /* spotless:off */ other is UnitWithProrationPrice && 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 && 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 && unitWithProrationConfig == other.unitWithProrationConfig && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is TieredWithProrationPrice && 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 && 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 && tieredWithProrationConfig == other.tieredWithProrationConfig && 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, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, unitWithProrationConfig, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, billableMetric, billingCycleConfiguration, cadence, conversionRate, createdAt, creditAllocation, currency, discount, externalPriceId, fixedPriceQuantity, invoicingCycleConfiguration, item, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, tieredWithProrationConfig, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "UnitWithProrationPrice{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, maximum=$maximum, maximumAmount=$maximumAmount, metadata=$metadata, minimum=$minimum, minimumAmount=$minimumAmount, modelType=$modelType, name=$name, planPhaseOrder=$planPhaseOrder, priceType=$priceType, unitWithProrationConfig=$unitWithProrationConfig, additionalProperties=$additionalProperties}" + "TieredWithProrationPrice{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, maximum=$maximum, maximumAmount=$maximumAmount, metadata=$metadata, minimum=$minimum, minimumAmount=$minimumAmount, modelType=$modelType, name=$name, planPhaseOrder=$planPhaseOrder, priceType=$priceType, tieredWithProrationConfig=$tieredWithProrationConfig, additionalProperties=$additionalProperties}" } @NoAutoDetect - class GroupedAllocationPrice + class UnitWithProrationPrice @JsonCreator private constructor( @JsonProperty("id") @ExcludeMissing private val id: JsonField = JsonMissing.of(), @@ -37728,9 +35539,6 @@ private constructor( @JsonProperty("fixed_price_quantity") @ExcludeMissing private val fixedPriceQuantity: JsonField = JsonMissing.of(), - @JsonProperty("grouped_allocation_config") - @ExcludeMissing - private val groupedAllocationConfig: JsonField = JsonMissing.of(), @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing private val invoicingCycleConfiguration: JsonField = @@ -37763,6 +35571,9 @@ private constructor( @JsonProperty("price_type") @ExcludeMissing private val priceType: JsonField = JsonMissing.of(), + @JsonProperty("unit_with_proration_config") + @ExcludeMissing + private val unitWithProrationConfig: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { @@ -37795,9 +35606,6 @@ private constructor( fun fixedPriceQuantity(): Optional = Optional.ofNullable(fixedPriceQuantity.getNullable("fixed_price_quantity")) - fun groupedAllocationConfig(): GroupedAllocationConfig = - groupedAllocationConfig.getRequired("grouped_allocation_config") - fun invoicingCycleConfiguration(): Optional = Optional.ofNullable( invoicingCycleConfiguration.getNullable("invoicing_cycle_configuration") @@ -37831,6 +35639,9 @@ private constructor( fun priceType(): PriceType = priceType.getRequired("price_type") + fun unitWithProrationConfig(): UnitWithProrationConfig = + unitWithProrationConfig.getRequired("unit_with_proration_config") + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id @JsonProperty("billable_metric") @@ -37868,10 +35679,6 @@ private constructor( @ExcludeMissing fun _fixedPriceQuantity(): JsonField = fixedPriceQuantity - @JsonProperty("grouped_allocation_config") - @ExcludeMissing - fun _groupedAllocationConfig(): JsonField = groupedAllocationConfig - @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing fun _invoicingCycleConfiguration(): JsonField = @@ -37912,13 +35719,17 @@ private constructor( @ExcludeMissing fun _priceType(): JsonField = priceType + @JsonProperty("unit_with_proration_config") + @ExcludeMissing + fun _unitWithProrationConfig(): JsonField = unitWithProrationConfig + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties private var validated: Boolean = false - fun validate(): GroupedAllocationPrice = apply { + fun validate(): UnitWithProrationPrice = apply { if (validated) { return@apply } @@ -37934,7 +35745,6 @@ private constructor( discount().ifPresent { it.validate() } externalPriceId() fixedPriceQuantity() - groupedAllocationConfig().validate() invoicingCycleConfiguration().ifPresent { it.validate() } item().validate() maximum().ifPresent { it.validate() } @@ -37946,6 +35756,7 @@ private constructor( name() planPhaseOrder() priceType() + unitWithProrationConfig().validate() validated = true } @@ -37969,7 +35780,6 @@ private constructor( private var discount: JsonField? = null private var externalPriceId: JsonField? = null private var fixedPriceQuantity: JsonField? = null - private var groupedAllocationConfig: JsonField? = null private var invoicingCycleConfiguration: JsonField? = null private var item: JsonField? = null private var maximum: JsonField? = null @@ -37981,34 +35791,35 @@ private constructor( private var name: JsonField? = null private var planPhaseOrder: JsonField? = null private var priceType: JsonField? = null + private var unitWithProrationConfig: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(groupedAllocationPrice: GroupedAllocationPrice) = apply { - id = groupedAllocationPrice.id - billableMetric = groupedAllocationPrice.billableMetric - billingCycleConfiguration = groupedAllocationPrice.billingCycleConfiguration - cadence = groupedAllocationPrice.cadence - conversionRate = groupedAllocationPrice.conversionRate - createdAt = groupedAllocationPrice.createdAt - creditAllocation = groupedAllocationPrice.creditAllocation - currency = groupedAllocationPrice.currency - discount = groupedAllocationPrice.discount - externalPriceId = groupedAllocationPrice.externalPriceId - fixedPriceQuantity = groupedAllocationPrice.fixedPriceQuantity - groupedAllocationConfig = groupedAllocationPrice.groupedAllocationConfig - invoicingCycleConfiguration = groupedAllocationPrice.invoicingCycleConfiguration - item = groupedAllocationPrice.item - maximum = groupedAllocationPrice.maximum - maximumAmount = groupedAllocationPrice.maximumAmount - metadata = groupedAllocationPrice.metadata - minimum = groupedAllocationPrice.minimum - minimumAmount = groupedAllocationPrice.minimumAmount - modelType = groupedAllocationPrice.modelType - name = groupedAllocationPrice.name - planPhaseOrder = groupedAllocationPrice.planPhaseOrder - priceType = groupedAllocationPrice.priceType - additionalProperties = groupedAllocationPrice.additionalProperties.toMutableMap() + internal fun from(unitWithProrationPrice: UnitWithProrationPrice) = apply { + id = unitWithProrationPrice.id + billableMetric = unitWithProrationPrice.billableMetric + billingCycleConfiguration = unitWithProrationPrice.billingCycleConfiguration + cadence = unitWithProrationPrice.cadence + conversionRate = unitWithProrationPrice.conversionRate + createdAt = unitWithProrationPrice.createdAt + creditAllocation = unitWithProrationPrice.creditAllocation + currency = unitWithProrationPrice.currency + discount = unitWithProrationPrice.discount + externalPriceId = unitWithProrationPrice.externalPriceId + fixedPriceQuantity = unitWithProrationPrice.fixedPriceQuantity + invoicingCycleConfiguration = unitWithProrationPrice.invoicingCycleConfiguration + item = unitWithProrationPrice.item + maximum = unitWithProrationPrice.maximum + maximumAmount = unitWithProrationPrice.maximumAmount + metadata = unitWithProrationPrice.metadata + minimum = unitWithProrationPrice.minimum + minimumAmount = unitWithProrationPrice.minimumAmount + modelType = unitWithProrationPrice.modelType + name = unitWithProrationPrice.name + planPhaseOrder = unitWithProrationPrice.planPhaseOrder + priceType = unitWithProrationPrice.priceType + unitWithProrationConfig = unitWithProrationPrice.unitWithProrationConfig + additionalProperties = unitWithProrationPrice.additionalProperties.toMutableMap() } fun id(id: String) = id(JsonField.of(id)) @@ -38111,13 +35922,6 @@ private constructor( this.fixedPriceQuantity = fixedPriceQuantity } - fun groupedAllocationConfig(groupedAllocationConfig: GroupedAllocationConfig) = - groupedAllocationConfig(JsonField.of(groupedAllocationConfig)) - - fun groupedAllocationConfig( - groupedAllocationConfig: JsonField - ) = apply { this.groupedAllocationConfig = groupedAllocationConfig } - fun invoicingCycleConfiguration( invoicingCycleConfiguration: InvoicingCycleConfiguration? ) = invoicingCycleConfiguration(JsonField.ofNullable(invoicingCycleConfiguration)) @@ -38205,6 +36009,13 @@ private constructor( fun priceType(priceType: JsonField) = apply { this.priceType = priceType } + fun unitWithProrationConfig(unitWithProrationConfig: UnitWithProrationConfig) = + unitWithProrationConfig(JsonField.of(unitWithProrationConfig)) + + fun unitWithProrationConfig( + unitWithProrationConfig: JsonField + ) = apply { this.unitWithProrationConfig = unitWithProrationConfig } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -38224,8 +36035,8 @@ private constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): GroupedAllocationPrice = - GroupedAllocationPrice( + fun build(): UnitWithProrationPrice = + UnitWithProrationPrice( checkRequired("id", id), checkRequired("billableMetric", billableMetric), checkRequired("billingCycleConfiguration", billingCycleConfiguration), @@ -38237,7 +36048,6 @@ private constructor( checkRequired("discount", discount), checkRequired("externalPriceId", externalPriceId), checkRequired("fixedPriceQuantity", fixedPriceQuantity), - checkRequired("groupedAllocationConfig", groupedAllocationConfig), checkRequired("invoicingCycleConfiguration", invoicingCycleConfiguration), checkRequired("item", item), checkRequired("maximum", maximum), @@ -38249,6 +36059,7 @@ private constructor( checkRequired("name", name), checkRequired("planPhaseOrder", planPhaseOrder), checkRequired("priceType", priceType), + checkRequired("unitWithProrationConfig", unitWithProrationConfig), additionalProperties.toImmutable(), ) } @@ -38726,89 +36537,6 @@ private constructor( "CreditAllocation{allowsRollover=$allowsRollover, currency=$currency, additionalProperties=$additionalProperties}" } - @NoAutoDetect - class GroupedAllocationConfig - @JsonCreator - private constructor( - @JsonAnySetter - private val additionalProperties: Map = immutableEmptyMap(), - ) { - - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = additionalProperties - - private var validated: Boolean = false - - fun validate(): GroupedAllocationConfig = 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(groupedAllocationConfig: GroupedAllocationConfig) = apply { - additionalProperties = - groupedAllocationConfig.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(): GroupedAllocationConfig = - GroupedAllocationConfig(additionalProperties.toImmutable()) - } - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is GroupedAllocationConfig && 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() = - "GroupedAllocationConfig{additionalProperties=$additionalProperties}" - } - @NoAutoDetect class InvoicingCycleConfiguration @JsonCreator @@ -39524,29 +37252,29 @@ private constructor( companion object { - @JvmField val GROUPED_ALLOCATION = of("grouped_allocation") + @JvmField val UNIT_WITH_PRORATION = of("unit_with_proration") @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } enum class Known { - GROUPED_ALLOCATION, + UNIT_WITH_PRORATION, } enum class Value { - GROUPED_ALLOCATION, + UNIT_WITH_PRORATION, _UNKNOWN, } fun value(): Value = when (this) { - GROUPED_ALLOCATION -> Value.GROUPED_ALLOCATION + UNIT_WITH_PRORATION -> Value.UNIT_WITH_PRORATION else -> Value._UNKNOWN } fun known(): Known = when (this) { - GROUPED_ALLOCATION -> Known.GROUPED_ALLOCATION + UNIT_WITH_PRORATION -> Known.UNIT_WITH_PRORATION else -> throw OrbInvalidDataException("Unknown ModelType: $value") } @@ -39622,26 +37350,109 @@ private constructor( override fun toString() = value.toString() } + @NoAutoDetect + class UnitWithProrationConfig + @JsonCreator + private constructor( + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): UnitWithProrationConfig = 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(unitWithProrationConfig: UnitWithProrationConfig) = apply { + additionalProperties = + unitWithProrationConfig.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(): UnitWithProrationConfig = + UnitWithProrationConfig(additionalProperties.toImmutable()) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is UnitWithProrationConfig && 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() = + "UnitWithProrationConfig{additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true } - return /* spotless:off */ other is GroupedAllocationPrice && 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 && groupedAllocationConfig == other.groupedAllocationConfig && invoicingCycleConfiguration == other.invoicingCycleConfiguration && item == other.item && 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 */ + return /* spotless:off */ other is UnitWithProrationPrice && 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 && 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 && unitWithProrationConfig == other.unitWithProrationConfig && 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, groupedAllocationConfig, invoicingCycleConfiguration, item, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, billableMetric, billingCycleConfiguration, cadence, conversionRate, createdAt, creditAllocation, currency, discount, externalPriceId, fixedPriceQuantity, invoicingCycleConfiguration, item, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, unitWithProrationConfig, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "GroupedAllocationPrice{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, cadence=$cadence, conversionRate=$conversionRate, createdAt=$createdAt, creditAllocation=$creditAllocation, currency=$currency, discount=$discount, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, groupedAllocationConfig=$groupedAllocationConfig, invoicingCycleConfiguration=$invoicingCycleConfiguration, item=$item, maximum=$maximum, maximumAmount=$maximumAmount, metadata=$metadata, minimum=$minimum, minimumAmount=$minimumAmount, modelType=$modelType, name=$name, planPhaseOrder=$planPhaseOrder, priceType=$priceType, additionalProperties=$additionalProperties}" + "UnitWithProrationPrice{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, maximum=$maximum, maximumAmount=$maximumAmount, metadata=$metadata, minimum=$minimum, minimumAmount=$minimumAmount, modelType=$modelType, name=$name, planPhaseOrder=$planPhaseOrder, priceType=$priceType, unitWithProrationConfig=$unitWithProrationConfig, additionalProperties=$additionalProperties}" } @NoAutoDetect - class GroupedWithProratedMinimumPrice + class GroupedAllocationPrice @JsonCreator private constructor( @JsonProperty("id") @ExcludeMissing private val id: JsonField = JsonMissing.of(), @@ -39676,10 +37487,9 @@ private constructor( @JsonProperty("fixed_price_quantity") @ExcludeMissing private val fixedPriceQuantity: JsonField = JsonMissing.of(), - @JsonProperty("grouped_with_prorated_minimum_config") + @JsonProperty("grouped_allocation_config") @ExcludeMissing - private val groupedWithProratedMinimumConfig: JsonField = - JsonMissing.of(), + private val groupedAllocationConfig: JsonField = JsonMissing.of(), @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing private val invoicingCycleConfiguration: JsonField = @@ -39744,8 +37554,8 @@ private constructor( fun fixedPriceQuantity(): Optional = Optional.ofNullable(fixedPriceQuantity.getNullable("fixed_price_quantity")) - fun groupedWithProratedMinimumConfig(): GroupedWithProratedMinimumConfig = - groupedWithProratedMinimumConfig.getRequired("grouped_with_prorated_minimum_config") + fun groupedAllocationConfig(): GroupedAllocationConfig = + groupedAllocationConfig.getRequired("grouped_allocation_config") fun invoicingCycleConfiguration(): Optional = Optional.ofNullable( @@ -39817,10 +37627,9 @@ private constructor( @ExcludeMissing fun _fixedPriceQuantity(): JsonField = fixedPriceQuantity - @JsonProperty("grouped_with_prorated_minimum_config") + @JsonProperty("grouped_allocation_config") @ExcludeMissing - fun _groupedWithProratedMinimumConfig(): JsonField = - groupedWithProratedMinimumConfig + fun _groupedAllocationConfig(): JsonField = groupedAllocationConfig @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing @@ -39868,7 +37677,7 @@ private constructor( private var validated: Boolean = false - fun validate(): GroupedWithProratedMinimumPrice = apply { + fun validate(): GroupedAllocationPrice = apply { if (validated) { return@apply } @@ -39884,7 +37693,7 @@ private constructor( discount().ifPresent { it.validate() } externalPriceId() fixedPriceQuantity() - groupedWithProratedMinimumConfig().validate() + groupedAllocationConfig().validate() invoicingCycleConfiguration().ifPresent { it.validate() } item().validate() maximum().ifPresent { it.validate() } @@ -39919,9 +37728,7 @@ private constructor( private var discount: JsonField? = null private var externalPriceId: JsonField? = null private var fixedPriceQuantity: JsonField? = null - private var groupedWithProratedMinimumConfig: - JsonField? = - null + private var groupedAllocationConfig: JsonField? = null private var invoicingCycleConfiguration: JsonField? = null private var item: JsonField? = null private var maximum: JsonField? = null @@ -39936,37 +37743,32 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(groupedWithProratedMinimumPrice: GroupedWithProratedMinimumPrice) = - apply { - id = groupedWithProratedMinimumPrice.id - billableMetric = groupedWithProratedMinimumPrice.billableMetric - billingCycleConfiguration = - groupedWithProratedMinimumPrice.billingCycleConfiguration - cadence = groupedWithProratedMinimumPrice.cadence - conversionRate = groupedWithProratedMinimumPrice.conversionRate - createdAt = groupedWithProratedMinimumPrice.createdAt - creditAllocation = groupedWithProratedMinimumPrice.creditAllocation - currency = groupedWithProratedMinimumPrice.currency - discount = groupedWithProratedMinimumPrice.discount - externalPriceId = groupedWithProratedMinimumPrice.externalPriceId - fixedPriceQuantity = groupedWithProratedMinimumPrice.fixedPriceQuantity - groupedWithProratedMinimumConfig = - groupedWithProratedMinimumPrice.groupedWithProratedMinimumConfig - invoicingCycleConfiguration = - groupedWithProratedMinimumPrice.invoicingCycleConfiguration - item = groupedWithProratedMinimumPrice.item - maximum = groupedWithProratedMinimumPrice.maximum - maximumAmount = groupedWithProratedMinimumPrice.maximumAmount - metadata = groupedWithProratedMinimumPrice.metadata - minimum = groupedWithProratedMinimumPrice.minimum - minimumAmount = groupedWithProratedMinimumPrice.minimumAmount - modelType = groupedWithProratedMinimumPrice.modelType - name = groupedWithProratedMinimumPrice.name - planPhaseOrder = groupedWithProratedMinimumPrice.planPhaseOrder - priceType = groupedWithProratedMinimumPrice.priceType - additionalProperties = - groupedWithProratedMinimumPrice.additionalProperties.toMutableMap() - } + internal fun from(groupedAllocationPrice: GroupedAllocationPrice) = apply { + id = groupedAllocationPrice.id + billableMetric = groupedAllocationPrice.billableMetric + billingCycleConfiguration = groupedAllocationPrice.billingCycleConfiguration + cadence = groupedAllocationPrice.cadence + conversionRate = groupedAllocationPrice.conversionRate + createdAt = groupedAllocationPrice.createdAt + creditAllocation = groupedAllocationPrice.creditAllocation + currency = groupedAllocationPrice.currency + discount = groupedAllocationPrice.discount + externalPriceId = groupedAllocationPrice.externalPriceId + fixedPriceQuantity = groupedAllocationPrice.fixedPriceQuantity + groupedAllocationConfig = groupedAllocationPrice.groupedAllocationConfig + invoicingCycleConfiguration = groupedAllocationPrice.invoicingCycleConfiguration + item = groupedAllocationPrice.item + maximum = groupedAllocationPrice.maximum + maximumAmount = groupedAllocationPrice.maximumAmount + metadata = groupedAllocationPrice.metadata + minimum = groupedAllocationPrice.minimum + minimumAmount = groupedAllocationPrice.minimumAmount + modelType = groupedAllocationPrice.modelType + name = groupedAllocationPrice.name + planPhaseOrder = groupedAllocationPrice.planPhaseOrder + priceType = groupedAllocationPrice.priceType + additionalProperties = groupedAllocationPrice.additionalProperties.toMutableMap() + } fun id(id: String) = id(JsonField.of(id)) @@ -40068,13 +37870,12 @@ private constructor( this.fixedPriceQuantity = fixedPriceQuantity } - fun groupedWithProratedMinimumConfig( - groupedWithProratedMinimumConfig: GroupedWithProratedMinimumConfig - ) = groupedWithProratedMinimumConfig(JsonField.of(groupedWithProratedMinimumConfig)) + fun groupedAllocationConfig(groupedAllocationConfig: GroupedAllocationConfig) = + groupedAllocationConfig(JsonField.of(groupedAllocationConfig)) - fun groupedWithProratedMinimumConfig( - groupedWithProratedMinimumConfig: JsonField - ) = apply { this.groupedWithProratedMinimumConfig = groupedWithProratedMinimumConfig } + fun groupedAllocationConfig( + groupedAllocationConfig: JsonField + ) = apply { this.groupedAllocationConfig = groupedAllocationConfig } fun invoicingCycleConfiguration( invoicingCycleConfiguration: InvoicingCycleConfiguration? @@ -40182,8 +37983,8 @@ private constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): GroupedWithProratedMinimumPrice = - GroupedWithProratedMinimumPrice( + fun build(): GroupedAllocationPrice = + GroupedAllocationPrice( checkRequired("id", id), checkRequired("billableMetric", billableMetric), checkRequired("billingCycleConfiguration", billingCycleConfiguration), @@ -40195,10 +37996,7 @@ private constructor( checkRequired("discount", discount), checkRequired("externalPriceId", externalPriceId), checkRequired("fixedPriceQuantity", fixedPriceQuantity), - checkRequired( - "groupedWithProratedMinimumConfig", - groupedWithProratedMinimumConfig - ), + checkRequired("groupedAllocationConfig", groupedAllocationConfig), checkRequired("invoicingCycleConfiguration", invoicingCycleConfiguration), checkRequired("item", item), checkRequired("maximum", maximum), @@ -40688,7 +38486,7 @@ private constructor( } @NoAutoDetect - class GroupedWithProratedMinimumConfig + class GroupedAllocationConfig @JsonCreator private constructor( @JsonAnySetter @@ -40701,7 +38499,7 @@ private constructor( private var validated: Boolean = false - fun validate(): GroupedWithProratedMinimumConfig = apply { + fun validate(): GroupedAllocationConfig = apply { if (validated) { return@apply } @@ -40721,11 +38519,9 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from( - groupedWithProratedMinimumConfig: GroupedWithProratedMinimumConfig - ) = apply { + internal fun from(groupedAllocationConfig: GroupedAllocationConfig) = apply { additionalProperties = - groupedWithProratedMinimumConfig.additionalProperties.toMutableMap() + groupedAllocationConfig.additionalProperties.toMutableMap() } fun additionalProperties(additionalProperties: Map) = apply { @@ -40750,8 +38546,8 @@ private constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): GroupedWithProratedMinimumConfig = - GroupedWithProratedMinimumConfig(additionalProperties.toImmutable()) + fun build(): GroupedAllocationConfig = + GroupedAllocationConfig(additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { @@ -40759,7 +38555,7 @@ private constructor( return true } - return /* spotless:off */ other is GroupedWithProratedMinimumConfig && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is GroupedAllocationConfig && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ @@ -40769,7 +38565,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "GroupedWithProratedMinimumConfig{additionalProperties=$additionalProperties}" + "GroupedAllocationConfig{additionalProperties=$additionalProperties}" } @NoAutoDetect @@ -41487,29 +39283,29 @@ private constructor( companion object { - @JvmField val GROUPED_WITH_PRORATED_MINIMUM = of("grouped_with_prorated_minimum") + @JvmField val GROUPED_ALLOCATION = of("grouped_allocation") @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } enum class Known { - GROUPED_WITH_PRORATED_MINIMUM, + GROUPED_ALLOCATION, } enum class Value { - GROUPED_WITH_PRORATED_MINIMUM, + GROUPED_ALLOCATION, _UNKNOWN, } fun value(): Value = when (this) { - GROUPED_WITH_PRORATED_MINIMUM -> Value.GROUPED_WITH_PRORATED_MINIMUM + GROUPED_ALLOCATION -> Value.GROUPED_ALLOCATION else -> Value._UNKNOWN } fun known(): Known = when (this) { - GROUPED_WITH_PRORATED_MINIMUM -> Known.GROUPED_WITH_PRORATED_MINIMUM + GROUPED_ALLOCATION -> Known.GROUPED_ALLOCATION else -> throw OrbInvalidDataException("Unknown ModelType: $value") } @@ -41590,21 +39386,21 @@ private constructor( return true } - return /* spotless:off */ other is GroupedWithProratedMinimumPrice && 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 && groupedWithProratedMinimumConfig == other.groupedWithProratedMinimumConfig && invoicingCycleConfiguration == other.invoicingCycleConfiguration && item == other.item && 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 */ + return /* spotless:off */ other is GroupedAllocationPrice && 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 && groupedAllocationConfig == other.groupedAllocationConfig && invoicingCycleConfiguration == other.invoicingCycleConfiguration && item == other.item && 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, groupedWithProratedMinimumConfig, invoicingCycleConfiguration, item, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, billableMetric, billingCycleConfiguration, cadence, conversionRate, createdAt, creditAllocation, currency, discount, externalPriceId, fixedPriceQuantity, groupedAllocationConfig, invoicingCycleConfiguration, item, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "GroupedWithProratedMinimumPrice{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, cadence=$cadence, conversionRate=$conversionRate, createdAt=$createdAt, creditAllocation=$creditAllocation, currency=$currency, discount=$discount, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, groupedWithProratedMinimumConfig=$groupedWithProratedMinimumConfig, invoicingCycleConfiguration=$invoicingCycleConfiguration, item=$item, maximum=$maximum, maximumAmount=$maximumAmount, metadata=$metadata, minimum=$minimum, minimumAmount=$minimumAmount, modelType=$modelType, name=$name, planPhaseOrder=$planPhaseOrder, priceType=$priceType, additionalProperties=$additionalProperties}" + "GroupedAllocationPrice{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, cadence=$cadence, conversionRate=$conversionRate, createdAt=$createdAt, creditAllocation=$creditAllocation, currency=$currency, discount=$discount, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, groupedAllocationConfig=$groupedAllocationConfig, invoicingCycleConfiguration=$invoicingCycleConfiguration, item=$item, maximum=$maximum, maximumAmount=$maximumAmount, metadata=$metadata, minimum=$minimum, minimumAmount=$minimumAmount, modelType=$modelType, name=$name, planPhaseOrder=$planPhaseOrder, priceType=$priceType, additionalProperties=$additionalProperties}" } @NoAutoDetect - class GroupedWithMeteredMinimumPrice + class GroupedWithProratedMinimumPrice @JsonCreator private constructor( @JsonProperty("id") @ExcludeMissing private val id: JsonField = JsonMissing.of(), @@ -41639,9 +39435,9 @@ private constructor( @JsonProperty("fixed_price_quantity") @ExcludeMissing private val fixedPriceQuantity: JsonField = JsonMissing.of(), - @JsonProperty("grouped_with_metered_minimum_config") + @JsonProperty("grouped_with_prorated_minimum_config") @ExcludeMissing - private val groupedWithMeteredMinimumConfig: JsonField = + private val groupedWithProratedMinimumConfig: JsonField = JsonMissing.of(), @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing @@ -41707,8 +39503,8 @@ private constructor( fun fixedPriceQuantity(): Optional = Optional.ofNullable(fixedPriceQuantity.getNullable("fixed_price_quantity")) - fun groupedWithMeteredMinimumConfig(): GroupedWithMeteredMinimumConfig = - groupedWithMeteredMinimumConfig.getRequired("grouped_with_metered_minimum_config") + fun groupedWithProratedMinimumConfig(): GroupedWithProratedMinimumConfig = + groupedWithProratedMinimumConfig.getRequired("grouped_with_prorated_minimum_config") fun invoicingCycleConfiguration(): Optional = Optional.ofNullable( @@ -41780,10 +39576,10 @@ private constructor( @ExcludeMissing fun _fixedPriceQuantity(): JsonField = fixedPriceQuantity - @JsonProperty("grouped_with_metered_minimum_config") + @JsonProperty("grouped_with_prorated_minimum_config") @ExcludeMissing - fun _groupedWithMeteredMinimumConfig(): JsonField = - groupedWithMeteredMinimumConfig + fun _groupedWithProratedMinimumConfig(): JsonField = + groupedWithProratedMinimumConfig @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing @@ -41831,7 +39627,7 @@ private constructor( private var validated: Boolean = false - fun validate(): GroupedWithMeteredMinimumPrice = apply { + fun validate(): GroupedWithProratedMinimumPrice = apply { if (validated) { return@apply } @@ -41847,7 +39643,7 @@ private constructor( discount().ifPresent { it.validate() } externalPriceId() fixedPriceQuantity() - groupedWithMeteredMinimumConfig().validate() + groupedWithProratedMinimumConfig().validate() invoicingCycleConfiguration().ifPresent { it.validate() } item().validate() maximum().ifPresent { it.validate() } @@ -41882,8 +39678,8 @@ private constructor( private var discount: JsonField? = null private var externalPriceId: JsonField? = null private var fixedPriceQuantity: JsonField? = null - private var groupedWithMeteredMinimumConfig: - JsonField? = + private var groupedWithProratedMinimumConfig: + JsonField? = null private var invoicingCycleConfiguration: JsonField? = null private var item: JsonField? = null @@ -41899,36 +39695,36 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(groupedWithMeteredMinimumPrice: GroupedWithMeteredMinimumPrice) = + internal fun from(groupedWithProratedMinimumPrice: GroupedWithProratedMinimumPrice) = apply { - id = groupedWithMeteredMinimumPrice.id - billableMetric = groupedWithMeteredMinimumPrice.billableMetric + id = groupedWithProratedMinimumPrice.id + billableMetric = groupedWithProratedMinimumPrice.billableMetric billingCycleConfiguration = - groupedWithMeteredMinimumPrice.billingCycleConfiguration - cadence = groupedWithMeteredMinimumPrice.cadence - conversionRate = groupedWithMeteredMinimumPrice.conversionRate - createdAt = groupedWithMeteredMinimumPrice.createdAt - creditAllocation = groupedWithMeteredMinimumPrice.creditAllocation - currency = groupedWithMeteredMinimumPrice.currency - discount = groupedWithMeteredMinimumPrice.discount - externalPriceId = groupedWithMeteredMinimumPrice.externalPriceId - fixedPriceQuantity = groupedWithMeteredMinimumPrice.fixedPriceQuantity - groupedWithMeteredMinimumConfig = - groupedWithMeteredMinimumPrice.groupedWithMeteredMinimumConfig + groupedWithProratedMinimumPrice.billingCycleConfiguration + cadence = groupedWithProratedMinimumPrice.cadence + conversionRate = groupedWithProratedMinimumPrice.conversionRate + createdAt = groupedWithProratedMinimumPrice.createdAt + creditAllocation = groupedWithProratedMinimumPrice.creditAllocation + currency = groupedWithProratedMinimumPrice.currency + discount = groupedWithProratedMinimumPrice.discount + externalPriceId = groupedWithProratedMinimumPrice.externalPriceId + fixedPriceQuantity = groupedWithProratedMinimumPrice.fixedPriceQuantity + groupedWithProratedMinimumConfig = + groupedWithProratedMinimumPrice.groupedWithProratedMinimumConfig invoicingCycleConfiguration = - groupedWithMeteredMinimumPrice.invoicingCycleConfiguration - item = groupedWithMeteredMinimumPrice.item - maximum = groupedWithMeteredMinimumPrice.maximum - maximumAmount = groupedWithMeteredMinimumPrice.maximumAmount - metadata = groupedWithMeteredMinimumPrice.metadata - minimum = groupedWithMeteredMinimumPrice.minimum - minimumAmount = groupedWithMeteredMinimumPrice.minimumAmount - modelType = groupedWithMeteredMinimumPrice.modelType - name = groupedWithMeteredMinimumPrice.name - planPhaseOrder = groupedWithMeteredMinimumPrice.planPhaseOrder - priceType = groupedWithMeteredMinimumPrice.priceType + groupedWithProratedMinimumPrice.invoicingCycleConfiguration + item = groupedWithProratedMinimumPrice.item + maximum = groupedWithProratedMinimumPrice.maximum + maximumAmount = groupedWithProratedMinimumPrice.maximumAmount + metadata = groupedWithProratedMinimumPrice.metadata + minimum = groupedWithProratedMinimumPrice.minimum + minimumAmount = groupedWithProratedMinimumPrice.minimumAmount + modelType = groupedWithProratedMinimumPrice.modelType + name = groupedWithProratedMinimumPrice.name + planPhaseOrder = groupedWithProratedMinimumPrice.planPhaseOrder + priceType = groupedWithProratedMinimumPrice.priceType additionalProperties = - groupedWithMeteredMinimumPrice.additionalProperties.toMutableMap() + groupedWithProratedMinimumPrice.additionalProperties.toMutableMap() } fun id(id: String) = id(JsonField.of(id)) @@ -42031,13 +39827,13 @@ private constructor( this.fixedPriceQuantity = fixedPriceQuantity } - fun groupedWithMeteredMinimumConfig( - groupedWithMeteredMinimumConfig: GroupedWithMeteredMinimumConfig - ) = groupedWithMeteredMinimumConfig(JsonField.of(groupedWithMeteredMinimumConfig)) + fun groupedWithProratedMinimumConfig( + groupedWithProratedMinimumConfig: GroupedWithProratedMinimumConfig + ) = groupedWithProratedMinimumConfig(JsonField.of(groupedWithProratedMinimumConfig)) - fun groupedWithMeteredMinimumConfig( - groupedWithMeteredMinimumConfig: JsonField - ) = apply { this.groupedWithMeteredMinimumConfig = groupedWithMeteredMinimumConfig } + fun groupedWithProratedMinimumConfig( + groupedWithProratedMinimumConfig: JsonField + ) = apply { this.groupedWithProratedMinimumConfig = groupedWithProratedMinimumConfig } fun invoicingCycleConfiguration( invoicingCycleConfiguration: InvoicingCycleConfiguration? @@ -42145,8 +39941,8 @@ private constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): GroupedWithMeteredMinimumPrice = - GroupedWithMeteredMinimumPrice( + fun build(): GroupedWithProratedMinimumPrice = + GroupedWithProratedMinimumPrice( checkRequired("id", id), checkRequired("billableMetric", billableMetric), checkRequired("billingCycleConfiguration", billingCycleConfiguration), @@ -42159,8 +39955,8 @@ private constructor( checkRequired("externalPriceId", externalPriceId), checkRequired("fixedPriceQuantity", fixedPriceQuantity), checkRequired( - "groupedWithMeteredMinimumConfig", - groupedWithMeteredMinimumConfig + "groupedWithProratedMinimumConfig", + groupedWithProratedMinimumConfig ), checkRequired("invoicingCycleConfiguration", invoicingCycleConfiguration), checkRequired("item", item), @@ -42651,7 +40447,7 @@ private constructor( } @NoAutoDetect - class GroupedWithMeteredMinimumConfig + class GroupedWithProratedMinimumConfig @JsonCreator private constructor( @JsonAnySetter @@ -42664,7 +40460,7 @@ private constructor( private var validated: Boolean = false - fun validate(): GroupedWithMeteredMinimumConfig = apply { + fun validate(): GroupedWithProratedMinimumConfig = apply { if (validated) { return@apply } @@ -42685,10 +40481,10 @@ private constructor( @JvmSynthetic internal fun from( - groupedWithMeteredMinimumConfig: GroupedWithMeteredMinimumConfig + groupedWithProratedMinimumConfig: GroupedWithProratedMinimumConfig ) = apply { additionalProperties = - groupedWithMeteredMinimumConfig.additionalProperties.toMutableMap() + groupedWithProratedMinimumConfig.additionalProperties.toMutableMap() } fun additionalProperties(additionalProperties: Map) = apply { @@ -42713,8 +40509,8 @@ private constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): GroupedWithMeteredMinimumConfig = - GroupedWithMeteredMinimumConfig(additionalProperties.toImmutable()) + fun build(): GroupedWithProratedMinimumConfig = + GroupedWithProratedMinimumConfig(additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { @@ -42722,7 +40518,7 @@ private constructor( return true } - return /* spotless:off */ other is GroupedWithMeteredMinimumConfig && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is GroupedWithProratedMinimumConfig && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ @@ -42732,7 +40528,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "GroupedWithMeteredMinimumConfig{additionalProperties=$additionalProperties}" + "GroupedWithProratedMinimumConfig{additionalProperties=$additionalProperties}" } @NoAutoDetect @@ -43450,29 +41246,29 @@ private constructor( companion object { - @JvmField val GROUPED_WITH_METERED_MINIMUM = of("grouped_with_metered_minimum") + @JvmField val GROUPED_WITH_PRORATED_MINIMUM = of("grouped_with_prorated_minimum") @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } enum class Known { - GROUPED_WITH_METERED_MINIMUM, + GROUPED_WITH_PRORATED_MINIMUM, } enum class Value { - GROUPED_WITH_METERED_MINIMUM, + GROUPED_WITH_PRORATED_MINIMUM, _UNKNOWN, } fun value(): Value = when (this) { - GROUPED_WITH_METERED_MINIMUM -> Value.GROUPED_WITH_METERED_MINIMUM + GROUPED_WITH_PRORATED_MINIMUM -> Value.GROUPED_WITH_PRORATED_MINIMUM else -> Value._UNKNOWN } fun known(): Known = when (this) { - GROUPED_WITH_METERED_MINIMUM -> Known.GROUPED_WITH_METERED_MINIMUM + GROUPED_WITH_PRORATED_MINIMUM -> Known.GROUPED_WITH_PRORATED_MINIMUM else -> throw OrbInvalidDataException("Unknown ModelType: $value") } @@ -43553,21 +41349,21 @@ private constructor( return true } - return /* spotless:off */ other is GroupedWithMeteredMinimumPrice && 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 && groupedWithMeteredMinimumConfig == other.groupedWithMeteredMinimumConfig && invoicingCycleConfiguration == other.invoicingCycleConfiguration && item == other.item && 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 */ + return /* spotless:off */ other is GroupedWithProratedMinimumPrice && 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 && groupedWithProratedMinimumConfig == other.groupedWithProratedMinimumConfig && invoicingCycleConfiguration == other.invoicingCycleConfiguration && item == other.item && 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, groupedWithMeteredMinimumConfig, invoicingCycleConfiguration, item, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, billableMetric, billingCycleConfiguration, cadence, conversionRate, createdAt, creditAllocation, currency, discount, externalPriceId, fixedPriceQuantity, groupedWithProratedMinimumConfig, invoicingCycleConfiguration, item, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "GroupedWithMeteredMinimumPrice{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, cadence=$cadence, conversionRate=$conversionRate, createdAt=$createdAt, creditAllocation=$creditAllocation, currency=$currency, discount=$discount, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, groupedWithMeteredMinimumConfig=$groupedWithMeteredMinimumConfig, invoicingCycleConfiguration=$invoicingCycleConfiguration, item=$item, maximum=$maximum, maximumAmount=$maximumAmount, metadata=$metadata, minimum=$minimum, minimumAmount=$minimumAmount, modelType=$modelType, name=$name, planPhaseOrder=$planPhaseOrder, priceType=$priceType, additionalProperties=$additionalProperties}" + "GroupedWithProratedMinimumPrice{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, cadence=$cadence, conversionRate=$conversionRate, createdAt=$createdAt, creditAllocation=$creditAllocation, currency=$currency, discount=$discount, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, groupedWithProratedMinimumConfig=$groupedWithProratedMinimumConfig, invoicingCycleConfiguration=$invoicingCycleConfiguration, item=$item, maximum=$maximum, maximumAmount=$maximumAmount, metadata=$metadata, minimum=$minimum, minimumAmount=$minimumAmount, modelType=$modelType, name=$name, planPhaseOrder=$planPhaseOrder, priceType=$priceType, additionalProperties=$additionalProperties}" } @NoAutoDetect - class MatrixWithDisplayNamePrice + class GroupedWithMeteredMinimumPrice @JsonCreator private constructor( @JsonProperty("id") @ExcludeMissing private val id: JsonField = JsonMissing.of(), @@ -43602,15 +41398,15 @@ private constructor( @JsonProperty("fixed_price_quantity") @ExcludeMissing private val fixedPriceQuantity: JsonField = JsonMissing.of(), + @JsonProperty("grouped_with_metered_minimum_config") + @ExcludeMissing + private val groupedWithMeteredMinimumConfig: JsonField = + JsonMissing.of(), @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing private val invoicingCycleConfiguration: JsonField = JsonMissing.of(), @JsonProperty("item") @ExcludeMissing private val item: JsonField = JsonMissing.of(), - @JsonProperty("matrix_with_display_name_config") - @ExcludeMissing - private val matrixWithDisplayNameConfig: JsonField = - JsonMissing.of(), @JsonProperty("maximum") @ExcludeMissing private val maximum: JsonField = JsonMissing.of(), @@ -43670,6 +41466,9 @@ private constructor( fun fixedPriceQuantity(): Optional = Optional.ofNullable(fixedPriceQuantity.getNullable("fixed_price_quantity")) + fun groupedWithMeteredMinimumConfig(): GroupedWithMeteredMinimumConfig = + groupedWithMeteredMinimumConfig.getRequired("grouped_with_metered_minimum_config") + fun invoicingCycleConfiguration(): Optional = Optional.ofNullable( invoicingCycleConfiguration.getNullable("invoicing_cycle_configuration") @@ -43677,9 +41476,6 @@ private constructor( fun item(): Item = item.getRequired("item") - fun matrixWithDisplayNameConfig(): MatrixWithDisplayNameConfig = - matrixWithDisplayNameConfig.getRequired("matrix_with_display_name_config") - fun maximum(): Optional = Optional.ofNullable(maximum.getNullable("maximum")) fun maximumAmount(): Optional = @@ -43743,6 +41539,11 @@ private constructor( @ExcludeMissing fun _fixedPriceQuantity(): JsonField = fixedPriceQuantity + @JsonProperty("grouped_with_metered_minimum_config") + @ExcludeMissing + fun _groupedWithMeteredMinimumConfig(): JsonField = + groupedWithMeteredMinimumConfig + @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing fun _invoicingCycleConfiguration(): JsonField = @@ -43750,11 +41551,6 @@ private constructor( @JsonProperty("item") @ExcludeMissing fun _item(): JsonField = item - @JsonProperty("matrix_with_display_name_config") - @ExcludeMissing - fun _matrixWithDisplayNameConfig(): JsonField = - matrixWithDisplayNameConfig - @JsonProperty("maximum") @ExcludeMissing fun _maximum(): JsonField = maximum @JsonProperty("maximum_amount") @@ -43794,7 +41590,7 @@ private constructor( private var validated: Boolean = false - fun validate(): MatrixWithDisplayNamePrice = apply { + fun validate(): GroupedWithMeteredMinimumPrice = apply { if (validated) { return@apply } @@ -43810,9 +41606,9 @@ private constructor( discount().ifPresent { it.validate() } externalPriceId() fixedPriceQuantity() + groupedWithMeteredMinimumConfig().validate() invoicingCycleConfiguration().ifPresent { it.validate() } item().validate() - matrixWithDisplayNameConfig().validate() maximum().ifPresent { it.validate() } maximumAmount() metadata().validate() @@ -43845,9 +41641,11 @@ private constructor( private var discount: JsonField? = null private var externalPriceId: JsonField? = null private var fixedPriceQuantity: JsonField? = null + private var groupedWithMeteredMinimumConfig: + JsonField? = + null private var invoicingCycleConfiguration: JsonField? = null private var item: JsonField? = null - private var matrixWithDisplayNameConfig: JsonField? = null private var maximum: JsonField? = null private var maximumAmount: JsonField? = null private var metadata: JsonField? = null @@ -43860,33 +41658,37 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(matrixWithDisplayNamePrice: MatrixWithDisplayNamePrice) = apply { - id = matrixWithDisplayNamePrice.id - billableMetric = matrixWithDisplayNamePrice.billableMetric - billingCycleConfiguration = matrixWithDisplayNamePrice.billingCycleConfiguration - cadence = matrixWithDisplayNamePrice.cadence - conversionRate = matrixWithDisplayNamePrice.conversionRate - createdAt = matrixWithDisplayNamePrice.createdAt - creditAllocation = matrixWithDisplayNamePrice.creditAllocation - currency = matrixWithDisplayNamePrice.currency - discount = matrixWithDisplayNamePrice.discount - externalPriceId = matrixWithDisplayNamePrice.externalPriceId - fixedPriceQuantity = matrixWithDisplayNamePrice.fixedPriceQuantity - invoicingCycleConfiguration = matrixWithDisplayNamePrice.invoicingCycleConfiguration - item = matrixWithDisplayNamePrice.item - matrixWithDisplayNameConfig = matrixWithDisplayNamePrice.matrixWithDisplayNameConfig - maximum = matrixWithDisplayNamePrice.maximum - maximumAmount = matrixWithDisplayNamePrice.maximumAmount - metadata = matrixWithDisplayNamePrice.metadata - minimum = matrixWithDisplayNamePrice.minimum - minimumAmount = matrixWithDisplayNamePrice.minimumAmount - modelType = matrixWithDisplayNamePrice.modelType - name = matrixWithDisplayNamePrice.name - planPhaseOrder = matrixWithDisplayNamePrice.planPhaseOrder - priceType = matrixWithDisplayNamePrice.priceType - additionalProperties = - matrixWithDisplayNamePrice.additionalProperties.toMutableMap() - } + internal fun from(groupedWithMeteredMinimumPrice: GroupedWithMeteredMinimumPrice) = + apply { + id = groupedWithMeteredMinimumPrice.id + billableMetric = groupedWithMeteredMinimumPrice.billableMetric + billingCycleConfiguration = + groupedWithMeteredMinimumPrice.billingCycleConfiguration + cadence = groupedWithMeteredMinimumPrice.cadence + conversionRate = groupedWithMeteredMinimumPrice.conversionRate + createdAt = groupedWithMeteredMinimumPrice.createdAt + creditAllocation = groupedWithMeteredMinimumPrice.creditAllocation + currency = groupedWithMeteredMinimumPrice.currency + discount = groupedWithMeteredMinimumPrice.discount + externalPriceId = groupedWithMeteredMinimumPrice.externalPriceId + fixedPriceQuantity = groupedWithMeteredMinimumPrice.fixedPriceQuantity + groupedWithMeteredMinimumConfig = + groupedWithMeteredMinimumPrice.groupedWithMeteredMinimumConfig + invoicingCycleConfiguration = + groupedWithMeteredMinimumPrice.invoicingCycleConfiguration + item = groupedWithMeteredMinimumPrice.item + maximum = groupedWithMeteredMinimumPrice.maximum + maximumAmount = groupedWithMeteredMinimumPrice.maximumAmount + metadata = groupedWithMeteredMinimumPrice.metadata + minimum = groupedWithMeteredMinimumPrice.minimum + minimumAmount = groupedWithMeteredMinimumPrice.minimumAmount + modelType = groupedWithMeteredMinimumPrice.modelType + name = groupedWithMeteredMinimumPrice.name + planPhaseOrder = groupedWithMeteredMinimumPrice.planPhaseOrder + priceType = groupedWithMeteredMinimumPrice.priceType + additionalProperties = + groupedWithMeteredMinimumPrice.additionalProperties.toMutableMap() + } fun id(id: String) = id(JsonField.of(id)) @@ -43988,6 +41790,14 @@ private constructor( this.fixedPriceQuantity = fixedPriceQuantity } + fun groupedWithMeteredMinimumConfig( + groupedWithMeteredMinimumConfig: GroupedWithMeteredMinimumConfig + ) = groupedWithMeteredMinimumConfig(JsonField.of(groupedWithMeteredMinimumConfig)) + + fun groupedWithMeteredMinimumConfig( + groupedWithMeteredMinimumConfig: JsonField + ) = apply { this.groupedWithMeteredMinimumConfig = groupedWithMeteredMinimumConfig } + fun invoicingCycleConfiguration( invoicingCycleConfiguration: InvoicingCycleConfiguration? ) = invoicingCycleConfiguration(JsonField.ofNullable(invoicingCycleConfiguration)) @@ -44004,14 +41814,6 @@ private constructor( fun item(item: JsonField) = apply { this.item = item } - fun matrixWithDisplayNameConfig( - matrixWithDisplayNameConfig: MatrixWithDisplayNameConfig - ) = matrixWithDisplayNameConfig(JsonField.of(matrixWithDisplayNameConfig)) - - fun matrixWithDisplayNameConfig( - matrixWithDisplayNameConfig: JsonField - ) = apply { this.matrixWithDisplayNameConfig = matrixWithDisplayNameConfig } - fun maximum(maximum: Maximum?) = maximum(JsonField.ofNullable(maximum)) fun maximum(maximum: Optional) = maximum(maximum.orElse(null)) @@ -44102,8 +41904,8 @@ private constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): MatrixWithDisplayNamePrice = - MatrixWithDisplayNamePrice( + fun build(): GroupedWithMeteredMinimumPrice = + GroupedWithMeteredMinimumPrice( checkRequired("id", id), checkRequired("billableMetric", billableMetric), checkRequired("billingCycleConfiguration", billingCycleConfiguration), @@ -44115,9 +41917,12 @@ private constructor( checkRequired("discount", discount), checkRequired("externalPriceId", externalPriceId), checkRequired("fixedPriceQuantity", fixedPriceQuantity), + checkRequired( + "groupedWithMeteredMinimumConfig", + groupedWithMeteredMinimumConfig + ), checkRequired("invoicingCycleConfiguration", invoicingCycleConfiguration), checkRequired("item", item), - checkRequired("matrixWithDisplayNameConfig", matrixWithDisplayNameConfig), checkRequired("maximum", maximum), checkRequired("maximumAmount", maximumAmount), checkRequired("metadata", metadata), @@ -44605,218 +42410,24 @@ private constructor( } @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(), - ) { - - fun duration(): Long = duration.getRequired("duration") - - fun durationUnit(): DurationUnit = durationUnit.getRequired("duration_unit") - - @JsonProperty("duration") @ExcludeMissing fun _duration(): JsonField = 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() - } - - fun duration(duration: Long) = duration(JsonField.of(duration)) - - fun duration(duration: JsonField) = apply { this.duration = duration } - - fun durationUnit(durationUnit: DurationUnit) = - durationUnit(JsonField.of(durationUnit)) - - 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}" - } - - @NoAutoDetect - class Item + class GroupedWithMeteredMinimumConfig @JsonCreator private constructor( - @JsonProperty("id") - @ExcludeMissing - private val id: JsonField = JsonMissing.of(), - @JsonProperty("name") - @ExcludeMissing - private val name: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - fun id(): String = id.getRequired("id") - - fun name(): String = name.getRequired("name") - - @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id - - @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties private var validated: Boolean = false - fun validate(): Item = apply { + fun validate(): GroupedWithMeteredMinimumConfig = apply { if (validated) { return@apply } - id() - name() validated = true } @@ -44829,25 +42440,16 @@ private constructor( class Builder { - private var id: JsonField? = null - private var name: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(item: Item) = apply { - id = item.id - name = item.name - additionalProperties = item.additionalProperties.toMutableMap() + internal fun from( + groupedWithMeteredMinimumConfig: GroupedWithMeteredMinimumConfig + ) = apply { + additionalProperties = + groupedWithMeteredMinimumConfig.additionalProperties.toMutableMap() } - fun id(id: String) = id(JsonField.of(id)) - - fun id(id: JsonField) = apply { this.id = id } - - fun name(name: String) = name(JsonField.of(name)) - - fun name(name: JsonField) = apply { this.name = name } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -44870,12 +42472,8 @@ private constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): Item = - Item( - checkRequired("id", id), - checkRequired("name", name), - additionalProperties.toImmutable(), - ) + fun build(): GroupedWithMeteredMinimumConfig = + GroupedWithMeteredMinimumConfig(additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { @@ -44883,38 +42481,56 @@ private constructor( return true } - return /* spotless:off */ other is Item && id == other.id && name == other.name && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is GroupedWithMeteredMinimumConfig && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, name, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Item{id=$id, name=$name, additionalProperties=$additionalProperties}" + "GroupedWithMeteredMinimumConfig{additionalProperties=$additionalProperties}" } @NoAutoDetect - class MatrixWithDisplayNameConfig + 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(), ) { + fun duration(): Long = duration.getRequired("duration") + + fun durationUnit(): DurationUnit = durationUnit.getRequired("duration_unit") + + @JsonProperty("duration") @ExcludeMissing fun _duration(): JsonField = duration + + @JsonProperty("duration_unit") + @ExcludeMissing + fun _durationUnit(): JsonField = durationUnit + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties private var validated: Boolean = false - fun validate(): MatrixWithDisplayNameConfig = apply { + fun validate(): InvoicingCycleConfiguration = apply { if (validated) { return@apply } + duration() + durationUnit() validated = true } @@ -44927,15 +42543,30 @@ private constructor( class Builder { + private var duration: JsonField? = null + private var durationUnit: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(matrixWithDisplayNameConfig: MatrixWithDisplayNameConfig) = + internal fun from(invoicingCycleConfiguration: InvoicingCycleConfiguration) = apply { + duration = invoicingCycleConfiguration.duration + durationUnit = invoicingCycleConfiguration.durationUnit additionalProperties = - matrixWithDisplayNameConfig.additionalProperties.toMutableMap() + invoicingCycleConfiguration.additionalProperties.toMutableMap() } + fun duration(duration: Long) = duration(JsonField.of(duration)) + + fun duration(duration: JsonField) = apply { this.duration = duration } + + fun durationUnit(durationUnit: DurationUnit) = + durationUnit(JsonField.of(durationUnit)) + + fun durationUnit(durationUnit: JsonField) = apply { + this.durationUnit = durationUnit + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -44958,8 +42589,69 @@ private constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): MatrixWithDisplayNameConfig = - MatrixWithDisplayNameConfig(additionalProperties.toImmutable()) + 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 { @@ -44967,17 +42659,131 @@ private constructor( return true } - return /* spotless:off */ other is MatrixWithDisplayNameConfig && additionalProperties == other.additionalProperties /* spotless:on */ + 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(additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(duration, durationUnit, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "MatrixWithDisplayNameConfig{additionalProperties=$additionalProperties}" + "InvoicingCycleConfiguration{duration=$duration, durationUnit=$durationUnit, additionalProperties=$additionalProperties}" + } + + @NoAutoDetect + class Item + @JsonCreator + private constructor( + @JsonProperty("id") + @ExcludeMissing + private val id: JsonField = JsonMissing.of(), + @JsonProperty("name") + @ExcludeMissing + private val name: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { + + fun id(): String = id.getRequired("id") + + fun name(): String = name.getRequired("name") + + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): Item = apply { + if (validated) { + return@apply + } + + id() + name() + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + class Builder { + + private var id: JsonField? = null + private var name: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(item: Item) = apply { + id = item.id + name = item.name + additionalProperties = item.additionalProperties.toMutableMap() + } + + fun id(id: String) = id(JsonField.of(id)) + + fun id(id: JsonField) = apply { this.id = id } + + fun name(name: String) = name(JsonField.of(name)) + + fun name(name: JsonField) = apply { this.name = name } + + 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(): Item = + Item( + checkRequired("id", id), + checkRequired("name", name), + additionalProperties.toImmutable(), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Item && id == other.id && name == other.name && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(id, name, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Item{id=$id, name=$name, additionalProperties=$additionalProperties}" } @NoAutoDetect @@ -45403,29 +43209,29 @@ private constructor( companion object { - @JvmField val MATRIX_WITH_DISPLAY_NAME = of("matrix_with_display_name") + @JvmField val GROUPED_WITH_METERED_MINIMUM = of("grouped_with_metered_minimum") @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } enum class Known { - MATRIX_WITH_DISPLAY_NAME, + GROUPED_WITH_METERED_MINIMUM, } enum class Value { - MATRIX_WITH_DISPLAY_NAME, + GROUPED_WITH_METERED_MINIMUM, _UNKNOWN, } fun value(): Value = when (this) { - MATRIX_WITH_DISPLAY_NAME -> Value.MATRIX_WITH_DISPLAY_NAME + GROUPED_WITH_METERED_MINIMUM -> Value.GROUPED_WITH_METERED_MINIMUM else -> Value._UNKNOWN } fun known(): Known = when (this) { - MATRIX_WITH_DISPLAY_NAME -> Known.MATRIX_WITH_DISPLAY_NAME + GROUPED_WITH_METERED_MINIMUM -> Known.GROUPED_WITH_METERED_MINIMUM else -> throw OrbInvalidDataException("Unknown ModelType: $value") } @@ -45506,21 +43312,21 @@ private constructor( return true } - return /* spotless:off */ other is MatrixWithDisplayNamePrice && 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 && matrixWithDisplayNameConfig == other.matrixWithDisplayNameConfig && 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 */ + return /* spotless:off */ other is GroupedWithMeteredMinimumPrice && 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 && groupedWithMeteredMinimumConfig == other.groupedWithMeteredMinimumConfig && invoicingCycleConfiguration == other.invoicingCycleConfiguration && item == other.item && 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, matrixWithDisplayNameConfig, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, billableMetric, billingCycleConfiguration, cadence, conversionRate, createdAt, creditAllocation, currency, discount, externalPriceId, fixedPriceQuantity, groupedWithMeteredMinimumConfig, invoicingCycleConfiguration, item, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "MatrixWithDisplayNamePrice{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, matrixWithDisplayNameConfig=$matrixWithDisplayNameConfig, maximum=$maximum, maximumAmount=$maximumAmount, metadata=$metadata, minimum=$minimum, minimumAmount=$minimumAmount, modelType=$modelType, name=$name, planPhaseOrder=$planPhaseOrder, priceType=$priceType, additionalProperties=$additionalProperties}" + "GroupedWithMeteredMinimumPrice{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, cadence=$cadence, conversionRate=$conversionRate, createdAt=$createdAt, creditAllocation=$creditAllocation, currency=$currency, discount=$discount, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, groupedWithMeteredMinimumConfig=$groupedWithMeteredMinimumConfig, invoicingCycleConfiguration=$invoicingCycleConfiguration, item=$item, maximum=$maximum, maximumAmount=$maximumAmount, metadata=$metadata, minimum=$minimum, minimumAmount=$minimumAmount, modelType=$modelType, name=$name, planPhaseOrder=$planPhaseOrder, priceType=$priceType, additionalProperties=$additionalProperties}" } @NoAutoDetect - class BulkWithProrationPrice + class MatrixWithDisplayNamePrice @JsonCreator private constructor( @JsonProperty("id") @ExcludeMissing private val id: JsonField = JsonMissing.of(), @@ -45531,9 +43337,6 @@ private constructor( @ExcludeMissing private val billingCycleConfiguration: JsonField = JsonMissing.of(), - @JsonProperty("bulk_with_proration_config") - @ExcludeMissing - private val bulkWithProrationConfig: JsonField = JsonMissing.of(), @JsonProperty("cadence") @ExcludeMissing private val cadence: JsonField = JsonMissing.of(), @@ -45563,6 +43366,10 @@ private constructor( private val invoicingCycleConfiguration: JsonField = JsonMissing.of(), @JsonProperty("item") @ExcludeMissing private val item: JsonField = JsonMissing.of(), + @JsonProperty("matrix_with_display_name_config") + @ExcludeMissing + private val matrixWithDisplayNameConfig: JsonField = + JsonMissing.of(), @JsonProperty("maximum") @ExcludeMissing private val maximum: JsonField = JsonMissing.of(), @@ -45602,9 +43409,6 @@ private constructor( fun billingCycleConfiguration(): BillingCycleConfiguration = billingCycleConfiguration.getRequired("billing_cycle_configuration") - fun bulkWithProrationConfig(): BulkWithProrationConfig = - bulkWithProrationConfig.getRequired("bulk_with_proration_config") - fun cadence(): Cadence = cadence.getRequired("cadence") fun conversionRate(): Optional = @@ -45632,6 +43436,9 @@ private constructor( fun item(): Item = item.getRequired("item") + fun matrixWithDisplayNameConfig(): MatrixWithDisplayNameConfig = + matrixWithDisplayNameConfig.getRequired("matrix_with_display_name_config") + fun maximum(): Optional = Optional.ofNullable(maximum.getNullable("maximum")) fun maximumAmount(): Optional = @@ -45669,10 +43476,6 @@ private constructor( fun _billingCycleConfiguration(): JsonField = billingCycleConfiguration - @JsonProperty("bulk_with_proration_config") - @ExcludeMissing - fun _bulkWithProrationConfig(): JsonField = bulkWithProrationConfig - @JsonProperty("cadence") @ExcludeMissing fun _cadence(): JsonField = cadence @JsonProperty("conversion_rate") @@ -45706,6 +43509,11 @@ private constructor( @JsonProperty("item") @ExcludeMissing fun _item(): JsonField = item + @JsonProperty("matrix_with_display_name_config") + @ExcludeMissing + fun _matrixWithDisplayNameConfig(): JsonField = + matrixWithDisplayNameConfig + @JsonProperty("maximum") @ExcludeMissing fun _maximum(): JsonField = maximum @JsonProperty("maximum_amount") @@ -45745,7 +43553,7 @@ private constructor( private var validated: Boolean = false - fun validate(): BulkWithProrationPrice = apply { + fun validate(): MatrixWithDisplayNamePrice = apply { if (validated) { return@apply } @@ -45753,7 +43561,6 @@ private constructor( id() billableMetric().ifPresent { it.validate() } billingCycleConfiguration().validate() - bulkWithProrationConfig().validate() cadence() conversionRate() createdAt() @@ -45764,6 +43571,7 @@ private constructor( fixedPriceQuantity() invoicingCycleConfiguration().ifPresent { it.validate() } item().validate() + matrixWithDisplayNameConfig().validate() maximum().ifPresent { it.validate() } maximumAmount() metadata().validate() @@ -45788,7 +43596,6 @@ private constructor( private var id: JsonField? = null private var billableMetric: JsonField? = null private var billingCycleConfiguration: JsonField? = null - private var bulkWithProrationConfig: JsonField? = null private var cadence: JsonField? = null private var conversionRate: JsonField? = null private var createdAt: JsonField? = null @@ -45799,6 +43606,7 @@ private constructor( private var fixedPriceQuantity: JsonField? = null private var invoicingCycleConfiguration: JsonField? = null private var item: JsonField? = null + private var matrixWithDisplayNameConfig: JsonField? = null private var maximum: JsonField? = null private var maximumAmount: JsonField? = null private var metadata: JsonField? = null @@ -45811,31 +43619,32 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(bulkWithProrationPrice: BulkWithProrationPrice) = apply { - id = bulkWithProrationPrice.id - billableMetric = bulkWithProrationPrice.billableMetric - billingCycleConfiguration = bulkWithProrationPrice.billingCycleConfiguration - bulkWithProrationConfig = bulkWithProrationPrice.bulkWithProrationConfig - cadence = bulkWithProrationPrice.cadence - conversionRate = bulkWithProrationPrice.conversionRate - createdAt = bulkWithProrationPrice.createdAt - creditAllocation = bulkWithProrationPrice.creditAllocation - currency = bulkWithProrationPrice.currency - discount = bulkWithProrationPrice.discount - externalPriceId = bulkWithProrationPrice.externalPriceId - fixedPriceQuantity = bulkWithProrationPrice.fixedPriceQuantity - invoicingCycleConfiguration = bulkWithProrationPrice.invoicingCycleConfiguration - item = bulkWithProrationPrice.item - maximum = bulkWithProrationPrice.maximum - maximumAmount = bulkWithProrationPrice.maximumAmount - metadata = bulkWithProrationPrice.metadata - minimum = bulkWithProrationPrice.minimum - minimumAmount = bulkWithProrationPrice.minimumAmount - modelType = bulkWithProrationPrice.modelType - name = bulkWithProrationPrice.name - planPhaseOrder = bulkWithProrationPrice.planPhaseOrder - priceType = bulkWithProrationPrice.priceType - additionalProperties = bulkWithProrationPrice.additionalProperties.toMutableMap() + internal fun from(matrixWithDisplayNamePrice: MatrixWithDisplayNamePrice) = apply { + id = matrixWithDisplayNamePrice.id + billableMetric = matrixWithDisplayNamePrice.billableMetric + billingCycleConfiguration = matrixWithDisplayNamePrice.billingCycleConfiguration + cadence = matrixWithDisplayNamePrice.cadence + conversionRate = matrixWithDisplayNamePrice.conversionRate + createdAt = matrixWithDisplayNamePrice.createdAt + creditAllocation = matrixWithDisplayNamePrice.creditAllocation + currency = matrixWithDisplayNamePrice.currency + discount = matrixWithDisplayNamePrice.discount + externalPriceId = matrixWithDisplayNamePrice.externalPriceId + fixedPriceQuantity = matrixWithDisplayNamePrice.fixedPriceQuantity + invoicingCycleConfiguration = matrixWithDisplayNamePrice.invoicingCycleConfiguration + item = matrixWithDisplayNamePrice.item + matrixWithDisplayNameConfig = matrixWithDisplayNamePrice.matrixWithDisplayNameConfig + maximum = matrixWithDisplayNamePrice.maximum + maximumAmount = matrixWithDisplayNamePrice.maximumAmount + metadata = matrixWithDisplayNamePrice.metadata + minimum = matrixWithDisplayNamePrice.minimum + minimumAmount = matrixWithDisplayNamePrice.minimumAmount + modelType = matrixWithDisplayNamePrice.modelType + name = matrixWithDisplayNamePrice.name + planPhaseOrder = matrixWithDisplayNamePrice.planPhaseOrder + priceType = matrixWithDisplayNamePrice.priceType + additionalProperties = + matrixWithDisplayNamePrice.additionalProperties.toMutableMap() } fun id(id: String) = id(JsonField.of(id)) @@ -45859,13 +43668,6 @@ private constructor( billingCycleConfiguration: JsonField ) = apply { this.billingCycleConfiguration = billingCycleConfiguration } - fun bulkWithProrationConfig(bulkWithProrationConfig: BulkWithProrationConfig) = - bulkWithProrationConfig(JsonField.of(bulkWithProrationConfig)) - - fun bulkWithProrationConfig( - bulkWithProrationConfig: JsonField - ) = apply { this.bulkWithProrationConfig = bulkWithProrationConfig } - fun cadence(cadence: Cadence) = cadence(JsonField.of(cadence)) fun cadence(cadence: JsonField) = apply { this.cadence = cadence } @@ -45961,6 +43763,14 @@ private constructor( fun item(item: JsonField) = apply { this.item = item } + fun matrixWithDisplayNameConfig( + matrixWithDisplayNameConfig: MatrixWithDisplayNameConfig + ) = matrixWithDisplayNameConfig(JsonField.of(matrixWithDisplayNameConfig)) + + fun matrixWithDisplayNameConfig( + matrixWithDisplayNameConfig: JsonField + ) = apply { this.matrixWithDisplayNameConfig = matrixWithDisplayNameConfig } + fun maximum(maximum: Maximum?) = maximum(JsonField.ofNullable(maximum)) fun maximum(maximum: Optional) = maximum(maximum.orElse(null)) @@ -46051,12 +43861,11 @@ private constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): BulkWithProrationPrice = - BulkWithProrationPrice( + fun build(): MatrixWithDisplayNamePrice = + MatrixWithDisplayNamePrice( checkRequired("id", id), checkRequired("billableMetric", billableMetric), checkRequired("billingCycleConfiguration", billingCycleConfiguration), - checkRequired("bulkWithProrationConfig", bulkWithProrationConfig), checkRequired("cadence", cadence), checkRequired("conversionRate", conversionRate), checkRequired("createdAt", createdAt), @@ -46067,6 +43876,7 @@ private constructor( checkRequired("fixedPriceQuantity", fixedPriceQuantity), checkRequired("invoicingCycleConfiguration", invoicingCycleConfiguration), checkRequired("item", item), + checkRequired("matrixWithDisplayNameConfig", matrixWithDisplayNameConfig), checkRequired("maximum", maximum), checkRequired("maximumAmount", maximumAmount), checkRequired("metadata", metadata), @@ -46353,89 +44163,6 @@ private constructor( "BillingCycleConfiguration{duration=$duration, durationUnit=$durationUnit, additionalProperties=$additionalProperties}" } - @NoAutoDetect - class BulkWithProrationConfig - @JsonCreator - private constructor( - @JsonAnySetter - private val additionalProperties: Map = immutableEmptyMap(), - ) { - - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = additionalProperties - - private var validated: Boolean = false - - fun validate(): BulkWithProrationConfig = 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(bulkWithProrationConfig: BulkWithProrationConfig) = apply { - additionalProperties = - bulkWithProrationConfig.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(): BulkWithProrationConfig = - BulkWithProrationConfig(additionalProperties.toImmutable()) - } - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is BulkWithProrationConfig && 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() = - "BulkWithProrationConfig{additionalProperties=$additionalProperties}" - } - class Cadence @JsonCreator private constructor( @@ -46610,10 +44337,302 @@ private constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): CreditAllocation = - CreditAllocation( - checkRequired("allowsRollover", allowsRollover), - checkRequired("currency", currency), + fun build(): CreditAllocation = + CreditAllocation( + checkRequired("allowsRollover", allowsRollover), + checkRequired("currency", currency), + additionalProperties.toImmutable(), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is CreditAllocation && allowsRollover == other.allowsRollover && currency == other.currency && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(allowsRollover, currency, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "CreditAllocation{allowsRollover=$allowsRollover, currency=$currency, additionalProperties=$additionalProperties}" + } + + @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(), + ) { + + fun duration(): Long = duration.getRequired("duration") + + fun durationUnit(): DurationUnit = durationUnit.getRequired("duration_unit") + + @JsonProperty("duration") @ExcludeMissing fun _duration(): JsonField = 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() + } + + fun duration(duration: Long) = duration(JsonField.of(duration)) + + fun duration(duration: JsonField) = apply { this.duration = duration } + + fun durationUnit(durationUnit: DurationUnit) = + durationUnit(JsonField.of(durationUnit)) + + 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}" + } + + @NoAutoDetect + class Item + @JsonCreator + private constructor( + @JsonProperty("id") + @ExcludeMissing + private val id: JsonField = JsonMissing.of(), + @JsonProperty("name") + @ExcludeMissing + private val name: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { + + fun id(): String = id.getRequired("id") + + fun name(): String = name.getRequired("name") + + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): Item = apply { + if (validated) { + return@apply + } + + id() + name() + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + class Builder { + + private var id: JsonField? = null + private var name: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(item: Item) = apply { + id = item.id + name = item.name + additionalProperties = item.additionalProperties.toMutableMap() + } + + fun id(id: String) = id(JsonField.of(id)) + + fun id(id: JsonField) = apply { this.id = id } + + fun name(name: String) = name(JsonField.of(name)) + + fun name(name: JsonField) = apply { this.name = name } + + 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(): Item = + Item( + checkRequired("id", id), + checkRequired("name", name), additionalProperties.toImmutable(), ) } @@ -46623,56 +44642,38 @@ private constructor( return true } - return /* spotless:off */ other is CreditAllocation && allowsRollover == other.allowsRollover && currency == other.currency && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Item && id == other.id && name == other.name && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(allowsRollover, currency, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, name, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "CreditAllocation{allowsRollover=$allowsRollover, currency=$currency, additionalProperties=$additionalProperties}" + "Item{id=$id, name=$name, additionalProperties=$additionalProperties}" } @NoAutoDetect - class InvoicingCycleConfiguration + class MatrixWithDisplayNameConfig @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(), ) { - fun duration(): Long = duration.getRequired("duration") - - fun durationUnit(): DurationUnit = durationUnit.getRequired("duration_unit") - - @JsonProperty("duration") @ExcludeMissing fun _duration(): JsonField = duration - - @JsonProperty("duration_unit") - @ExcludeMissing - fun _durationUnit(): JsonField = durationUnit - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties private var validated: Boolean = false - fun validate(): InvoicingCycleConfiguration = apply { + fun validate(): MatrixWithDisplayNameConfig = apply { if (validated) { return@apply } - duration() - durationUnit() validated = true } @@ -46685,201 +44686,15 @@ private constructor( class Builder { - private var duration: JsonField? = null - private var durationUnit: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(invoicingCycleConfiguration: InvoicingCycleConfiguration) = + internal fun from(matrixWithDisplayNameConfig: MatrixWithDisplayNameConfig) = apply { - duration = invoicingCycleConfiguration.duration - durationUnit = invoicingCycleConfiguration.durationUnit additionalProperties = - invoicingCycleConfiguration.additionalProperties.toMutableMap() - } - - fun duration(duration: Long) = duration(JsonField.of(duration)) - - fun duration(duration: JsonField) = apply { this.duration = duration } - - fun durationUnit(durationUnit: DurationUnit) = - durationUnit(JsonField.of(durationUnit)) - - 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 + matrixWithDisplayNameConfig.additionalProperties.toMutableMap() } - 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}" - } - - @NoAutoDetect - class Item - @JsonCreator - private constructor( - @JsonProperty("id") - @ExcludeMissing - private val id: JsonField = JsonMissing.of(), - @JsonProperty("name") - @ExcludeMissing - private val name: JsonField = JsonMissing.of(), - @JsonAnySetter - private val additionalProperties: Map = immutableEmptyMap(), - ) { - - fun id(): String = id.getRequired("id") - - fun name(): String = name.getRequired("name") - - @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id - - @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name - - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = additionalProperties - - private var validated: Boolean = false - - fun validate(): Item = apply { - if (validated) { - return@apply - } - - id() - name() - validated = true - } - - fun toBuilder() = Builder().from(this) - - companion object { - - @JvmStatic fun builder() = Builder() - } - - class Builder { - - private var id: JsonField? = null - private var name: JsonField? = null - private var additionalProperties: MutableMap = mutableMapOf() - - @JvmSynthetic - internal fun from(item: Item) = apply { - id = item.id - name = item.name - additionalProperties = item.additionalProperties.toMutableMap() - } - - fun id(id: String) = id(JsonField.of(id)) - - fun id(id: JsonField) = apply { this.id = id } - - fun name(name: String) = name(JsonField.of(name)) - - fun name(name: JsonField) = apply { this.name = name } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -46902,12 +44717,8 @@ private constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): Item = - Item( - checkRequired("id", id), - checkRequired("name", name), - additionalProperties.toImmutable(), - ) + fun build(): MatrixWithDisplayNameConfig = + MatrixWithDisplayNameConfig(additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { @@ -46915,17 +44726,17 @@ private constructor( return true } - return /* spotless:off */ other is Item && id == other.id && name == other.name && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is MatrixWithDisplayNameConfig && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, name, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Item{id=$id, name=$name, additionalProperties=$additionalProperties}" + "MatrixWithDisplayNameConfig{additionalProperties=$additionalProperties}" } @NoAutoDetect @@ -47351,29 +45162,29 @@ private constructor( companion object { - @JvmField val BULK_WITH_PRORATION = of("bulk_with_proration") + @JvmField val MATRIX_WITH_DISPLAY_NAME = of("matrix_with_display_name") @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } enum class Known { - BULK_WITH_PRORATION, + MATRIX_WITH_DISPLAY_NAME, } enum class Value { - BULK_WITH_PRORATION, + MATRIX_WITH_DISPLAY_NAME, _UNKNOWN, } fun value(): Value = when (this) { - BULK_WITH_PRORATION -> Value.BULK_WITH_PRORATION + MATRIX_WITH_DISPLAY_NAME -> Value.MATRIX_WITH_DISPLAY_NAME else -> Value._UNKNOWN } fun known(): Known = when (this) { - BULK_WITH_PRORATION -> Known.BULK_WITH_PRORATION + MATRIX_WITH_DISPLAY_NAME -> Known.MATRIX_WITH_DISPLAY_NAME else -> throw OrbInvalidDataException("Unknown ModelType: $value") } @@ -47454,21 +45265,21 @@ private constructor( return true } - return /* spotless:off */ other is BulkWithProrationPrice && id == other.id && billableMetric == other.billableMetric && billingCycleConfiguration == other.billingCycleConfiguration && bulkWithProrationConfig == other.bulkWithProrationConfig && 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 && 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 */ + return /* spotless:off */ other is MatrixWithDisplayNamePrice && 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 && matrixWithDisplayNameConfig == other.matrixWithDisplayNameConfig && 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, bulkWithProrationConfig, cadence, conversionRate, createdAt, creditAllocation, currency, discount, externalPriceId, fixedPriceQuantity, invoicingCycleConfiguration, item, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, billableMetric, billingCycleConfiguration, cadence, conversionRate, createdAt, creditAllocation, currency, discount, externalPriceId, fixedPriceQuantity, invoicingCycleConfiguration, item, matrixWithDisplayNameConfig, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "BulkWithProrationPrice{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, bulkWithProrationConfig=$bulkWithProrationConfig, cadence=$cadence, conversionRate=$conversionRate, createdAt=$createdAt, creditAllocation=$creditAllocation, currency=$currency, discount=$discount, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoicingCycleConfiguration=$invoicingCycleConfiguration, item=$item, maximum=$maximum, maximumAmount=$maximumAmount, metadata=$metadata, minimum=$minimum, minimumAmount=$minimumAmount, modelType=$modelType, name=$name, planPhaseOrder=$planPhaseOrder, priceType=$priceType, additionalProperties=$additionalProperties}" + "MatrixWithDisplayNamePrice{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, matrixWithDisplayNameConfig=$matrixWithDisplayNameConfig, maximum=$maximum, maximumAmount=$maximumAmount, metadata=$metadata, minimum=$minimum, minimumAmount=$minimumAmount, modelType=$modelType, name=$name, planPhaseOrder=$planPhaseOrder, priceType=$priceType, additionalProperties=$additionalProperties}" } @NoAutoDetect - class GroupedTieredPackagePrice + class BulkWithProrationPrice @JsonCreator private constructor( @JsonProperty("id") @ExcludeMissing private val id: JsonField = JsonMissing.of(), @@ -47479,6 +45290,9 @@ private constructor( @ExcludeMissing private val billingCycleConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("bulk_with_proration_config") + @ExcludeMissing + private val bulkWithProrationConfig: JsonField = JsonMissing.of(), @JsonProperty("cadence") @ExcludeMissing private val cadence: JsonField = JsonMissing.of(), @@ -47503,10 +45317,6 @@ private constructor( @JsonProperty("fixed_price_quantity") @ExcludeMissing private val fixedPriceQuantity: JsonField = JsonMissing.of(), - @JsonProperty("grouped_tiered_package_config") - @ExcludeMissing - private val groupedTieredPackageConfig: JsonField = - JsonMissing.of(), @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing private val invoicingCycleConfiguration: JsonField = @@ -47551,6 +45361,9 @@ private constructor( fun billingCycleConfiguration(): BillingCycleConfiguration = billingCycleConfiguration.getRequired("billing_cycle_configuration") + fun bulkWithProrationConfig(): BulkWithProrationConfig = + bulkWithProrationConfig.getRequired("bulk_with_proration_config") + fun cadence(): Cadence = cadence.getRequired("cadence") fun conversionRate(): Optional = @@ -47571,9 +45384,6 @@ private constructor( fun fixedPriceQuantity(): Optional = Optional.ofNullable(fixedPriceQuantity.getNullable("fixed_price_quantity")) - fun groupedTieredPackageConfig(): GroupedTieredPackageConfig = - groupedTieredPackageConfig.getRequired("grouped_tiered_package_config") - fun invoicingCycleConfiguration(): Optional = Optional.ofNullable( invoicingCycleConfiguration.getNullable("invoicing_cycle_configuration") @@ -47618,6 +45428,10 @@ private constructor( fun _billingCycleConfiguration(): JsonField = billingCycleConfiguration + @JsonProperty("bulk_with_proration_config") + @ExcludeMissing + fun _bulkWithProrationConfig(): JsonField = bulkWithProrationConfig + @JsonProperty("cadence") @ExcludeMissing fun _cadence(): JsonField = cadence @JsonProperty("conversion_rate") @@ -47644,11 +45458,6 @@ private constructor( @ExcludeMissing fun _fixedPriceQuantity(): JsonField = fixedPriceQuantity - @JsonProperty("grouped_tiered_package_config") - @ExcludeMissing - fun _groupedTieredPackageConfig(): JsonField = - groupedTieredPackageConfig - @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing fun _invoicingCycleConfiguration(): JsonField = @@ -47695,7 +45504,7 @@ private constructor( private var validated: Boolean = false - fun validate(): GroupedTieredPackagePrice = apply { + fun validate(): BulkWithProrationPrice = apply { if (validated) { return@apply } @@ -47703,6 +45512,7 @@ private constructor( id() billableMetric().ifPresent { it.validate() } billingCycleConfiguration().validate() + bulkWithProrationConfig().validate() cadence() conversionRate() createdAt() @@ -47711,7 +45521,6 @@ private constructor( discount().ifPresent { it.validate() } externalPriceId() fixedPriceQuantity() - groupedTieredPackageConfig().validate() invoicingCycleConfiguration().ifPresent { it.validate() } item().validate() maximum().ifPresent { it.validate() } @@ -47738,6 +45547,7 @@ private constructor( private var id: JsonField? = null private var billableMetric: JsonField? = null private var billingCycleConfiguration: JsonField? = null + private var bulkWithProrationConfig: JsonField? = null private var cadence: JsonField? = null private var conversionRate: JsonField? = null private var createdAt: JsonField? = null @@ -47746,7 +45556,6 @@ private constructor( private var discount: JsonField? = null private var externalPriceId: JsonField? = null private var fixedPriceQuantity: JsonField? = null - private var groupedTieredPackageConfig: JsonField? = null private var invoicingCycleConfiguration: JsonField? = null private var item: JsonField? = null private var maximum: JsonField? = null @@ -47761,31 +45570,31 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(groupedTieredPackagePrice: GroupedTieredPackagePrice) = apply { - id = groupedTieredPackagePrice.id - billableMetric = groupedTieredPackagePrice.billableMetric - billingCycleConfiguration = groupedTieredPackagePrice.billingCycleConfiguration - cadence = groupedTieredPackagePrice.cadence - conversionRate = groupedTieredPackagePrice.conversionRate - createdAt = groupedTieredPackagePrice.createdAt - creditAllocation = groupedTieredPackagePrice.creditAllocation - currency = groupedTieredPackagePrice.currency - discount = groupedTieredPackagePrice.discount - externalPriceId = groupedTieredPackagePrice.externalPriceId - fixedPriceQuantity = groupedTieredPackagePrice.fixedPriceQuantity - groupedTieredPackageConfig = groupedTieredPackagePrice.groupedTieredPackageConfig - invoicingCycleConfiguration = groupedTieredPackagePrice.invoicingCycleConfiguration - item = groupedTieredPackagePrice.item - maximum = groupedTieredPackagePrice.maximum - maximumAmount = groupedTieredPackagePrice.maximumAmount - metadata = groupedTieredPackagePrice.metadata - minimum = groupedTieredPackagePrice.minimum - minimumAmount = groupedTieredPackagePrice.minimumAmount - modelType = groupedTieredPackagePrice.modelType - name = groupedTieredPackagePrice.name - planPhaseOrder = groupedTieredPackagePrice.planPhaseOrder - priceType = groupedTieredPackagePrice.priceType - additionalProperties = groupedTieredPackagePrice.additionalProperties.toMutableMap() + internal fun from(bulkWithProrationPrice: BulkWithProrationPrice) = apply { + id = bulkWithProrationPrice.id + billableMetric = bulkWithProrationPrice.billableMetric + billingCycleConfiguration = bulkWithProrationPrice.billingCycleConfiguration + bulkWithProrationConfig = bulkWithProrationPrice.bulkWithProrationConfig + cadence = bulkWithProrationPrice.cadence + conversionRate = bulkWithProrationPrice.conversionRate + createdAt = bulkWithProrationPrice.createdAt + creditAllocation = bulkWithProrationPrice.creditAllocation + currency = bulkWithProrationPrice.currency + discount = bulkWithProrationPrice.discount + externalPriceId = bulkWithProrationPrice.externalPriceId + fixedPriceQuantity = bulkWithProrationPrice.fixedPriceQuantity + invoicingCycleConfiguration = bulkWithProrationPrice.invoicingCycleConfiguration + item = bulkWithProrationPrice.item + maximum = bulkWithProrationPrice.maximum + maximumAmount = bulkWithProrationPrice.maximumAmount + metadata = bulkWithProrationPrice.metadata + minimum = bulkWithProrationPrice.minimum + minimumAmount = bulkWithProrationPrice.minimumAmount + modelType = bulkWithProrationPrice.modelType + name = bulkWithProrationPrice.name + planPhaseOrder = bulkWithProrationPrice.planPhaseOrder + priceType = bulkWithProrationPrice.priceType + additionalProperties = bulkWithProrationPrice.additionalProperties.toMutableMap() } fun id(id: String) = id(JsonField.of(id)) @@ -47809,6 +45618,13 @@ private constructor( billingCycleConfiguration: JsonField ) = apply { this.billingCycleConfiguration = billingCycleConfiguration } + fun bulkWithProrationConfig(bulkWithProrationConfig: BulkWithProrationConfig) = + bulkWithProrationConfig(JsonField.of(bulkWithProrationConfig)) + + fun bulkWithProrationConfig( + bulkWithProrationConfig: JsonField + ) = apply { this.bulkWithProrationConfig = bulkWithProrationConfig } + fun cadence(cadence: Cadence) = cadence(JsonField.of(cadence)) fun cadence(cadence: JsonField) = apply { this.cadence = cadence } @@ -47888,13 +45704,6 @@ private constructor( this.fixedPriceQuantity = fixedPriceQuantity } - fun groupedTieredPackageConfig(groupedTieredPackageConfig: GroupedTieredPackageConfig) = - groupedTieredPackageConfig(JsonField.of(groupedTieredPackageConfig)) - - fun groupedTieredPackageConfig( - groupedTieredPackageConfig: JsonField - ) = apply { this.groupedTieredPackageConfig = groupedTieredPackageConfig } - fun invoicingCycleConfiguration( invoicingCycleConfiguration: InvoicingCycleConfiguration? ) = invoicingCycleConfiguration(JsonField.ofNullable(invoicingCycleConfiguration)) @@ -48001,11 +45810,12 @@ private constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): GroupedTieredPackagePrice = - GroupedTieredPackagePrice( + fun build(): BulkWithProrationPrice = + BulkWithProrationPrice( checkRequired("id", id), checkRequired("billableMetric", billableMetric), checkRequired("billingCycleConfiguration", billingCycleConfiguration), + checkRequired("bulkWithProrationConfig", bulkWithProrationConfig), checkRequired("cadence", cadence), checkRequired("conversionRate", conversionRate), checkRequired("createdAt", createdAt), @@ -48014,7 +45824,6 @@ private constructor( checkRequired("discount", discount), checkRequired("externalPriceId", externalPriceId), checkRequired("fixedPriceQuantity", fixedPriceQuantity), - checkRequired("groupedTieredPackageConfig", groupedTieredPackageConfig), checkRequired("invoicingCycleConfiguration", invoicingCycleConfiguration), checkRequired("item", item), checkRequired("maximum", maximum), @@ -48303,6 +46112,89 @@ private constructor( "BillingCycleConfiguration{duration=$duration, durationUnit=$durationUnit, additionalProperties=$additionalProperties}" } + @NoAutoDetect + class BulkWithProrationConfig + @JsonCreator + private constructor( + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): BulkWithProrationConfig = 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(bulkWithProrationConfig: BulkWithProrationConfig) = apply { + additionalProperties = + bulkWithProrationConfig.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(): BulkWithProrationConfig = + BulkWithProrationConfig(additionalProperties.toImmutable()) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is BulkWithProrationConfig && 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() = + "BulkWithProrationConfig{additionalProperties=$additionalProperties}" + } + class Cadence @JsonCreator private constructor( @@ -48503,89 +46395,6 @@ private constructor( "CreditAllocation{allowsRollover=$allowsRollover, currency=$currency, additionalProperties=$additionalProperties}" } - @NoAutoDetect - class GroupedTieredPackageConfig - @JsonCreator - private constructor( - @JsonAnySetter - private val additionalProperties: Map = immutableEmptyMap(), - ) { - - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = additionalProperties - - private var validated: Boolean = false - - fun validate(): GroupedTieredPackageConfig = 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(groupedTieredPackageConfig: GroupedTieredPackageConfig) = apply { - additionalProperties = - groupedTieredPackageConfig.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(): GroupedTieredPackageConfig = - GroupedTieredPackageConfig(additionalProperties.toImmutable()) - } - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is GroupedTieredPackageConfig && 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() = - "GroupedTieredPackageConfig{additionalProperties=$additionalProperties}" - } - @NoAutoDetect class InvoicingCycleConfiguration @JsonCreator @@ -49301,29 +47110,29 @@ private constructor( companion object { - @JvmField val GROUPED_TIERED_PACKAGE = of("grouped_tiered_package") + @JvmField val BULK_WITH_PRORATION = of("bulk_with_proration") @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } enum class Known { - GROUPED_TIERED_PACKAGE, + BULK_WITH_PRORATION, } enum class Value { - GROUPED_TIERED_PACKAGE, + BULK_WITH_PRORATION, _UNKNOWN, } fun value(): Value = when (this) { - GROUPED_TIERED_PACKAGE -> Value.GROUPED_TIERED_PACKAGE + BULK_WITH_PRORATION -> Value.BULK_WITH_PRORATION else -> Value._UNKNOWN } fun known(): Known = when (this) { - GROUPED_TIERED_PACKAGE -> Known.GROUPED_TIERED_PACKAGE + BULK_WITH_PRORATION -> Known.BULK_WITH_PRORATION else -> throw OrbInvalidDataException("Unknown ModelType: $value") } @@ -49404,21 +47213,21 @@ private constructor( return true } - return /* spotless:off */ other is GroupedTieredPackagePrice && 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 && groupedTieredPackageConfig == other.groupedTieredPackageConfig && invoicingCycleConfiguration == other.invoicingCycleConfiguration && item == other.item && 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 */ + return /* spotless:off */ other is BulkWithProrationPrice && id == other.id && billableMetric == other.billableMetric && billingCycleConfiguration == other.billingCycleConfiguration && bulkWithProrationConfig == other.bulkWithProrationConfig && 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 && 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, groupedTieredPackageConfig, invoicingCycleConfiguration, item, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, billableMetric, billingCycleConfiguration, bulkWithProrationConfig, cadence, conversionRate, createdAt, creditAllocation, currency, discount, externalPriceId, fixedPriceQuantity, invoicingCycleConfiguration, item, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "GroupedTieredPackagePrice{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, cadence=$cadence, conversionRate=$conversionRate, createdAt=$createdAt, creditAllocation=$creditAllocation, currency=$currency, discount=$discount, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, groupedTieredPackageConfig=$groupedTieredPackageConfig, invoicingCycleConfiguration=$invoicingCycleConfiguration, item=$item, maximum=$maximum, maximumAmount=$maximumAmount, metadata=$metadata, minimum=$minimum, minimumAmount=$minimumAmount, modelType=$modelType, name=$name, planPhaseOrder=$planPhaseOrder, priceType=$priceType, additionalProperties=$additionalProperties}" + "BulkWithProrationPrice{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, bulkWithProrationConfig=$bulkWithProrationConfig, cadence=$cadence, conversionRate=$conversionRate, createdAt=$createdAt, creditAllocation=$creditAllocation, currency=$currency, discount=$discount, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoicingCycleConfiguration=$invoicingCycleConfiguration, item=$item, maximum=$maximum, maximumAmount=$maximumAmount, metadata=$metadata, minimum=$minimum, minimumAmount=$minimumAmount, modelType=$modelType, name=$name, planPhaseOrder=$planPhaseOrder, priceType=$priceType, additionalProperties=$additionalProperties}" } @NoAutoDetect - class MaxGroupTieredPrice + class GroupedTieredPackagePrice @JsonCreator private constructor( @JsonProperty("id") @ExcludeMissing private val id: JsonField = JsonMissing.of(), @@ -49453,14 +47262,15 @@ private constructor( @JsonProperty("fixed_price_quantity") @ExcludeMissing private val fixedPriceQuantity: JsonField = JsonMissing.of(), + @JsonProperty("grouped_tiered_package_config") + @ExcludeMissing + private val groupedTieredPackageConfig: JsonField = + JsonMissing.of(), @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing private val invoicingCycleConfiguration: JsonField = JsonMissing.of(), @JsonProperty("item") @ExcludeMissing private val item: JsonField = JsonMissing.of(), - @JsonProperty("max_group_tiered_config") - @ExcludeMissing - private val maxGroupTieredConfig: JsonField = JsonMissing.of(), @JsonProperty("maximum") @ExcludeMissing private val maximum: JsonField = JsonMissing.of(), @@ -49520,6 +47330,9 @@ private constructor( fun fixedPriceQuantity(): Optional = Optional.ofNullable(fixedPriceQuantity.getNullable("fixed_price_quantity")) + fun groupedTieredPackageConfig(): GroupedTieredPackageConfig = + groupedTieredPackageConfig.getRequired("grouped_tiered_package_config") + fun invoicingCycleConfiguration(): Optional = Optional.ofNullable( invoicingCycleConfiguration.getNullable("invoicing_cycle_configuration") @@ -49527,9 +47340,6 @@ private constructor( fun item(): Item = item.getRequired("item") - fun maxGroupTieredConfig(): MaxGroupTieredConfig = - maxGroupTieredConfig.getRequired("max_group_tiered_config") - fun maximum(): Optional = Optional.ofNullable(maximum.getNullable("maximum")) fun maximumAmount(): Optional = @@ -49593,6 +47403,11 @@ private constructor( @ExcludeMissing fun _fixedPriceQuantity(): JsonField = fixedPriceQuantity + @JsonProperty("grouped_tiered_package_config") + @ExcludeMissing + fun _groupedTieredPackageConfig(): JsonField = + groupedTieredPackageConfig + @JsonProperty("invoicing_cycle_configuration") @ExcludeMissing fun _invoicingCycleConfiguration(): JsonField = @@ -49600,10 +47415,6 @@ private constructor( @JsonProperty("item") @ExcludeMissing fun _item(): JsonField = item - @JsonProperty("max_group_tiered_config") - @ExcludeMissing - fun _maxGroupTieredConfig(): JsonField = maxGroupTieredConfig - @JsonProperty("maximum") @ExcludeMissing fun _maximum(): JsonField = maximum @JsonProperty("maximum_amount") @@ -49643,7 +47454,7 @@ private constructor( private var validated: Boolean = false - fun validate(): MaxGroupTieredPrice = apply { + fun validate(): GroupedTieredPackagePrice = apply { if (validated) { return@apply } @@ -49659,9 +47470,9 @@ private constructor( discount().ifPresent { it.validate() } externalPriceId() fixedPriceQuantity() + groupedTieredPackageConfig().validate() invoicingCycleConfiguration().ifPresent { it.validate() } item().validate() - maxGroupTieredConfig().validate() maximum().ifPresent { it.validate() } maximumAmount() metadata().validate() @@ -49694,9 +47505,9 @@ private constructor( private var discount: JsonField? = null private var externalPriceId: JsonField? = null private var fixedPriceQuantity: JsonField? = null + private var groupedTieredPackageConfig: JsonField? = null private var invoicingCycleConfiguration: JsonField? = null private var item: JsonField? = null - private var maxGroupTieredConfig: JsonField? = null private var maximum: JsonField? = null private var maximumAmount: JsonField? = null private var metadata: JsonField? = null @@ -49709,31 +47520,31 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(maxGroupTieredPrice: MaxGroupTieredPrice) = apply { - id = maxGroupTieredPrice.id - billableMetric = maxGroupTieredPrice.billableMetric - billingCycleConfiguration = maxGroupTieredPrice.billingCycleConfiguration - cadence = maxGroupTieredPrice.cadence - conversionRate = maxGroupTieredPrice.conversionRate - createdAt = maxGroupTieredPrice.createdAt - creditAllocation = maxGroupTieredPrice.creditAllocation - currency = maxGroupTieredPrice.currency - discount = maxGroupTieredPrice.discount - externalPriceId = maxGroupTieredPrice.externalPriceId - fixedPriceQuantity = maxGroupTieredPrice.fixedPriceQuantity - invoicingCycleConfiguration = maxGroupTieredPrice.invoicingCycleConfiguration - item = maxGroupTieredPrice.item - maxGroupTieredConfig = maxGroupTieredPrice.maxGroupTieredConfig - maximum = maxGroupTieredPrice.maximum - maximumAmount = maxGroupTieredPrice.maximumAmount - metadata = maxGroupTieredPrice.metadata - minimum = maxGroupTieredPrice.minimum - minimumAmount = maxGroupTieredPrice.minimumAmount - modelType = maxGroupTieredPrice.modelType - name = maxGroupTieredPrice.name - planPhaseOrder = maxGroupTieredPrice.planPhaseOrder - priceType = maxGroupTieredPrice.priceType - additionalProperties = maxGroupTieredPrice.additionalProperties.toMutableMap() + internal fun from(groupedTieredPackagePrice: GroupedTieredPackagePrice) = apply { + id = groupedTieredPackagePrice.id + billableMetric = groupedTieredPackagePrice.billableMetric + billingCycleConfiguration = groupedTieredPackagePrice.billingCycleConfiguration + cadence = groupedTieredPackagePrice.cadence + conversionRate = groupedTieredPackagePrice.conversionRate + createdAt = groupedTieredPackagePrice.createdAt + creditAllocation = groupedTieredPackagePrice.creditAllocation + currency = groupedTieredPackagePrice.currency + discount = groupedTieredPackagePrice.discount + externalPriceId = groupedTieredPackagePrice.externalPriceId + fixedPriceQuantity = groupedTieredPackagePrice.fixedPriceQuantity + groupedTieredPackageConfig = groupedTieredPackagePrice.groupedTieredPackageConfig + invoicingCycleConfiguration = groupedTieredPackagePrice.invoicingCycleConfiguration + item = groupedTieredPackagePrice.item + maximum = groupedTieredPackagePrice.maximum + maximumAmount = groupedTieredPackagePrice.maximumAmount + metadata = groupedTieredPackagePrice.metadata + minimum = groupedTieredPackagePrice.minimum + minimumAmount = groupedTieredPackagePrice.minimumAmount + modelType = groupedTieredPackagePrice.modelType + name = groupedTieredPackagePrice.name + planPhaseOrder = groupedTieredPackagePrice.planPhaseOrder + priceType = groupedTieredPackagePrice.priceType + additionalProperties = groupedTieredPackagePrice.additionalProperties.toMutableMap() } fun id(id: String) = id(JsonField.of(id)) @@ -49836,6 +47647,13 @@ private constructor( this.fixedPriceQuantity = fixedPriceQuantity } + fun groupedTieredPackageConfig(groupedTieredPackageConfig: GroupedTieredPackageConfig) = + groupedTieredPackageConfig(JsonField.of(groupedTieredPackageConfig)) + + fun groupedTieredPackageConfig( + groupedTieredPackageConfig: JsonField + ) = apply { this.groupedTieredPackageConfig = groupedTieredPackageConfig } + fun invoicingCycleConfiguration( invoicingCycleConfiguration: InvoicingCycleConfiguration? ) = invoicingCycleConfiguration(JsonField.ofNullable(invoicingCycleConfiguration)) @@ -49852,14 +47670,6 @@ private constructor( fun item(item: JsonField) = apply { this.item = item } - fun maxGroupTieredConfig(maxGroupTieredConfig: MaxGroupTieredConfig) = - maxGroupTieredConfig(JsonField.of(maxGroupTieredConfig)) - - fun maxGroupTieredConfig(maxGroupTieredConfig: JsonField) = - apply { - this.maxGroupTieredConfig = maxGroupTieredConfig - } - fun maximum(maximum: Maximum?) = maximum(JsonField.ofNullable(maximum)) fun maximum(maximum: Optional) = maximum(maximum.orElse(null)) @@ -49950,8 +47760,8 @@ private constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): MaxGroupTieredPrice = - MaxGroupTieredPrice( + fun build(): GroupedTieredPackagePrice = + GroupedTieredPackagePrice( checkRequired("id", id), checkRequired("billableMetric", billableMetric), checkRequired("billingCycleConfiguration", billingCycleConfiguration), @@ -49963,9 +47773,9 @@ private constructor( checkRequired("discount", discount), checkRequired("externalPriceId", externalPriceId), checkRequired("fixedPriceQuantity", fixedPriceQuantity), + checkRequired("groupedTieredPackageConfig", groupedTieredPackageConfig), checkRequired("invoicingCycleConfiguration", invoicingCycleConfiguration), checkRequired("item", item), - checkRequired("maxGroupTieredConfig", maxGroupTieredConfig), checkRequired("maximum", maximum), checkRequired("maximumAmount", maximumAmount), checkRequired("metadata", metadata), @@ -50169,207 +47979,308 @@ private constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): BillingCycleConfiguration = - BillingCycleConfiguration( - checkRequired("duration", duration), - checkRequired("durationUnit", durationUnit), + 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}" + } + + class Cadence + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val ONE_TIME = of("one_time") + + @JvmField val MONTHLY = of("monthly") + + @JvmField val QUARTERLY = of("quarterly") + + @JvmField val SEMI_ANNUAL = of("semi_annual") + + @JvmField val ANNUAL = of("annual") + + @JvmField val CUSTOM = of("custom") + + @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) + } + + enum class Known { + ONE_TIME, + MONTHLY, + QUARTERLY, + SEMI_ANNUAL, + ANNUAL, + CUSTOM, + } + + enum class Value { + ONE_TIME, + MONTHLY, + QUARTERLY, + SEMI_ANNUAL, + ANNUAL, + CUSTOM, + _UNKNOWN, + } + + fun value(): Value = + when (this) { + ONE_TIME -> Value.ONE_TIME + MONTHLY -> Value.MONTHLY + QUARTERLY -> Value.QUARTERLY + SEMI_ANNUAL -> Value.SEMI_ANNUAL + ANNUAL -> Value.ANNUAL + CUSTOM -> Value.CUSTOM + else -> Value._UNKNOWN + } + + fun known(): Known = + when (this) { + ONE_TIME -> Known.ONE_TIME + MONTHLY -> Known.MONTHLY + QUARTERLY -> Known.QUARTERLY + SEMI_ANNUAL -> Known.SEMI_ANNUAL + ANNUAL -> Known.ANNUAL + 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 CreditAllocation + @JsonCreator + private constructor( + @JsonProperty("allows_rollover") + @ExcludeMissing + private val allowsRollover: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + private val currency: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { + + fun allowsRollover(): Boolean = allowsRollover.getRequired("allows_rollover") + + fun currency(): String = currency.getRequired("currency") + + @JsonProperty("allows_rollover") + @ExcludeMissing + fun _allowsRollover(): JsonField = allowsRollover + + @JsonProperty("currency") @ExcludeMissing fun _currency(): JsonField = currency + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): CreditAllocation = apply { + if (validated) { + return@apply + } + + allowsRollover() + currency() + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + class Builder { + + private var allowsRollover: JsonField? = null + private var currency: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(creditAllocation: CreditAllocation) = apply { + allowsRollover = creditAllocation.allowsRollover + currency = creditAllocation.currency + additionalProperties = creditAllocation.additionalProperties.toMutableMap() + } + + fun allowsRollover(allowsRollover: Boolean) = + allowsRollover(JsonField.of(allowsRollover)) + + fun allowsRollover(allowsRollover: JsonField) = apply { + this.allowsRollover = allowsRollover + } + + fun currency(currency: String) = currency(JsonField.of(currency)) + + fun currency(currency: JsonField) = apply { this.currency = currency } + + 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(): CreditAllocation = + CreditAllocation( + checkRequired("allowsRollover", allowsRollover), + checkRequired("currency", currency), 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 */ + return /* spotless:off */ other is CreditAllocation && allowsRollover == other.allowsRollover && currency == other.currency && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(duration, durationUnit, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(allowsRollover, currency, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "BillingCycleConfiguration{duration=$duration, durationUnit=$durationUnit, additionalProperties=$additionalProperties}" - } - - class Cadence - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { - - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - - companion object { - - @JvmField val ONE_TIME = of("one_time") - - @JvmField val MONTHLY = of("monthly") - - @JvmField val QUARTERLY = of("quarterly") - - @JvmField val SEMI_ANNUAL = of("semi_annual") - - @JvmField val ANNUAL = of("annual") - - @JvmField val CUSTOM = of("custom") - - @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) - } - - enum class Known { - ONE_TIME, - MONTHLY, - QUARTERLY, - SEMI_ANNUAL, - ANNUAL, - CUSTOM, - } - - enum class Value { - ONE_TIME, - MONTHLY, - QUARTERLY, - SEMI_ANNUAL, - ANNUAL, - CUSTOM, - _UNKNOWN, - } - - fun value(): Value = - when (this) { - ONE_TIME -> Value.ONE_TIME - MONTHLY -> Value.MONTHLY - QUARTERLY -> Value.QUARTERLY - SEMI_ANNUAL -> Value.SEMI_ANNUAL - ANNUAL -> Value.ANNUAL - CUSTOM -> Value.CUSTOM - else -> Value._UNKNOWN - } - - fun known(): Known = - when (this) { - ONE_TIME -> Known.ONE_TIME - MONTHLY -> Known.MONTHLY - QUARTERLY -> Known.QUARTERLY - SEMI_ANNUAL -> Known.SEMI_ANNUAL - ANNUAL -> Known.ANNUAL - 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() + "CreditAllocation{allowsRollover=$allowsRollover, currency=$currency, additionalProperties=$additionalProperties}" } @NoAutoDetect - class CreditAllocation + class GroupedTieredPackageConfig @JsonCreator private constructor( - @JsonProperty("allows_rollover") - @ExcludeMissing - private val allowsRollover: JsonField = JsonMissing.of(), - @JsonProperty("currency") - @ExcludeMissing - private val currency: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - fun allowsRollover(): Boolean = allowsRollover.getRequired("allows_rollover") - - fun currency(): String = currency.getRequired("currency") - - @JsonProperty("allows_rollover") - @ExcludeMissing - fun _allowsRollover(): JsonField = allowsRollover - - @JsonProperty("currency") @ExcludeMissing fun _currency(): JsonField = currency - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties private var validated: Boolean = false - fun validate(): CreditAllocation = apply { + fun validate(): GroupedTieredPackageConfig = apply { if (validated) { return@apply } - allowsRollover() - currency() validated = true } @@ -50382,28 +48293,14 @@ private constructor( class Builder { - private var allowsRollover: JsonField? = null - private var currency: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(creditAllocation: CreditAllocation) = apply { - allowsRollover = creditAllocation.allowsRollover - currency = creditAllocation.currency - additionalProperties = creditAllocation.additionalProperties.toMutableMap() - } - - fun allowsRollover(allowsRollover: Boolean) = - allowsRollover(JsonField.of(allowsRollover)) - - fun allowsRollover(allowsRollover: JsonField) = apply { - this.allowsRollover = allowsRollover + internal fun from(groupedTieredPackageConfig: GroupedTieredPackageConfig) = apply { + additionalProperties = + groupedTieredPackageConfig.additionalProperties.toMutableMap() } - fun currency(currency: String) = currency(JsonField.of(currency)) - - fun currency(currency: JsonField) = apply { this.currency = currency } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -50426,12 +48323,8 @@ private constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): CreditAllocation = - CreditAllocation( - checkRequired("allowsRollover", allowsRollover), - checkRequired("currency", currency), - additionalProperties.toImmutable(), - ) + fun build(): GroupedTieredPackageConfig = + GroupedTieredPackageConfig(additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { @@ -50439,17 +48332,17 @@ private constructor( return true } - return /* spotless:off */ other is CreditAllocation && allowsRollover == other.allowsRollover && currency == other.currency && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is GroupedTieredPackageConfig && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(allowsRollover, currency, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "CreditAllocation{allowsRollover=$allowsRollover, currency=$currency, additionalProperties=$additionalProperties}" + "GroupedTieredPackageConfig{additionalProperties=$additionalProperties}" } @NoAutoDetect @@ -50744,88 +48637,6 @@ private constructor( "Item{id=$id, name=$name, additionalProperties=$additionalProperties}" } - @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}" - } - @NoAutoDetect class Maximum @JsonCreator @@ -51249,29 +49060,29 @@ private constructor( companion object { - @JvmField val MAX_GROUP_TIERED = of("max_group_tiered") + @JvmField val GROUPED_TIERED_PACKAGE = of("grouped_tiered_package") @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } enum class Known { - MAX_GROUP_TIERED, + GROUPED_TIERED_PACKAGE, } enum class Value { - MAX_GROUP_TIERED, + GROUPED_TIERED_PACKAGE, _UNKNOWN, } fun value(): Value = when (this) { - MAX_GROUP_TIERED -> Value.MAX_GROUP_TIERED + GROUPED_TIERED_PACKAGE -> Value.GROUPED_TIERED_PACKAGE else -> Value._UNKNOWN } fun known(): Known = when (this) { - MAX_GROUP_TIERED -> Known.MAX_GROUP_TIERED + GROUPED_TIERED_PACKAGE -> Known.GROUPED_TIERED_PACKAGE else -> throw OrbInvalidDataException("Unknown ModelType: $value") } @@ -51352,16 +49163,16 @@ private constructor( return true } - return /* spotless:off */ other is MaxGroupTieredPrice && 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 && maxGroupTieredConfig == other.maxGroupTieredConfig && 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 */ + return /* spotless:off */ other is GroupedTieredPackagePrice && 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 && groupedTieredPackageConfig == other.groupedTieredPackageConfig && invoicingCycleConfiguration == other.invoicingCycleConfiguration && item == other.item && 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, maxGroupTieredConfig, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, billableMetric, billingCycleConfiguration, cadence, conversionRate, createdAt, creditAllocation, currency, discount, externalPriceId, fixedPriceQuantity, groupedTieredPackageConfig, invoicingCycleConfiguration, item, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "MaxGroupTieredPrice{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, maxGroupTieredConfig=$maxGroupTieredConfig, maximum=$maximum, maximumAmount=$maximumAmount, metadata=$metadata, minimum=$minimum, minimumAmount=$minimumAmount, modelType=$modelType, name=$name, planPhaseOrder=$planPhaseOrder, priceType=$priceType, additionalProperties=$additionalProperties}" + "GroupedTieredPackagePrice{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, cadence=$cadence, conversionRate=$conversionRate, createdAt=$createdAt, creditAllocation=$creditAllocation, currency=$currency, discount=$discount, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, groupedTieredPackageConfig=$groupedTieredPackageConfig, invoicingCycleConfiguration=$invoicingCycleConfiguration, item=$item, maximum=$maximum, maximumAmount=$maximumAmount, metadata=$metadata, minimum=$minimum, minimumAmount=$minimumAmount, modelType=$modelType, name=$name, planPhaseOrder=$planPhaseOrder, priceType=$priceType, additionalProperties=$additionalProperties}" } } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceCreateParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceCreateParams.kt index 2f3b9cc1..e570858f 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceCreateParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceCreateParams.kt @@ -33,15 +33,16 @@ import java.util.Optional import kotlin.jvm.optionals.getOrNull /** - * This endpoint is used to create a [price](../reference/price). A price created using this - * endpoint is always an add-on, meaning that it’s not associated with a specific plan and can - * instead be individually added to subscriptions, including subscriptions on different plans. + * This endpoint is used to create a [price](/product-catalog/price-configuration). A price created + * using this endpoint is always an add-on, meaning that it’s not associated with a specific plan + * and can instead be individually added to subscriptions, including subscriptions on different + * plans. * * An `external_price_id` can be optionally specified as an alias to allow ergonomic interaction * with prices in the Orb API. * - * See the [Price resource](../reference/price) for the specification of different price model - * configurations possible in this endpoint. + * See the [Price resource](/product-catalog/price-configuration) for the specification of different + * price model configurations possible in this endpoint. */ class PriceCreateParams constructor( @@ -81,9 +82,6 @@ constructor( fun newFloatingGroupedTieredPrice(): Optional = body.newFloatingGroupedTieredPrice() - fun newFloatingMaxGroupTieredPrice(): Optional = - body.newFloatingMaxGroupTieredPrice() - fun newFloatingTieredWithMinimumPrice(): Optional = body.newFloatingTieredWithMinimumPrice() @@ -151,7 +149,6 @@ constructor( null, private val newFloatingTieredPackagePrice: NewFloatingTieredPackagePrice? = null, private val newFloatingGroupedTieredPrice: NewFloatingGroupedTieredPrice? = null, - private val newFloatingMaxGroupTieredPrice: NewFloatingMaxGroupTieredPrice? = null, private val newFloatingTieredWithMinimumPrice: NewFloatingTieredWithMinimumPrice? = null, private val newFloatingPackageWithAllocationPrice: NewFloatingPackageWithAllocationPrice? = null, @@ -213,9 +210,6 @@ constructor( fun newFloatingGroupedTieredPrice(): Optional = Optional.ofNullable(newFloatingGroupedTieredPrice) - fun newFloatingMaxGroupTieredPrice(): Optional = - Optional.ofNullable(newFloatingMaxGroupTieredPrice) - fun newFloatingTieredWithMinimumPrice(): Optional = Optional.ofNullable(newFloatingTieredWithMinimumPrice) @@ -283,8 +277,6 @@ constructor( fun isNewFloatingGroupedTieredPrice(): Boolean = newFloatingGroupedTieredPrice != null - fun isNewFloatingMaxGroupTieredPrice(): Boolean = newFloatingMaxGroupTieredPrice != null - fun isNewFloatingTieredWithMinimumPrice(): Boolean = newFloatingTieredWithMinimumPrice != null @@ -356,9 +348,6 @@ constructor( fun asNewFloatingGroupedTieredPrice(): NewFloatingGroupedTieredPrice = newFloatingGroupedTieredPrice.getOrThrow("newFloatingGroupedTieredPrice") - fun asNewFloatingMaxGroupTieredPrice(): NewFloatingMaxGroupTieredPrice = - newFloatingMaxGroupTieredPrice.getOrThrow("newFloatingMaxGroupTieredPrice") - fun asNewFloatingTieredWithMinimumPrice(): NewFloatingTieredWithMinimumPrice = newFloatingTieredWithMinimumPrice.getOrThrow("newFloatingTieredWithMinimumPrice") @@ -438,8 +427,6 @@ constructor( visitor.visitNewFloatingTieredPackagePrice(newFloatingTieredPackagePrice) newFloatingGroupedTieredPrice != null -> visitor.visitNewFloatingGroupedTieredPrice(newFloatingGroupedTieredPrice) - newFloatingMaxGroupTieredPrice != null -> - visitor.visitNewFloatingMaxGroupTieredPrice(newFloatingMaxGroupTieredPrice) newFloatingTieredWithMinimumPrice != null -> visitor.visitNewFloatingTieredWithMinimumPrice( newFloatingTieredWithMinimumPrice @@ -495,10 +482,10 @@ constructor( return true } - return /* spotless:off */ other is PriceCreateBody && newFloatingUnitPrice == other.newFloatingUnitPrice && newFloatingPackagePrice == other.newFloatingPackagePrice && newFloatingMatrixPrice == other.newFloatingMatrixPrice && newFloatingMatrixWithAllocationPrice == other.newFloatingMatrixWithAllocationPrice && newFloatingTieredPrice == other.newFloatingTieredPrice && newFloatingTieredBpsPrice == other.newFloatingTieredBpsPrice && newFloatingBpsPrice == other.newFloatingBpsPrice && newFloatingBulkBpsPrice == other.newFloatingBulkBpsPrice && newFloatingBulkPrice == other.newFloatingBulkPrice && newFloatingThresholdTotalAmountPrice == other.newFloatingThresholdTotalAmountPrice && newFloatingTieredPackagePrice == other.newFloatingTieredPackagePrice && newFloatingGroupedTieredPrice == other.newFloatingGroupedTieredPrice && newFloatingMaxGroupTieredPrice == other.newFloatingMaxGroupTieredPrice && newFloatingTieredWithMinimumPrice == other.newFloatingTieredWithMinimumPrice && newFloatingPackageWithAllocationPrice == other.newFloatingPackageWithAllocationPrice && newFloatingTieredPackageWithMinimumPrice == other.newFloatingTieredPackageWithMinimumPrice && newFloatingUnitWithPercentPrice == other.newFloatingUnitWithPercentPrice && newFloatingTieredWithProrationPrice == other.newFloatingTieredWithProrationPrice && newFloatingUnitWithProrationPrice == other.newFloatingUnitWithProrationPrice && newFloatingGroupedAllocationPrice == other.newFloatingGroupedAllocationPrice && newFloatingGroupedWithProratedMinimumPrice == other.newFloatingGroupedWithProratedMinimumPrice && newFloatingGroupedWithMeteredMinimumPrice == other.newFloatingGroupedWithMeteredMinimumPrice && newFloatingMatrixWithDisplayNamePrice == other.newFloatingMatrixWithDisplayNamePrice && newFloatingBulkWithProrationPrice == other.newFloatingBulkWithProrationPrice && newFloatingGroupedTieredPackagePrice == other.newFloatingGroupedTieredPackagePrice /* spotless:on */ + return /* spotless:off */ other is PriceCreateBody && newFloatingUnitPrice == other.newFloatingUnitPrice && newFloatingPackagePrice == other.newFloatingPackagePrice && newFloatingMatrixPrice == other.newFloatingMatrixPrice && newFloatingMatrixWithAllocationPrice == other.newFloatingMatrixWithAllocationPrice && newFloatingTieredPrice == other.newFloatingTieredPrice && newFloatingTieredBpsPrice == other.newFloatingTieredBpsPrice && newFloatingBpsPrice == other.newFloatingBpsPrice && newFloatingBulkBpsPrice == other.newFloatingBulkBpsPrice && newFloatingBulkPrice == other.newFloatingBulkPrice && newFloatingThresholdTotalAmountPrice == other.newFloatingThresholdTotalAmountPrice && newFloatingTieredPackagePrice == other.newFloatingTieredPackagePrice && newFloatingGroupedTieredPrice == other.newFloatingGroupedTieredPrice && newFloatingTieredWithMinimumPrice == other.newFloatingTieredWithMinimumPrice && newFloatingPackageWithAllocationPrice == other.newFloatingPackageWithAllocationPrice && newFloatingTieredPackageWithMinimumPrice == other.newFloatingTieredPackageWithMinimumPrice && newFloatingUnitWithPercentPrice == other.newFloatingUnitWithPercentPrice && newFloatingTieredWithProrationPrice == other.newFloatingTieredWithProrationPrice && newFloatingUnitWithProrationPrice == other.newFloatingUnitWithProrationPrice && newFloatingGroupedAllocationPrice == other.newFloatingGroupedAllocationPrice && newFloatingGroupedWithProratedMinimumPrice == other.newFloatingGroupedWithProratedMinimumPrice && newFloatingGroupedWithMeteredMinimumPrice == other.newFloatingGroupedWithMeteredMinimumPrice && newFloatingMatrixWithDisplayNamePrice == other.newFloatingMatrixWithDisplayNamePrice && newFloatingBulkWithProrationPrice == other.newFloatingBulkWithProrationPrice && newFloatingGroupedTieredPackagePrice == other.newFloatingGroupedTieredPackagePrice /* spotless:on */ } - override fun hashCode(): Int = /* spotless:off */ Objects.hash(newFloatingUnitPrice, newFloatingPackagePrice, newFloatingMatrixPrice, newFloatingMatrixWithAllocationPrice, newFloatingTieredPrice, newFloatingTieredBpsPrice, newFloatingBpsPrice, newFloatingBulkBpsPrice, newFloatingBulkPrice, newFloatingThresholdTotalAmountPrice, newFloatingTieredPackagePrice, newFloatingGroupedTieredPrice, newFloatingMaxGroupTieredPrice, newFloatingTieredWithMinimumPrice, newFloatingPackageWithAllocationPrice, newFloatingTieredPackageWithMinimumPrice, newFloatingUnitWithPercentPrice, newFloatingTieredWithProrationPrice, newFloatingUnitWithProrationPrice, newFloatingGroupedAllocationPrice, newFloatingGroupedWithProratedMinimumPrice, newFloatingGroupedWithMeteredMinimumPrice, newFloatingMatrixWithDisplayNamePrice, newFloatingBulkWithProrationPrice, newFloatingGroupedTieredPackagePrice) /* spotless:on */ + override fun hashCode(): Int = /* spotless:off */ Objects.hash(newFloatingUnitPrice, newFloatingPackagePrice, newFloatingMatrixPrice, newFloatingMatrixWithAllocationPrice, newFloatingTieredPrice, newFloatingTieredBpsPrice, newFloatingBpsPrice, newFloatingBulkBpsPrice, newFloatingBulkPrice, newFloatingThresholdTotalAmountPrice, newFloatingTieredPackagePrice, newFloatingGroupedTieredPrice, newFloatingTieredWithMinimumPrice, newFloatingPackageWithAllocationPrice, newFloatingTieredPackageWithMinimumPrice, newFloatingUnitWithPercentPrice, newFloatingTieredWithProrationPrice, newFloatingUnitWithProrationPrice, newFloatingGroupedAllocationPrice, newFloatingGroupedWithProratedMinimumPrice, newFloatingGroupedWithMeteredMinimumPrice, newFloatingMatrixWithDisplayNamePrice, newFloatingBulkWithProrationPrice, newFloatingGroupedTieredPackagePrice) /* spotless:on */ override fun toString(): String = when { @@ -526,8 +513,6 @@ constructor( "PriceCreateBody{newFloatingTieredPackagePrice=$newFloatingTieredPackagePrice}" newFloatingGroupedTieredPrice != null -> "PriceCreateBody{newFloatingGroupedTieredPrice=$newFloatingGroupedTieredPrice}" - newFloatingMaxGroupTieredPrice != null -> - "PriceCreateBody{newFloatingMaxGroupTieredPrice=$newFloatingMaxGroupTieredPrice}" newFloatingTieredWithMinimumPrice != null -> "PriceCreateBody{newFloatingTieredWithMinimumPrice=$newFloatingTieredWithMinimumPrice}" newFloatingPackageWithAllocationPrice != null -> @@ -616,11 +601,6 @@ constructor( newFloatingGroupedTieredPrice: NewFloatingGroupedTieredPrice ) = PriceCreateBody(newFloatingGroupedTieredPrice = newFloatingGroupedTieredPrice) - @JvmStatic - fun ofNewFloatingMaxGroupTieredPrice( - newFloatingMaxGroupTieredPrice: NewFloatingMaxGroupTieredPrice - ) = PriceCreateBody(newFloatingMaxGroupTieredPrice = newFloatingMaxGroupTieredPrice) - @JvmStatic fun ofNewFloatingTieredWithMinimumPrice( newFloatingTieredWithMinimumPrice: NewFloatingTieredWithMinimumPrice @@ -755,10 +735,6 @@ constructor( newFloatingGroupedTieredPrice: NewFloatingGroupedTieredPrice ): T - fun visitNewFloatingMaxGroupTieredPrice( - newFloatingMaxGroupTieredPrice: NewFloatingMaxGroupTieredPrice - ): T - fun visitNewFloatingTieredWithMinimumPrice( newFloatingTieredWithMinimumPrice: NewFloatingTieredWithMinimumPrice ): T @@ -889,15 +865,6 @@ constructor( return PriceCreateBody(newFloatingGroupedTieredPrice = it, _json = json) } } - "max_group_tiered" -> { - tryDeserialize(node, jacksonTypeRef()) - ?.let { - return PriceCreateBody( - newFloatingMaxGroupTieredPrice = it, - _json = json - ) - } - } "tiered_with_minimum" -> { tryDeserialize(node, jacksonTypeRef()) ?.let { @@ -1059,8 +1026,6 @@ constructor( generator.writeObject(value.newFloatingTieredPackagePrice) value.newFloatingGroupedTieredPrice != null -> generator.writeObject(value.newFloatingGroupedTieredPrice) - value.newFloatingMaxGroupTieredPrice != null -> - generator.writeObject(value.newFloatingMaxGroupTieredPrice) value.newFloatingTieredWithMinimumPrice != null -> generator.writeObject(value.newFloatingTieredWithMinimumPrice) value.newFloatingPackageWithAllocationPrice != null -> @@ -1176,12 +1141,6 @@ constructor( body = PriceCreateBody.ofNewFloatingGroupedTieredPrice(newFloatingGroupedTieredPrice) } - fun forNewFloatingMaxGroupTieredPrice( - newFloatingMaxGroupTieredPrice: NewFloatingMaxGroupTieredPrice - ) = apply { - body = PriceCreateBody.ofNewFloatingMaxGroupTieredPrice(newFloatingMaxGroupTieredPrice) - } - fun forNewFloatingTieredWithMinimumPrice( newFloatingTieredWithMinimumPrice: NewFloatingTieredWithMinimumPrice ) = apply { @@ -1923,6 +1882,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -2273,6 +2233,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -2463,6 +2424,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -3171,6 +3133,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -3557,6 +3520,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -3747,6 +3711,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -4454,6 +4419,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -5052,6 +5018,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -5242,6 +5209,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -5959,6 +5927,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -6582,6 +6551,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -6772,6 +6742,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -7479,6 +7450,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -8001,6 +7973,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -8191,6 +8164,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -8899,6 +8873,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -9459,6 +9434,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -9649,6 +9625,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -10486,6 +10463,7 @@ constructor( "BpsConfig{bps=$bps, perUnitMaximum=$perUnitMaximum, additionalProperties=$additionalProperties}" } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -10729,6 +10707,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -10919,6 +10898,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -11922,6 +11902,7 @@ constructor( "BulkBpsConfig{tiers=$tiers, additionalProperties=$additionalProperties}" } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -12165,6 +12146,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -12355,6 +12337,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -13321,6 +13304,7 @@ constructor( "BulkConfig{tiers=$tiers, additionalProperties=$additionalProperties}" } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -13564,6 +13548,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -13754,6 +13739,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -14471,6 +14457,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -14797,6 +14784,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -14987,6 +14975,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -15700,6 +15689,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -16025,6 +16015,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -16215,6 +16206,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -16928,6 +16920,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -17253,6 +17246,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -17443,6 +17437,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -17622,7 +17617,7 @@ constructor( } @NoAutoDetect - class NewFloatingMaxGroupTieredPrice + class NewFloatingTieredWithMinimumPrice @JsonCreator private constructor( @JsonProperty("cadence") @@ -17634,15 +17629,15 @@ constructor( @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("tiered_with_minimum_config") + @ExcludeMissing + private val tieredWithMinimumConfig: JsonField = JsonMissing.of(), @JsonProperty("billable_metric_id") @ExcludeMissing private val billableMetricId: JsonField = JsonMissing.of(), @@ -17685,14 +17680,14 @@ constructor( /** The id of the item the plan will be associated with. */ fun itemId(): String = itemId.getRequired("item_id") - fun maxGroupTieredConfig(): MaxGroupTieredConfig = - maxGroupTieredConfig.getRequired("max_group_tiered_config") - fun modelType(): ModelType = modelType.getRequired("model_type") /** The name of the price. */ fun name(): String = name.getRequired("name") + fun tieredWithMinimumConfig(): TieredWithMinimumConfig = + tieredWithMinimumConfig.getRequired("tiered_with_minimum_config") + /** 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")) @@ -17751,10 +17746,6 @@ constructor( /** 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 @@ -17762,6 +17753,10 @@ constructor( /** The name of the price. */ @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + @JsonProperty("tiered_with_minimum_config") + @ExcludeMissing + fun _tieredWithMinimumConfig(): JsonField = tieredWithMinimumConfig + /** The id of the billable metric for the price. Only needed if the price is usage-based. */ @JsonProperty("billable_metric_id") @ExcludeMissing @@ -17823,7 +17818,7 @@ constructor( private var validated: Boolean = false - fun validate(): NewFloatingMaxGroupTieredPrice = apply { + fun validate(): NewFloatingTieredWithMinimumPrice = apply { if (validated) { return@apply } @@ -17831,9 +17826,9 @@ constructor( cadence() currency() itemId() - maxGroupTieredConfig().validate() modelType() name() + tieredWithMinimumConfig().validate() billableMetricId() billedInAdvance() billingCycleConfiguration().ifPresent { it.validate() } @@ -17858,9 +17853,9 @@ constructor( private var cadence: JsonField? = null private var currency: JsonField? = null private var itemId: JsonField? = null - private var maxGroupTieredConfig: JsonField? = null private var modelType: JsonField? = null private var name: JsonField? = null + private var tieredWithMinimumConfig: JsonField? = null private var billableMetricId: JsonField = JsonMissing.of() private var billedInAdvance: JsonField = JsonMissing.of() private var billingCycleConfiguration: JsonField = @@ -17875,28 +17870,29 @@ constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(newFloatingMaxGroupTieredPrice: NewFloatingMaxGroupTieredPrice) = - apply { - cadence = newFloatingMaxGroupTieredPrice.cadence - currency = newFloatingMaxGroupTieredPrice.currency - itemId = newFloatingMaxGroupTieredPrice.itemId - maxGroupTieredConfig = newFloatingMaxGroupTieredPrice.maxGroupTieredConfig - modelType = newFloatingMaxGroupTieredPrice.modelType - name = newFloatingMaxGroupTieredPrice.name - billableMetricId = newFloatingMaxGroupTieredPrice.billableMetricId - billedInAdvance = newFloatingMaxGroupTieredPrice.billedInAdvance - billingCycleConfiguration = - newFloatingMaxGroupTieredPrice.billingCycleConfiguration - conversionRate = newFloatingMaxGroupTieredPrice.conversionRate - externalPriceId = newFloatingMaxGroupTieredPrice.externalPriceId - fixedPriceQuantity = newFloatingMaxGroupTieredPrice.fixedPriceQuantity - invoiceGroupingKey = newFloatingMaxGroupTieredPrice.invoiceGroupingKey - invoicingCycleConfiguration = - newFloatingMaxGroupTieredPrice.invoicingCycleConfiguration - metadata = newFloatingMaxGroupTieredPrice.metadata - additionalProperties = - newFloatingMaxGroupTieredPrice.additionalProperties.toMutableMap() - } + internal fun from( + newFloatingTieredWithMinimumPrice: NewFloatingTieredWithMinimumPrice + ) = apply { + cadence = newFloatingTieredWithMinimumPrice.cadence + currency = newFloatingTieredWithMinimumPrice.currency + itemId = newFloatingTieredWithMinimumPrice.itemId + modelType = newFloatingTieredWithMinimumPrice.modelType + name = newFloatingTieredWithMinimumPrice.name + tieredWithMinimumConfig = newFloatingTieredWithMinimumPrice.tieredWithMinimumConfig + billableMetricId = newFloatingTieredWithMinimumPrice.billableMetricId + billedInAdvance = newFloatingTieredWithMinimumPrice.billedInAdvance + billingCycleConfiguration = + newFloatingTieredWithMinimumPrice.billingCycleConfiguration + conversionRate = newFloatingTieredWithMinimumPrice.conversionRate + externalPriceId = newFloatingTieredWithMinimumPrice.externalPriceId + fixedPriceQuantity = newFloatingTieredWithMinimumPrice.fixedPriceQuantity + invoiceGroupingKey = newFloatingTieredWithMinimumPrice.invoiceGroupingKey + invoicingCycleConfiguration = + newFloatingTieredWithMinimumPrice.invoicingCycleConfiguration + metadata = newFloatingTieredWithMinimumPrice.metadata + additionalProperties = + newFloatingTieredWithMinimumPrice.additionalProperties.toMutableMap() + } /** The cadence to bill for this price on. */ fun cadence(cadence: Cadence) = cadence(JsonField.of(cadence)) @@ -17916,14 +17912,6 @@ constructor( /** 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 } @@ -17934,6 +17922,13 @@ constructor( /** The name of the price. */ fun name(name: JsonField) = apply { this.name = name } + fun tieredWithMinimumConfig(tieredWithMinimumConfig: TieredWithMinimumConfig) = + tieredWithMinimumConfig(JsonField.of(tieredWithMinimumConfig)) + + fun tieredWithMinimumConfig( + tieredWithMinimumConfig: JsonField + ) = apply { this.tieredWithMinimumConfig = tieredWithMinimumConfig } + /** * The id of the billable metric for the price. Only needed if the price is usage-based. */ @@ -18136,14 +18131,14 @@ constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): NewFloatingMaxGroupTieredPrice = - NewFloatingMaxGroupTieredPrice( + fun build(): NewFloatingTieredWithMinimumPrice = + NewFloatingTieredWithMinimumPrice( checkRequired("cadence", cadence), checkRequired("currency", currency), checkRequired("itemId", itemId), - checkRequired("maxGroupTieredConfig", maxGroupTieredConfig), checkRequired("modelType", modelType), checkRequired("name", name), + checkRequired("tieredWithMinimumConfig", tieredWithMinimumConfig), billableMetricId, billedInAdvance, billingCycleConfiguration, @@ -18157,6 +18152,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -18238,8 +18234,59 @@ constructor( override fun toString() = value.toString() } + class ModelType + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val TIERED_WITH_MINIMUM = of("tiered_with_minimum") + + @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) + } + + enum class Known { + TIERED_WITH_MINIMUM, + } + + enum class Value { + TIERED_WITH_MINIMUM, + _UNKNOWN, + } + + fun value(): Value = + when (this) { + TIERED_WITH_MINIMUM -> Value.TIERED_WITH_MINIMUM + else -> Value._UNKNOWN + } + + fun known(): Known = + when (this) { + TIERED_WITH_MINIMUM -> Known.TIERED_WITH_MINIMUM + 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() + } + @NoAutoDetect - class MaxGroupTieredConfig + class TieredWithMinimumConfig @JsonCreator private constructor( @JsonAnySetter @@ -18252,7 +18299,7 @@ constructor( private var validated: Boolean = false - fun validate(): MaxGroupTieredConfig = apply { + fun validate(): TieredWithMinimumConfig = apply { if (validated) { return@apply } @@ -18272,8 +18319,9 @@ constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(maxGroupTieredConfig: MaxGroupTieredConfig) = apply { - additionalProperties = maxGroupTieredConfig.additionalProperties.toMutableMap() + internal fun from(tieredWithMinimumConfig: TieredWithMinimumConfig) = apply { + additionalProperties = + tieredWithMinimumConfig.additionalProperties.toMutableMap() } fun additionalProperties(additionalProperties: Map) = apply { @@ -18298,8 +18346,8 @@ constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): MaxGroupTieredConfig = - MaxGroupTieredConfig(additionalProperties.toImmutable()) + fun build(): TieredWithMinimumConfig = + TieredWithMinimumConfig(additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { @@ -18307,7 +18355,7 @@ constructor( return true } - return /* spotless:off */ other is MaxGroupTieredConfig && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is TieredWithMinimumConfig && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ @@ -18317,58 +18365,7 @@ constructor( 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() + "TieredWithMinimumConfig{additionalProperties=$additionalProperties}" } /** For custom cadence: specifies the duration of the billing period in days or months. */ @@ -18482,6 +18479,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -18672,6 +18670,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -18837,21 +18836,21 @@ constructor( return true } - return /* spotless:off */ other is NewFloatingMaxGroupTieredPrice && cadence == other.cadence && currency == other.currency && itemId == other.itemId && maxGroupTieredConfig == other.maxGroupTieredConfig && modelType == other.modelType && name == other.name && billableMetricId == other.billableMetricId && billedInAdvance == other.billedInAdvance && billingCycleConfiguration == other.billingCycleConfiguration && conversionRate == other.conversionRate && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && metadata == other.metadata && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is NewFloatingTieredWithMinimumPrice && cadence == other.cadence && currency == other.currency && itemId == other.itemId && modelType == other.modelType && name == other.name && tieredWithMinimumConfig == other.tieredWithMinimumConfig && billableMetricId == other.billableMetricId && billedInAdvance == other.billedInAdvance && billingCycleConfiguration == other.billingCycleConfiguration && conversionRate == other.conversionRate && 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, currency, itemId, maxGroupTieredConfig, modelType, name, billableMetricId, billedInAdvance, billingCycleConfiguration, conversionRate, externalPriceId, fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, metadata, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(cadence, currency, itemId, modelType, name, tieredWithMinimumConfig, billableMetricId, billedInAdvance, billingCycleConfiguration, conversionRate, externalPriceId, fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, metadata, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "NewFloatingMaxGroupTieredPrice{cadence=$cadence, currency=$currency, itemId=$itemId, maxGroupTieredConfig=$maxGroupTieredConfig, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" + "NewFloatingTieredWithMinimumPrice{cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, tieredWithMinimumConfig=$tieredWithMinimumConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" } @NoAutoDetect - class NewFloatingTieredWithMinimumPrice + class NewFloatingPackageWithAllocationPrice @JsonCreator private constructor( @JsonProperty("cadence") @@ -18869,9 +18868,10 @@ constructor( @JsonProperty("name") @ExcludeMissing private val name: JsonField = JsonMissing.of(), - @JsonProperty("tiered_with_minimum_config") + @JsonProperty("package_with_allocation_config") @ExcludeMissing - private val tieredWithMinimumConfig: JsonField = JsonMissing.of(), + private val packageWithAllocationConfig: JsonField = + JsonMissing.of(), @JsonProperty("billable_metric_id") @ExcludeMissing private val billableMetricId: JsonField = JsonMissing.of(), @@ -18919,8 +18919,8 @@ constructor( /** The name of the price. */ fun name(): String = name.getRequired("name") - fun tieredWithMinimumConfig(): TieredWithMinimumConfig = - tieredWithMinimumConfig.getRequired("tiered_with_minimum_config") + fun packageWithAllocationConfig(): PackageWithAllocationConfig = + packageWithAllocationConfig.getRequired("package_with_allocation_config") /** The id of the billable metric for the price. Only needed if the price is usage-based. */ fun billableMetricId(): Optional = @@ -18987,9 +18987,10 @@ constructor( /** The name of the price. */ @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name - @JsonProperty("tiered_with_minimum_config") + @JsonProperty("package_with_allocation_config") @ExcludeMissing - fun _tieredWithMinimumConfig(): JsonField = tieredWithMinimumConfig + fun _packageWithAllocationConfig(): JsonField = + packageWithAllocationConfig /** The id of the billable metric for the price. Only needed if the price is usage-based. */ @JsonProperty("billable_metric_id") @@ -19052,7 +19053,7 @@ constructor( private var validated: Boolean = false - fun validate(): NewFloatingTieredWithMinimumPrice = apply { + fun validate(): NewFloatingPackageWithAllocationPrice = apply { if (validated) { return@apply } @@ -19062,7 +19063,7 @@ constructor( itemId() modelType() name() - tieredWithMinimumConfig().validate() + packageWithAllocationConfig().validate() billableMetricId() billedInAdvance() billingCycleConfiguration().ifPresent { it.validate() } @@ -19089,7 +19090,7 @@ constructor( private var itemId: JsonField? = null private var modelType: JsonField? = null private var name: JsonField? = null - private var tieredWithMinimumConfig: JsonField? = null + private var packageWithAllocationConfig: JsonField? = null private var billableMetricId: JsonField = JsonMissing.of() private var billedInAdvance: JsonField = JsonMissing.of() private var billingCycleConfiguration: JsonField = @@ -19105,27 +19106,28 @@ constructor( @JvmSynthetic internal fun from( - newFloatingTieredWithMinimumPrice: NewFloatingTieredWithMinimumPrice + newFloatingPackageWithAllocationPrice: NewFloatingPackageWithAllocationPrice ) = apply { - cadence = newFloatingTieredWithMinimumPrice.cadence - currency = newFloatingTieredWithMinimumPrice.currency - itemId = newFloatingTieredWithMinimumPrice.itemId - modelType = newFloatingTieredWithMinimumPrice.modelType - name = newFloatingTieredWithMinimumPrice.name - tieredWithMinimumConfig = newFloatingTieredWithMinimumPrice.tieredWithMinimumConfig - billableMetricId = newFloatingTieredWithMinimumPrice.billableMetricId - billedInAdvance = newFloatingTieredWithMinimumPrice.billedInAdvance + cadence = newFloatingPackageWithAllocationPrice.cadence + currency = newFloatingPackageWithAllocationPrice.currency + itemId = newFloatingPackageWithAllocationPrice.itemId + modelType = newFloatingPackageWithAllocationPrice.modelType + name = newFloatingPackageWithAllocationPrice.name + packageWithAllocationConfig = + newFloatingPackageWithAllocationPrice.packageWithAllocationConfig + billableMetricId = newFloatingPackageWithAllocationPrice.billableMetricId + billedInAdvance = newFloatingPackageWithAllocationPrice.billedInAdvance billingCycleConfiguration = - newFloatingTieredWithMinimumPrice.billingCycleConfiguration - conversionRate = newFloatingTieredWithMinimumPrice.conversionRate - externalPriceId = newFloatingTieredWithMinimumPrice.externalPriceId - fixedPriceQuantity = newFloatingTieredWithMinimumPrice.fixedPriceQuantity - invoiceGroupingKey = newFloatingTieredWithMinimumPrice.invoiceGroupingKey + newFloatingPackageWithAllocationPrice.billingCycleConfiguration + conversionRate = newFloatingPackageWithAllocationPrice.conversionRate + externalPriceId = newFloatingPackageWithAllocationPrice.externalPriceId + fixedPriceQuantity = newFloatingPackageWithAllocationPrice.fixedPriceQuantity + invoiceGroupingKey = newFloatingPackageWithAllocationPrice.invoiceGroupingKey invoicingCycleConfiguration = - newFloatingTieredWithMinimumPrice.invoicingCycleConfiguration - metadata = newFloatingTieredWithMinimumPrice.metadata + newFloatingPackageWithAllocationPrice.invoicingCycleConfiguration + metadata = newFloatingPackageWithAllocationPrice.metadata additionalProperties = - newFloatingTieredWithMinimumPrice.additionalProperties.toMutableMap() + newFloatingPackageWithAllocationPrice.additionalProperties.toMutableMap() } /** The cadence to bill for this price on. */ @@ -19156,12 +19158,13 @@ constructor( /** The name of the price. */ fun name(name: JsonField) = apply { this.name = name } - fun tieredWithMinimumConfig(tieredWithMinimumConfig: TieredWithMinimumConfig) = - tieredWithMinimumConfig(JsonField.of(tieredWithMinimumConfig)) + fun packageWithAllocationConfig( + packageWithAllocationConfig: PackageWithAllocationConfig + ) = packageWithAllocationConfig(JsonField.of(packageWithAllocationConfig)) - fun tieredWithMinimumConfig( - tieredWithMinimumConfig: JsonField - ) = apply { this.tieredWithMinimumConfig = tieredWithMinimumConfig } + fun packageWithAllocationConfig( + packageWithAllocationConfig: JsonField + ) = apply { this.packageWithAllocationConfig = packageWithAllocationConfig } /** * The id of the billable metric for the price. Only needed if the price is usage-based. @@ -19365,14 +19368,14 @@ constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): NewFloatingTieredWithMinimumPrice = - NewFloatingTieredWithMinimumPrice( + fun build(): NewFloatingPackageWithAllocationPrice = + NewFloatingPackageWithAllocationPrice( checkRequired("cadence", cadence), checkRequired("currency", currency), checkRequired("itemId", itemId), checkRequired("modelType", modelType), checkRequired("name", name), - checkRequired("tieredWithMinimumConfig", tieredWithMinimumConfig), + checkRequired("packageWithAllocationConfig", packageWithAllocationConfig), billableMetricId, billedInAdvance, billingCycleConfiguration, @@ -19386,6 +19389,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -19477,29 +19481,29 @@ constructor( companion object { - @JvmField val TIERED_WITH_MINIMUM = of("tiered_with_minimum") + @JvmField val PACKAGE_WITH_ALLOCATION = of("package_with_allocation") @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } enum class Known { - TIERED_WITH_MINIMUM, + PACKAGE_WITH_ALLOCATION, } enum class Value { - TIERED_WITH_MINIMUM, + PACKAGE_WITH_ALLOCATION, _UNKNOWN, } fun value(): Value = when (this) { - TIERED_WITH_MINIMUM -> Value.TIERED_WITH_MINIMUM + PACKAGE_WITH_ALLOCATION -> Value.PACKAGE_WITH_ALLOCATION else -> Value._UNKNOWN } fun known(): Known = when (this) { - TIERED_WITH_MINIMUM -> Known.TIERED_WITH_MINIMUM + PACKAGE_WITH_ALLOCATION -> Known.PACKAGE_WITH_ALLOCATION else -> throw OrbInvalidDataException("Unknown ModelType: $value") } @@ -19519,7 +19523,7 @@ constructor( } @NoAutoDetect - class TieredWithMinimumConfig + class PackageWithAllocationConfig @JsonCreator private constructor( @JsonAnySetter @@ -19532,7 +19536,7 @@ constructor( private var validated: Boolean = false - fun validate(): TieredWithMinimumConfig = apply { + fun validate(): PackageWithAllocationConfig = apply { if (validated) { return@apply } @@ -19552,10 +19556,11 @@ constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(tieredWithMinimumConfig: TieredWithMinimumConfig) = apply { - additionalProperties = - tieredWithMinimumConfig.additionalProperties.toMutableMap() - } + internal fun from(packageWithAllocationConfig: PackageWithAllocationConfig) = + apply { + additionalProperties = + packageWithAllocationConfig.additionalProperties.toMutableMap() + } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -19579,8 +19584,8 @@ constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): TieredWithMinimumConfig = - TieredWithMinimumConfig(additionalProperties.toImmutable()) + fun build(): PackageWithAllocationConfig = + PackageWithAllocationConfig(additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { @@ -19588,7 +19593,7 @@ constructor( return true } - return /* spotless:off */ other is TieredWithMinimumConfig && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is PackageWithAllocationConfig && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ @@ -19598,7 +19603,7 @@ constructor( override fun hashCode(): Int = hashCode override fun toString() = - "TieredWithMinimumConfig{additionalProperties=$additionalProperties}" + "PackageWithAllocationConfig{additionalProperties=$additionalProperties}" } /** For custom cadence: specifies the duration of the billing period in days or months. */ @@ -19712,6 +19717,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -19902,6 +19908,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -20067,21 +20074,21 @@ constructor( return true } - return /* spotless:off */ other is NewFloatingTieredWithMinimumPrice && cadence == other.cadence && currency == other.currency && itemId == other.itemId && modelType == other.modelType && name == other.name && tieredWithMinimumConfig == other.tieredWithMinimumConfig && billableMetricId == other.billableMetricId && billedInAdvance == other.billedInAdvance && billingCycleConfiguration == other.billingCycleConfiguration && conversionRate == other.conversionRate && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && metadata == other.metadata && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is NewFloatingPackageWithAllocationPrice && cadence == other.cadence && currency == other.currency && itemId == other.itemId && modelType == other.modelType && name == other.name && packageWithAllocationConfig == other.packageWithAllocationConfig && billableMetricId == other.billableMetricId && billedInAdvance == other.billedInAdvance && billingCycleConfiguration == other.billingCycleConfiguration && conversionRate == other.conversionRate && 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, currency, itemId, modelType, name, tieredWithMinimumConfig, billableMetricId, billedInAdvance, billingCycleConfiguration, conversionRate, externalPriceId, fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, metadata, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(cadence, currency, itemId, modelType, name, packageWithAllocationConfig, billableMetricId, billedInAdvance, billingCycleConfiguration, conversionRate, externalPriceId, fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, metadata, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "NewFloatingTieredWithMinimumPrice{cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, tieredWithMinimumConfig=$tieredWithMinimumConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" + "NewFloatingPackageWithAllocationPrice{cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, packageWithAllocationConfig=$packageWithAllocationConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" } @NoAutoDetect - class NewFloatingPackageWithAllocationPrice + class NewFloatingTieredPackageWithMinimumPrice @JsonCreator private constructor( @JsonProperty("cadence") @@ -20099,9 +20106,9 @@ constructor( @JsonProperty("name") @ExcludeMissing private val name: JsonField = JsonMissing.of(), - @JsonProperty("package_with_allocation_config") + @JsonProperty("tiered_package_with_minimum_config") @ExcludeMissing - private val packageWithAllocationConfig: JsonField = + private val tieredPackageWithMinimumConfig: JsonField = JsonMissing.of(), @JsonProperty("billable_metric_id") @ExcludeMissing @@ -20150,8 +20157,8 @@ constructor( /** The name of the price. */ fun name(): String = name.getRequired("name") - fun packageWithAllocationConfig(): PackageWithAllocationConfig = - packageWithAllocationConfig.getRequired("package_with_allocation_config") + fun tieredPackageWithMinimumConfig(): TieredPackageWithMinimumConfig = + tieredPackageWithMinimumConfig.getRequired("tiered_package_with_minimum_config") /** The id of the billable metric for the price. Only needed if the price is usage-based. */ fun billableMetricId(): Optional = @@ -20218,10 +20225,10 @@ constructor( /** The name of the price. */ @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name - @JsonProperty("package_with_allocation_config") + @JsonProperty("tiered_package_with_minimum_config") @ExcludeMissing - fun _packageWithAllocationConfig(): JsonField = - packageWithAllocationConfig + fun _tieredPackageWithMinimumConfig(): JsonField = + tieredPackageWithMinimumConfig /** The id of the billable metric for the price. Only needed if the price is usage-based. */ @JsonProperty("billable_metric_id") @@ -20284,7 +20291,7 @@ constructor( private var validated: Boolean = false - fun validate(): NewFloatingPackageWithAllocationPrice = apply { + fun validate(): NewFloatingTieredPackageWithMinimumPrice = apply { if (validated) { return@apply } @@ -20294,7 +20301,7 @@ constructor( itemId() modelType() name() - packageWithAllocationConfig().validate() + tieredPackageWithMinimumConfig().validate() billableMetricId() billedInAdvance() billingCycleConfiguration().ifPresent { it.validate() } @@ -20321,7 +20328,8 @@ constructor( private var itemId: JsonField? = null private var modelType: JsonField? = null private var name: JsonField? = null - private var packageWithAllocationConfig: JsonField? = null + private var tieredPackageWithMinimumConfig: JsonField? = + null private var billableMetricId: JsonField = JsonMissing.of() private var billedInAdvance: JsonField = JsonMissing.of() private var billingCycleConfiguration: JsonField = @@ -20337,28 +20345,28 @@ constructor( @JvmSynthetic internal fun from( - newFloatingPackageWithAllocationPrice: NewFloatingPackageWithAllocationPrice + newFloatingTieredPackageWithMinimumPrice: NewFloatingTieredPackageWithMinimumPrice ) = apply { - cadence = newFloatingPackageWithAllocationPrice.cadence - currency = newFloatingPackageWithAllocationPrice.currency - itemId = newFloatingPackageWithAllocationPrice.itemId - modelType = newFloatingPackageWithAllocationPrice.modelType - name = newFloatingPackageWithAllocationPrice.name - packageWithAllocationConfig = - newFloatingPackageWithAllocationPrice.packageWithAllocationConfig - billableMetricId = newFloatingPackageWithAllocationPrice.billableMetricId - billedInAdvance = newFloatingPackageWithAllocationPrice.billedInAdvance + cadence = newFloatingTieredPackageWithMinimumPrice.cadence + currency = newFloatingTieredPackageWithMinimumPrice.currency + itemId = newFloatingTieredPackageWithMinimumPrice.itemId + modelType = newFloatingTieredPackageWithMinimumPrice.modelType + name = newFloatingTieredPackageWithMinimumPrice.name + tieredPackageWithMinimumConfig = + newFloatingTieredPackageWithMinimumPrice.tieredPackageWithMinimumConfig + billableMetricId = newFloatingTieredPackageWithMinimumPrice.billableMetricId + billedInAdvance = newFloatingTieredPackageWithMinimumPrice.billedInAdvance billingCycleConfiguration = - newFloatingPackageWithAllocationPrice.billingCycleConfiguration - conversionRate = newFloatingPackageWithAllocationPrice.conversionRate - externalPriceId = newFloatingPackageWithAllocationPrice.externalPriceId - fixedPriceQuantity = newFloatingPackageWithAllocationPrice.fixedPriceQuantity - invoiceGroupingKey = newFloatingPackageWithAllocationPrice.invoiceGroupingKey + newFloatingTieredPackageWithMinimumPrice.billingCycleConfiguration + conversionRate = newFloatingTieredPackageWithMinimumPrice.conversionRate + externalPriceId = newFloatingTieredPackageWithMinimumPrice.externalPriceId + fixedPriceQuantity = newFloatingTieredPackageWithMinimumPrice.fixedPriceQuantity + invoiceGroupingKey = newFloatingTieredPackageWithMinimumPrice.invoiceGroupingKey invoicingCycleConfiguration = - newFloatingPackageWithAllocationPrice.invoicingCycleConfiguration - metadata = newFloatingPackageWithAllocationPrice.metadata + newFloatingTieredPackageWithMinimumPrice.invoicingCycleConfiguration + metadata = newFloatingTieredPackageWithMinimumPrice.metadata additionalProperties = - newFloatingPackageWithAllocationPrice.additionalProperties.toMutableMap() + newFloatingTieredPackageWithMinimumPrice.additionalProperties.toMutableMap() } /** The cadence to bill for this price on. */ @@ -20389,13 +20397,13 @@ constructor( /** The name of the price. */ fun name(name: JsonField) = apply { this.name = name } - fun packageWithAllocationConfig( - packageWithAllocationConfig: PackageWithAllocationConfig - ) = packageWithAllocationConfig(JsonField.of(packageWithAllocationConfig)) + fun tieredPackageWithMinimumConfig( + tieredPackageWithMinimumConfig: TieredPackageWithMinimumConfig + ) = tieredPackageWithMinimumConfig(JsonField.of(tieredPackageWithMinimumConfig)) - fun packageWithAllocationConfig( - packageWithAllocationConfig: JsonField - ) = apply { this.packageWithAllocationConfig = packageWithAllocationConfig } + fun tieredPackageWithMinimumConfig( + tieredPackageWithMinimumConfig: JsonField + ) = apply { this.tieredPackageWithMinimumConfig = tieredPackageWithMinimumConfig } /** * The id of the billable metric for the price. Only needed if the price is usage-based. @@ -20599,14 +20607,14 @@ constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): NewFloatingPackageWithAllocationPrice = - NewFloatingPackageWithAllocationPrice( + fun build(): NewFloatingTieredPackageWithMinimumPrice = + NewFloatingTieredPackageWithMinimumPrice( checkRequired("cadence", cadence), checkRequired("currency", currency), checkRequired("itemId", itemId), checkRequired("modelType", modelType), checkRequired("name", name), - checkRequired("packageWithAllocationConfig", packageWithAllocationConfig), + checkRequired("tieredPackageWithMinimumConfig", tieredPackageWithMinimumConfig), billableMetricId, billedInAdvance, billingCycleConfiguration, @@ -20620,6 +20628,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -20711,29 +20720,29 @@ constructor( companion object { - @JvmField val PACKAGE_WITH_ALLOCATION = of("package_with_allocation") + @JvmField val TIERED_PACKAGE_WITH_MINIMUM = of("tiered_package_with_minimum") @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } enum class Known { - PACKAGE_WITH_ALLOCATION, + TIERED_PACKAGE_WITH_MINIMUM, } enum class Value { - PACKAGE_WITH_ALLOCATION, + TIERED_PACKAGE_WITH_MINIMUM, _UNKNOWN, } fun value(): Value = when (this) { - PACKAGE_WITH_ALLOCATION -> Value.PACKAGE_WITH_ALLOCATION + TIERED_PACKAGE_WITH_MINIMUM -> Value.TIERED_PACKAGE_WITH_MINIMUM else -> Value._UNKNOWN } fun known(): Known = when (this) { - PACKAGE_WITH_ALLOCATION -> Known.PACKAGE_WITH_ALLOCATION + TIERED_PACKAGE_WITH_MINIMUM -> Known.TIERED_PACKAGE_WITH_MINIMUM else -> throw OrbInvalidDataException("Unknown ModelType: $value") } @@ -20753,7 +20762,7 @@ constructor( } @NoAutoDetect - class PackageWithAllocationConfig + class TieredPackageWithMinimumConfig @JsonCreator private constructor( @JsonAnySetter @@ -20766,7 +20775,7 @@ constructor( private var validated: Boolean = false - fun validate(): PackageWithAllocationConfig = apply { + fun validate(): TieredPackageWithMinimumConfig = apply { if (validated) { return@apply } @@ -20786,10 +20795,10 @@ constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(packageWithAllocationConfig: PackageWithAllocationConfig) = + internal fun from(tieredPackageWithMinimumConfig: TieredPackageWithMinimumConfig) = apply { additionalProperties = - packageWithAllocationConfig.additionalProperties.toMutableMap() + tieredPackageWithMinimumConfig.additionalProperties.toMutableMap() } fun additionalProperties(additionalProperties: Map) = apply { @@ -20814,8 +20823,8 @@ constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): PackageWithAllocationConfig = - PackageWithAllocationConfig(additionalProperties.toImmutable()) + fun build(): TieredPackageWithMinimumConfig = + TieredPackageWithMinimumConfig(additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { @@ -20823,7 +20832,7 @@ constructor( return true } - return /* spotless:off */ other is PackageWithAllocationConfig && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is TieredPackageWithMinimumConfig && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ @@ -20833,7 +20842,7 @@ constructor( override fun hashCode(): Int = hashCode override fun toString() = - "PackageWithAllocationConfig{additionalProperties=$additionalProperties}" + "TieredPackageWithMinimumConfig{additionalProperties=$additionalProperties}" } /** For custom cadence: specifies the duration of the billing period in days or months. */ @@ -20947,6 +20956,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -21137,6 +21147,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -21302,21 +21313,21 @@ constructor( return true } - return /* spotless:off */ other is NewFloatingPackageWithAllocationPrice && cadence == other.cadence && currency == other.currency && itemId == other.itemId && modelType == other.modelType && name == other.name && packageWithAllocationConfig == other.packageWithAllocationConfig && billableMetricId == other.billableMetricId && billedInAdvance == other.billedInAdvance && billingCycleConfiguration == other.billingCycleConfiguration && conversionRate == other.conversionRate && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && metadata == other.metadata && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is NewFloatingTieredPackageWithMinimumPrice && cadence == other.cadence && currency == other.currency && itemId == other.itemId && modelType == other.modelType && name == other.name && tieredPackageWithMinimumConfig == other.tieredPackageWithMinimumConfig && billableMetricId == other.billableMetricId && billedInAdvance == other.billedInAdvance && billingCycleConfiguration == other.billingCycleConfiguration && conversionRate == other.conversionRate && 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, currency, itemId, modelType, name, packageWithAllocationConfig, billableMetricId, billedInAdvance, billingCycleConfiguration, conversionRate, externalPriceId, fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, metadata, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(cadence, currency, itemId, modelType, name, tieredPackageWithMinimumConfig, billableMetricId, billedInAdvance, billingCycleConfiguration, conversionRate, externalPriceId, fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, metadata, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "NewFloatingPackageWithAllocationPrice{cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, packageWithAllocationConfig=$packageWithAllocationConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" + "NewFloatingTieredPackageWithMinimumPrice{cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, tieredPackageWithMinimumConfig=$tieredPackageWithMinimumConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" } @NoAutoDetect - class NewFloatingTieredPackageWithMinimumPrice + class NewFloatingUnitWithPercentPrice @JsonCreator private constructor( @JsonProperty("cadence") @@ -21334,10 +21345,9 @@ constructor( @JsonProperty("name") @ExcludeMissing private val name: JsonField = JsonMissing.of(), - @JsonProperty("tiered_package_with_minimum_config") + @JsonProperty("unit_with_percent_config") @ExcludeMissing - private val tieredPackageWithMinimumConfig: JsonField = - JsonMissing.of(), + private val unitWithPercentConfig: JsonField = JsonMissing.of(), @JsonProperty("billable_metric_id") @ExcludeMissing private val billableMetricId: JsonField = JsonMissing.of(), @@ -21385,8 +21395,8 @@ constructor( /** The name of the price. */ fun name(): String = name.getRequired("name") - fun tieredPackageWithMinimumConfig(): TieredPackageWithMinimumConfig = - tieredPackageWithMinimumConfig.getRequired("tiered_package_with_minimum_config") + fun unitWithPercentConfig(): UnitWithPercentConfig = + unitWithPercentConfig.getRequired("unit_with_percent_config") /** The id of the billable metric for the price. Only needed if the price is usage-based. */ fun billableMetricId(): Optional = @@ -21453,10 +21463,9 @@ constructor( /** The name of the price. */ @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name - @JsonProperty("tiered_package_with_minimum_config") + @JsonProperty("unit_with_percent_config") @ExcludeMissing - fun _tieredPackageWithMinimumConfig(): JsonField = - tieredPackageWithMinimumConfig + fun _unitWithPercentConfig(): JsonField = unitWithPercentConfig /** The id of the billable metric for the price. Only needed if the price is usage-based. */ @JsonProperty("billable_metric_id") @@ -21519,7 +21528,7 @@ constructor( private var validated: Boolean = false - fun validate(): NewFloatingTieredPackageWithMinimumPrice = apply { + fun validate(): NewFloatingUnitWithPercentPrice = apply { if (validated) { return@apply } @@ -21529,7 +21538,7 @@ constructor( itemId() modelType() name() - tieredPackageWithMinimumConfig().validate() + unitWithPercentConfig().validate() billableMetricId() billedInAdvance() billingCycleConfiguration().ifPresent { it.validate() } @@ -21556,8 +21565,7 @@ constructor( private var itemId: JsonField? = null private var modelType: JsonField? = null private var name: JsonField? = null - private var tieredPackageWithMinimumConfig: JsonField? = - null + private var unitWithPercentConfig: JsonField? = null private var billableMetricId: JsonField = JsonMissing.of() private var billedInAdvance: JsonField = JsonMissing.of() private var billingCycleConfiguration: JsonField = @@ -21572,30 +21580,28 @@ constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from( - newFloatingTieredPackageWithMinimumPrice: NewFloatingTieredPackageWithMinimumPrice - ) = apply { - cadence = newFloatingTieredPackageWithMinimumPrice.cadence - currency = newFloatingTieredPackageWithMinimumPrice.currency - itemId = newFloatingTieredPackageWithMinimumPrice.itemId - modelType = newFloatingTieredPackageWithMinimumPrice.modelType - name = newFloatingTieredPackageWithMinimumPrice.name - tieredPackageWithMinimumConfig = - newFloatingTieredPackageWithMinimumPrice.tieredPackageWithMinimumConfig - billableMetricId = newFloatingTieredPackageWithMinimumPrice.billableMetricId - billedInAdvance = newFloatingTieredPackageWithMinimumPrice.billedInAdvance - billingCycleConfiguration = - newFloatingTieredPackageWithMinimumPrice.billingCycleConfiguration - conversionRate = newFloatingTieredPackageWithMinimumPrice.conversionRate - externalPriceId = newFloatingTieredPackageWithMinimumPrice.externalPriceId - fixedPriceQuantity = newFloatingTieredPackageWithMinimumPrice.fixedPriceQuantity - invoiceGroupingKey = newFloatingTieredPackageWithMinimumPrice.invoiceGroupingKey - invoicingCycleConfiguration = - newFloatingTieredPackageWithMinimumPrice.invoicingCycleConfiguration - metadata = newFloatingTieredPackageWithMinimumPrice.metadata - additionalProperties = - newFloatingTieredPackageWithMinimumPrice.additionalProperties.toMutableMap() - } + internal fun from(newFloatingUnitWithPercentPrice: NewFloatingUnitWithPercentPrice) = + apply { + cadence = newFloatingUnitWithPercentPrice.cadence + currency = newFloatingUnitWithPercentPrice.currency + itemId = newFloatingUnitWithPercentPrice.itemId + modelType = newFloatingUnitWithPercentPrice.modelType + name = newFloatingUnitWithPercentPrice.name + unitWithPercentConfig = newFloatingUnitWithPercentPrice.unitWithPercentConfig + billableMetricId = newFloatingUnitWithPercentPrice.billableMetricId + billedInAdvance = newFloatingUnitWithPercentPrice.billedInAdvance + billingCycleConfiguration = + newFloatingUnitWithPercentPrice.billingCycleConfiguration + conversionRate = newFloatingUnitWithPercentPrice.conversionRate + externalPriceId = newFloatingUnitWithPercentPrice.externalPriceId + fixedPriceQuantity = newFloatingUnitWithPercentPrice.fixedPriceQuantity + invoiceGroupingKey = newFloatingUnitWithPercentPrice.invoiceGroupingKey + invoicingCycleConfiguration = + newFloatingUnitWithPercentPrice.invoicingCycleConfiguration + metadata = newFloatingUnitWithPercentPrice.metadata + additionalProperties = + newFloatingUnitWithPercentPrice.additionalProperties.toMutableMap() + } /** The cadence to bill for this price on. */ fun cadence(cadence: Cadence) = cadence(JsonField.of(cadence)) @@ -21625,13 +21631,13 @@ constructor( /** The name of the price. */ fun name(name: JsonField) = apply { this.name = name } - fun tieredPackageWithMinimumConfig( - tieredPackageWithMinimumConfig: TieredPackageWithMinimumConfig - ) = tieredPackageWithMinimumConfig(JsonField.of(tieredPackageWithMinimumConfig)) + fun unitWithPercentConfig(unitWithPercentConfig: UnitWithPercentConfig) = + unitWithPercentConfig(JsonField.of(unitWithPercentConfig)) - fun tieredPackageWithMinimumConfig( - tieredPackageWithMinimumConfig: JsonField - ) = apply { this.tieredPackageWithMinimumConfig = tieredPackageWithMinimumConfig } + fun unitWithPercentConfig(unitWithPercentConfig: JsonField) = + apply { + this.unitWithPercentConfig = unitWithPercentConfig + } /** * The id of the billable metric for the price. Only needed if the price is usage-based. @@ -21835,14 +21841,14 @@ constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): NewFloatingTieredPackageWithMinimumPrice = - NewFloatingTieredPackageWithMinimumPrice( + fun build(): NewFloatingUnitWithPercentPrice = + NewFloatingUnitWithPercentPrice( checkRequired("cadence", cadence), checkRequired("currency", currency), checkRequired("itemId", itemId), checkRequired("modelType", modelType), checkRequired("name", name), - checkRequired("tieredPackageWithMinimumConfig", tieredPackageWithMinimumConfig), + checkRequired("unitWithPercentConfig", unitWithPercentConfig), billableMetricId, billedInAdvance, billingCycleConfiguration, @@ -21856,6 +21862,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -21947,29 +21954,29 @@ constructor( companion object { - @JvmField val TIERED_PACKAGE_WITH_MINIMUM = of("tiered_package_with_minimum") + @JvmField val UNIT_WITH_PERCENT = of("unit_with_percent") @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } enum class Known { - TIERED_PACKAGE_WITH_MINIMUM, + UNIT_WITH_PERCENT, } enum class Value { - TIERED_PACKAGE_WITH_MINIMUM, + UNIT_WITH_PERCENT, _UNKNOWN, } fun value(): Value = when (this) { - TIERED_PACKAGE_WITH_MINIMUM -> Value.TIERED_PACKAGE_WITH_MINIMUM + UNIT_WITH_PERCENT -> Value.UNIT_WITH_PERCENT else -> Value._UNKNOWN } fun known(): Known = when (this) { - TIERED_PACKAGE_WITH_MINIMUM -> Known.TIERED_PACKAGE_WITH_MINIMUM + UNIT_WITH_PERCENT -> Known.UNIT_WITH_PERCENT else -> throw OrbInvalidDataException("Unknown ModelType: $value") } @@ -21989,7 +21996,7 @@ constructor( } @NoAutoDetect - class TieredPackageWithMinimumConfig + class UnitWithPercentConfig @JsonCreator private constructor( @JsonAnySetter @@ -22002,7 +22009,7 @@ constructor( private var validated: Boolean = false - fun validate(): TieredPackageWithMinimumConfig = apply { + fun validate(): UnitWithPercentConfig = apply { if (validated) { return@apply } @@ -22022,11 +22029,9 @@ constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(tieredPackageWithMinimumConfig: TieredPackageWithMinimumConfig) = - apply { - additionalProperties = - tieredPackageWithMinimumConfig.additionalProperties.toMutableMap() - } + internal fun from(unitWithPercentConfig: UnitWithPercentConfig) = apply { + additionalProperties = unitWithPercentConfig.additionalProperties.toMutableMap() + } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -22050,8 +22055,8 @@ constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): TieredPackageWithMinimumConfig = - TieredPackageWithMinimumConfig(additionalProperties.toImmutable()) + fun build(): UnitWithPercentConfig = + UnitWithPercentConfig(additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { @@ -22059,7 +22064,7 @@ constructor( return true } - return /* spotless:off */ other is TieredPackageWithMinimumConfig && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is UnitWithPercentConfig && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ @@ -22069,7 +22074,7 @@ constructor( override fun hashCode(): Int = hashCode override fun toString() = - "TieredPackageWithMinimumConfig{additionalProperties=$additionalProperties}" + "UnitWithPercentConfig{additionalProperties=$additionalProperties}" } /** For custom cadence: specifies the duration of the billing period in days or months. */ @@ -22183,6 +22188,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -22373,6 +22379,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -22538,21 +22545,21 @@ constructor( return true } - return /* spotless:off */ other is NewFloatingTieredPackageWithMinimumPrice && cadence == other.cadence && currency == other.currency && itemId == other.itemId && modelType == other.modelType && name == other.name && tieredPackageWithMinimumConfig == other.tieredPackageWithMinimumConfig && billableMetricId == other.billableMetricId && billedInAdvance == other.billedInAdvance && billingCycleConfiguration == other.billingCycleConfiguration && conversionRate == other.conversionRate && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && metadata == other.metadata && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is NewFloatingUnitWithPercentPrice && cadence == other.cadence && currency == other.currency && itemId == other.itemId && modelType == other.modelType && name == other.name && unitWithPercentConfig == other.unitWithPercentConfig && billableMetricId == other.billableMetricId && billedInAdvance == other.billedInAdvance && billingCycleConfiguration == other.billingCycleConfiguration && conversionRate == other.conversionRate && 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, currency, itemId, modelType, name, tieredPackageWithMinimumConfig, billableMetricId, billedInAdvance, billingCycleConfiguration, conversionRate, externalPriceId, fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, metadata, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(cadence, currency, itemId, modelType, name, unitWithPercentConfig, billableMetricId, billedInAdvance, billingCycleConfiguration, conversionRate, externalPriceId, fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, metadata, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "NewFloatingTieredPackageWithMinimumPrice{cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, tieredPackageWithMinimumConfig=$tieredPackageWithMinimumConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" + "NewFloatingUnitWithPercentPrice{cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, unitWithPercentConfig=$unitWithPercentConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" } @NoAutoDetect - class NewFloatingUnitWithPercentPrice + class NewFloatingTieredWithProrationPrice @JsonCreator private constructor( @JsonProperty("cadence") @@ -22570,9 +22577,10 @@ constructor( @JsonProperty("name") @ExcludeMissing private val name: JsonField = JsonMissing.of(), - @JsonProperty("unit_with_percent_config") + @JsonProperty("tiered_with_proration_config") @ExcludeMissing - private val unitWithPercentConfig: JsonField = JsonMissing.of(), + private val tieredWithProrationConfig: JsonField = + JsonMissing.of(), @JsonProperty("billable_metric_id") @ExcludeMissing private val billableMetricId: JsonField = JsonMissing.of(), @@ -22620,8 +22628,8 @@ constructor( /** The name of the price. */ fun name(): String = name.getRequired("name") - fun unitWithPercentConfig(): UnitWithPercentConfig = - unitWithPercentConfig.getRequired("unit_with_percent_config") + fun tieredWithProrationConfig(): TieredWithProrationConfig = + tieredWithProrationConfig.getRequired("tiered_with_proration_config") /** The id of the billable metric for the price. Only needed if the price is usage-based. */ fun billableMetricId(): Optional = @@ -22688,9 +22696,10 @@ constructor( /** The name of the price. */ @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name - @JsonProperty("unit_with_percent_config") + @JsonProperty("tiered_with_proration_config") @ExcludeMissing - fun _unitWithPercentConfig(): JsonField = unitWithPercentConfig + fun _tieredWithProrationConfig(): JsonField = + tieredWithProrationConfig /** The id of the billable metric for the price. Only needed if the price is usage-based. */ @JsonProperty("billable_metric_id") @@ -22753,7 +22762,7 @@ constructor( private var validated: Boolean = false - fun validate(): NewFloatingUnitWithPercentPrice = apply { + fun validate(): NewFloatingTieredWithProrationPrice = apply { if (validated) { return@apply } @@ -22763,7 +22772,7 @@ constructor( itemId() modelType() name() - unitWithPercentConfig().validate() + tieredWithProrationConfig().validate() billableMetricId() billedInAdvance() billingCycleConfiguration().ifPresent { it.validate() } @@ -22790,7 +22799,7 @@ constructor( private var itemId: JsonField? = null private var modelType: JsonField? = null private var name: JsonField? = null - private var unitWithPercentConfig: JsonField? = null + private var tieredWithProrationConfig: JsonField? = null private var billableMetricId: JsonField = JsonMissing.of() private var billedInAdvance: JsonField = JsonMissing.of() private var billingCycleConfiguration: JsonField = @@ -22805,28 +22814,30 @@ constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(newFloatingUnitWithPercentPrice: NewFloatingUnitWithPercentPrice) = - apply { - cadence = newFloatingUnitWithPercentPrice.cadence - currency = newFloatingUnitWithPercentPrice.currency - itemId = newFloatingUnitWithPercentPrice.itemId - modelType = newFloatingUnitWithPercentPrice.modelType - name = newFloatingUnitWithPercentPrice.name - unitWithPercentConfig = newFloatingUnitWithPercentPrice.unitWithPercentConfig - billableMetricId = newFloatingUnitWithPercentPrice.billableMetricId - billedInAdvance = newFloatingUnitWithPercentPrice.billedInAdvance - billingCycleConfiguration = - newFloatingUnitWithPercentPrice.billingCycleConfiguration - conversionRate = newFloatingUnitWithPercentPrice.conversionRate - externalPriceId = newFloatingUnitWithPercentPrice.externalPriceId - fixedPriceQuantity = newFloatingUnitWithPercentPrice.fixedPriceQuantity - invoiceGroupingKey = newFloatingUnitWithPercentPrice.invoiceGroupingKey - invoicingCycleConfiguration = - newFloatingUnitWithPercentPrice.invoicingCycleConfiguration - metadata = newFloatingUnitWithPercentPrice.metadata - additionalProperties = - newFloatingUnitWithPercentPrice.additionalProperties.toMutableMap() - } + internal fun from( + newFloatingTieredWithProrationPrice: NewFloatingTieredWithProrationPrice + ) = apply { + cadence = newFloatingTieredWithProrationPrice.cadence + currency = newFloatingTieredWithProrationPrice.currency + itemId = newFloatingTieredWithProrationPrice.itemId + modelType = newFloatingTieredWithProrationPrice.modelType + name = newFloatingTieredWithProrationPrice.name + tieredWithProrationConfig = + newFloatingTieredWithProrationPrice.tieredWithProrationConfig + billableMetricId = newFloatingTieredWithProrationPrice.billableMetricId + billedInAdvance = newFloatingTieredWithProrationPrice.billedInAdvance + billingCycleConfiguration = + newFloatingTieredWithProrationPrice.billingCycleConfiguration + conversionRate = newFloatingTieredWithProrationPrice.conversionRate + externalPriceId = newFloatingTieredWithProrationPrice.externalPriceId + fixedPriceQuantity = newFloatingTieredWithProrationPrice.fixedPriceQuantity + invoiceGroupingKey = newFloatingTieredWithProrationPrice.invoiceGroupingKey + invoicingCycleConfiguration = + newFloatingTieredWithProrationPrice.invoicingCycleConfiguration + metadata = newFloatingTieredWithProrationPrice.metadata + additionalProperties = + newFloatingTieredWithProrationPrice.additionalProperties.toMutableMap() + } /** The cadence to bill for this price on. */ fun cadence(cadence: Cadence) = cadence(JsonField.of(cadence)) @@ -22856,13 +22867,12 @@ constructor( /** The name of the price. */ fun name(name: JsonField) = apply { this.name = name } - fun unitWithPercentConfig(unitWithPercentConfig: UnitWithPercentConfig) = - unitWithPercentConfig(JsonField.of(unitWithPercentConfig)) + fun tieredWithProrationConfig(tieredWithProrationConfig: TieredWithProrationConfig) = + tieredWithProrationConfig(JsonField.of(tieredWithProrationConfig)) - fun unitWithPercentConfig(unitWithPercentConfig: JsonField) = - apply { - this.unitWithPercentConfig = unitWithPercentConfig - } + fun tieredWithProrationConfig( + tieredWithProrationConfig: JsonField + ) = apply { this.tieredWithProrationConfig = tieredWithProrationConfig } /** * The id of the billable metric for the price. Only needed if the price is usage-based. @@ -23066,14 +23076,14 @@ constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): NewFloatingUnitWithPercentPrice = - NewFloatingUnitWithPercentPrice( + fun build(): NewFloatingTieredWithProrationPrice = + NewFloatingTieredWithProrationPrice( checkRequired("cadence", cadence), checkRequired("currency", currency), checkRequired("itemId", itemId), checkRequired("modelType", modelType), checkRequired("name", name), - checkRequired("unitWithPercentConfig", unitWithPercentConfig), + checkRequired("tieredWithProrationConfig", tieredWithProrationConfig), billableMetricId, billedInAdvance, billingCycleConfiguration, @@ -23087,6 +23097,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -23178,29 +23189,29 @@ constructor( companion object { - @JvmField val UNIT_WITH_PERCENT = of("unit_with_percent") + @JvmField val TIERED_WITH_PRORATION = of("tiered_with_proration") @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } enum class Known { - UNIT_WITH_PERCENT, + TIERED_WITH_PRORATION, } enum class Value { - UNIT_WITH_PERCENT, + TIERED_WITH_PRORATION, _UNKNOWN, } fun value(): Value = when (this) { - UNIT_WITH_PERCENT -> Value.UNIT_WITH_PERCENT + TIERED_WITH_PRORATION -> Value.TIERED_WITH_PRORATION else -> Value._UNKNOWN } fun known(): Known = when (this) { - UNIT_WITH_PERCENT -> Known.UNIT_WITH_PERCENT + TIERED_WITH_PRORATION -> Known.TIERED_WITH_PRORATION else -> throw OrbInvalidDataException("Unknown ModelType: $value") } @@ -23220,7 +23231,7 @@ constructor( } @NoAutoDetect - class UnitWithPercentConfig + class TieredWithProrationConfig @JsonCreator private constructor( @JsonAnySetter @@ -23233,7 +23244,7 @@ constructor( private var validated: Boolean = false - fun validate(): UnitWithPercentConfig = apply { + fun validate(): TieredWithProrationConfig = apply { if (validated) { return@apply } @@ -23253,8 +23264,9 @@ constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(unitWithPercentConfig: UnitWithPercentConfig) = apply { - additionalProperties = unitWithPercentConfig.additionalProperties.toMutableMap() + internal fun from(tieredWithProrationConfig: TieredWithProrationConfig) = apply { + additionalProperties = + tieredWithProrationConfig.additionalProperties.toMutableMap() } fun additionalProperties(additionalProperties: Map) = apply { @@ -23279,8 +23291,8 @@ constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): UnitWithPercentConfig = - UnitWithPercentConfig(additionalProperties.toImmutable()) + fun build(): TieredWithProrationConfig = + TieredWithProrationConfig(additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { @@ -23288,7 +23300,7 @@ constructor( return true } - return /* spotless:off */ other is UnitWithPercentConfig && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is TieredWithProrationConfig && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ @@ -23298,7 +23310,7 @@ constructor( override fun hashCode(): Int = hashCode override fun toString() = - "UnitWithPercentConfig{additionalProperties=$additionalProperties}" + "TieredWithProrationConfig{additionalProperties=$additionalProperties}" } /** For custom cadence: specifies the duration of the billing period in days or months. */ @@ -23412,6 +23424,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -23602,6 +23615,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -23767,21 +23781,21 @@ constructor( return true } - return /* spotless:off */ other is NewFloatingUnitWithPercentPrice && cadence == other.cadence && currency == other.currency && itemId == other.itemId && modelType == other.modelType && name == other.name && unitWithPercentConfig == other.unitWithPercentConfig && billableMetricId == other.billableMetricId && billedInAdvance == other.billedInAdvance && billingCycleConfiguration == other.billingCycleConfiguration && conversionRate == other.conversionRate && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && metadata == other.metadata && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is NewFloatingTieredWithProrationPrice && cadence == other.cadence && currency == other.currency && itemId == other.itemId && modelType == other.modelType && name == other.name && tieredWithProrationConfig == other.tieredWithProrationConfig && billableMetricId == other.billableMetricId && billedInAdvance == other.billedInAdvance && billingCycleConfiguration == other.billingCycleConfiguration && conversionRate == other.conversionRate && 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, currency, itemId, modelType, name, unitWithPercentConfig, billableMetricId, billedInAdvance, billingCycleConfiguration, conversionRate, externalPriceId, fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, metadata, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(cadence, currency, itemId, modelType, name, tieredWithProrationConfig, billableMetricId, billedInAdvance, billingCycleConfiguration, conversionRate, externalPriceId, fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, metadata, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "NewFloatingUnitWithPercentPrice{cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, unitWithPercentConfig=$unitWithPercentConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" + "NewFloatingTieredWithProrationPrice{cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, tieredWithProrationConfig=$tieredWithProrationConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" } @NoAutoDetect - class NewFloatingTieredWithProrationPrice + class NewFloatingUnitWithProrationPrice @JsonCreator private constructor( @JsonProperty("cadence") @@ -23799,10 +23813,9 @@ constructor( @JsonProperty("name") @ExcludeMissing private val name: JsonField = JsonMissing.of(), - @JsonProperty("tiered_with_proration_config") + @JsonProperty("unit_with_proration_config") @ExcludeMissing - private val tieredWithProrationConfig: JsonField = - JsonMissing.of(), + private val unitWithProrationConfig: JsonField = JsonMissing.of(), @JsonProperty("billable_metric_id") @ExcludeMissing private val billableMetricId: JsonField = JsonMissing.of(), @@ -23850,8 +23863,8 @@ constructor( /** The name of the price. */ fun name(): String = name.getRequired("name") - fun tieredWithProrationConfig(): TieredWithProrationConfig = - tieredWithProrationConfig.getRequired("tiered_with_proration_config") + fun unitWithProrationConfig(): UnitWithProrationConfig = + unitWithProrationConfig.getRequired("unit_with_proration_config") /** The id of the billable metric for the price. Only needed if the price is usage-based. */ fun billableMetricId(): Optional = @@ -23918,10 +23931,9 @@ constructor( /** The name of the price. */ @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name - @JsonProperty("tiered_with_proration_config") + @JsonProperty("unit_with_proration_config") @ExcludeMissing - fun _tieredWithProrationConfig(): JsonField = - tieredWithProrationConfig + fun _unitWithProrationConfig(): JsonField = unitWithProrationConfig /** The id of the billable metric for the price. Only needed if the price is usage-based. */ @JsonProperty("billable_metric_id") @@ -23984,7 +23996,7 @@ constructor( private var validated: Boolean = false - fun validate(): NewFloatingTieredWithProrationPrice = apply { + fun validate(): NewFloatingUnitWithProrationPrice = apply { if (validated) { return@apply } @@ -23994,7 +24006,7 @@ constructor( itemId() modelType() name() - tieredWithProrationConfig().validate() + unitWithProrationConfig().validate() billableMetricId() billedInAdvance() billingCycleConfiguration().ifPresent { it.validate() } @@ -24021,7 +24033,7 @@ constructor( private var itemId: JsonField? = null private var modelType: JsonField? = null private var name: JsonField? = null - private var tieredWithProrationConfig: JsonField? = null + private var unitWithProrationConfig: JsonField? = null private var billableMetricId: JsonField = JsonMissing.of() private var billedInAdvance: JsonField = JsonMissing.of() private var billingCycleConfiguration: JsonField = @@ -24037,28 +24049,27 @@ constructor( @JvmSynthetic internal fun from( - newFloatingTieredWithProrationPrice: NewFloatingTieredWithProrationPrice + newFloatingUnitWithProrationPrice: NewFloatingUnitWithProrationPrice ) = apply { - cadence = newFloatingTieredWithProrationPrice.cadence - currency = newFloatingTieredWithProrationPrice.currency - itemId = newFloatingTieredWithProrationPrice.itemId - modelType = newFloatingTieredWithProrationPrice.modelType - name = newFloatingTieredWithProrationPrice.name - tieredWithProrationConfig = - newFloatingTieredWithProrationPrice.tieredWithProrationConfig - billableMetricId = newFloatingTieredWithProrationPrice.billableMetricId - billedInAdvance = newFloatingTieredWithProrationPrice.billedInAdvance + cadence = newFloatingUnitWithProrationPrice.cadence + currency = newFloatingUnitWithProrationPrice.currency + itemId = newFloatingUnitWithProrationPrice.itemId + modelType = newFloatingUnitWithProrationPrice.modelType + name = newFloatingUnitWithProrationPrice.name + unitWithProrationConfig = newFloatingUnitWithProrationPrice.unitWithProrationConfig + billableMetricId = newFloatingUnitWithProrationPrice.billableMetricId + billedInAdvance = newFloatingUnitWithProrationPrice.billedInAdvance billingCycleConfiguration = - newFloatingTieredWithProrationPrice.billingCycleConfiguration - conversionRate = newFloatingTieredWithProrationPrice.conversionRate - externalPriceId = newFloatingTieredWithProrationPrice.externalPriceId - fixedPriceQuantity = newFloatingTieredWithProrationPrice.fixedPriceQuantity - invoiceGroupingKey = newFloatingTieredWithProrationPrice.invoiceGroupingKey + newFloatingUnitWithProrationPrice.billingCycleConfiguration + conversionRate = newFloatingUnitWithProrationPrice.conversionRate + externalPriceId = newFloatingUnitWithProrationPrice.externalPriceId + fixedPriceQuantity = newFloatingUnitWithProrationPrice.fixedPriceQuantity + invoiceGroupingKey = newFloatingUnitWithProrationPrice.invoiceGroupingKey invoicingCycleConfiguration = - newFloatingTieredWithProrationPrice.invoicingCycleConfiguration - metadata = newFloatingTieredWithProrationPrice.metadata + newFloatingUnitWithProrationPrice.invoicingCycleConfiguration + metadata = newFloatingUnitWithProrationPrice.metadata additionalProperties = - newFloatingTieredWithProrationPrice.additionalProperties.toMutableMap() + newFloatingUnitWithProrationPrice.additionalProperties.toMutableMap() } /** The cadence to bill for this price on. */ @@ -24089,12 +24100,12 @@ constructor( /** The name of the price. */ fun name(name: JsonField) = apply { this.name = name } - fun tieredWithProrationConfig(tieredWithProrationConfig: TieredWithProrationConfig) = - tieredWithProrationConfig(JsonField.of(tieredWithProrationConfig)) + fun unitWithProrationConfig(unitWithProrationConfig: UnitWithProrationConfig) = + unitWithProrationConfig(JsonField.of(unitWithProrationConfig)) - fun tieredWithProrationConfig( - tieredWithProrationConfig: JsonField - ) = apply { this.tieredWithProrationConfig = tieredWithProrationConfig } + fun unitWithProrationConfig( + unitWithProrationConfig: JsonField + ) = apply { this.unitWithProrationConfig = unitWithProrationConfig } /** * The id of the billable metric for the price. Only needed if the price is usage-based. @@ -24298,14 +24309,14 @@ constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): NewFloatingTieredWithProrationPrice = - NewFloatingTieredWithProrationPrice( + fun build(): NewFloatingUnitWithProrationPrice = + NewFloatingUnitWithProrationPrice( checkRequired("cadence", cadence), checkRequired("currency", currency), checkRequired("itemId", itemId), checkRequired("modelType", modelType), checkRequired("name", name), - checkRequired("tieredWithProrationConfig", tieredWithProrationConfig), + checkRequired("unitWithProrationConfig", unitWithProrationConfig), billableMetricId, billedInAdvance, billingCycleConfiguration, @@ -24319,6 +24330,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -24410,29 +24422,29 @@ constructor( companion object { - @JvmField val TIERED_WITH_PRORATION = of("tiered_with_proration") + @JvmField val UNIT_WITH_PRORATION = of("unit_with_proration") @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } enum class Known { - TIERED_WITH_PRORATION, + UNIT_WITH_PRORATION, } enum class Value { - TIERED_WITH_PRORATION, + UNIT_WITH_PRORATION, _UNKNOWN, } fun value(): Value = when (this) { - TIERED_WITH_PRORATION -> Value.TIERED_WITH_PRORATION + UNIT_WITH_PRORATION -> Value.UNIT_WITH_PRORATION else -> Value._UNKNOWN } fun known(): Known = when (this) { - TIERED_WITH_PRORATION -> Known.TIERED_WITH_PRORATION + UNIT_WITH_PRORATION -> Known.UNIT_WITH_PRORATION else -> throw OrbInvalidDataException("Unknown ModelType: $value") } @@ -24452,7 +24464,7 @@ constructor( } @NoAutoDetect - class TieredWithProrationConfig + class UnitWithProrationConfig @JsonCreator private constructor( @JsonAnySetter @@ -24465,7 +24477,7 @@ constructor( private var validated: Boolean = false - fun validate(): TieredWithProrationConfig = apply { + fun validate(): UnitWithProrationConfig = apply { if (validated) { return@apply } @@ -24485,9 +24497,9 @@ constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(tieredWithProrationConfig: TieredWithProrationConfig) = apply { + internal fun from(unitWithProrationConfig: UnitWithProrationConfig) = apply { additionalProperties = - tieredWithProrationConfig.additionalProperties.toMutableMap() + unitWithProrationConfig.additionalProperties.toMutableMap() } fun additionalProperties(additionalProperties: Map) = apply { @@ -24512,8 +24524,8 @@ constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): TieredWithProrationConfig = - TieredWithProrationConfig(additionalProperties.toImmutable()) + fun build(): UnitWithProrationConfig = + UnitWithProrationConfig(additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { @@ -24521,7 +24533,7 @@ constructor( return true } - return /* spotless:off */ other is TieredWithProrationConfig && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is UnitWithProrationConfig && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ @@ -24531,7 +24543,7 @@ constructor( override fun hashCode(): Int = hashCode override fun toString() = - "TieredWithProrationConfig{additionalProperties=$additionalProperties}" + "UnitWithProrationConfig{additionalProperties=$additionalProperties}" } /** For custom cadence: specifies the duration of the billing period in days or months. */ @@ -24645,6 +24657,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -24835,6 +24848,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -25000,21 +25014,21 @@ constructor( return true } - return /* spotless:off */ other is NewFloatingTieredWithProrationPrice && cadence == other.cadence && currency == other.currency && itemId == other.itemId && modelType == other.modelType && name == other.name && tieredWithProrationConfig == other.tieredWithProrationConfig && billableMetricId == other.billableMetricId && billedInAdvance == other.billedInAdvance && billingCycleConfiguration == other.billingCycleConfiguration && conversionRate == other.conversionRate && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && metadata == other.metadata && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is NewFloatingUnitWithProrationPrice && cadence == other.cadence && currency == other.currency && itemId == other.itemId && modelType == other.modelType && name == other.name && unitWithProrationConfig == other.unitWithProrationConfig && billableMetricId == other.billableMetricId && billedInAdvance == other.billedInAdvance && billingCycleConfiguration == other.billingCycleConfiguration && conversionRate == other.conversionRate && 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, currency, itemId, modelType, name, tieredWithProrationConfig, billableMetricId, billedInAdvance, billingCycleConfiguration, conversionRate, externalPriceId, fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, metadata, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(cadence, currency, itemId, modelType, name, unitWithProrationConfig, billableMetricId, billedInAdvance, billingCycleConfiguration, conversionRate, externalPriceId, fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, metadata, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "NewFloatingTieredWithProrationPrice{cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, tieredWithProrationConfig=$tieredWithProrationConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" + "NewFloatingUnitWithProrationPrice{cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, unitWithProrationConfig=$unitWithProrationConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" } @NoAutoDetect - class NewFloatingUnitWithProrationPrice + class NewFloatingGroupedAllocationPrice @JsonCreator private constructor( @JsonProperty("cadence") @@ -25023,6 +25037,9 @@ constructor( @JsonProperty("currency") @ExcludeMissing private val currency: JsonField = JsonMissing.of(), + @JsonProperty("grouped_allocation_config") + @ExcludeMissing + private val groupedAllocationConfig: JsonField = JsonMissing.of(), @JsonProperty("item_id") @ExcludeMissing private val itemId: JsonField = JsonMissing.of(), @@ -25032,9 +25049,6 @@ constructor( @JsonProperty("name") @ExcludeMissing private val name: JsonField = JsonMissing.of(), - @JsonProperty("unit_with_proration_config") - @ExcludeMissing - private val unitWithProrationConfig: JsonField = JsonMissing.of(), @JsonProperty("billable_metric_id") @ExcludeMissing private val billableMetricId: JsonField = JsonMissing.of(), @@ -25074,6 +25088,9 @@ constructor( /** An ISO 4217 currency string for which this price is billed in. */ fun currency(): String = currency.getRequired("currency") + fun groupedAllocationConfig(): GroupedAllocationConfig = + groupedAllocationConfig.getRequired("grouped_allocation_config") + /** The id of the item the plan will be associated with. */ fun itemId(): String = itemId.getRequired("item_id") @@ -25082,9 +25099,6 @@ constructor( /** The name of the price. */ fun name(): String = name.getRequired("name") - fun unitWithProrationConfig(): UnitWithProrationConfig = - unitWithProrationConfig.getRequired("unit_with_proration_config") - /** 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")) @@ -25140,6 +25154,10 @@ constructor( /** An ISO 4217 currency string for which this price is billed in. */ @JsonProperty("currency") @ExcludeMissing fun _currency(): JsonField = currency + @JsonProperty("grouped_allocation_config") + @ExcludeMissing + fun _groupedAllocationConfig(): JsonField = groupedAllocationConfig + /** The id of the item the plan will be associated with. */ @JsonProperty("item_id") @ExcludeMissing fun _itemId(): JsonField = itemId @@ -25150,10 +25168,6 @@ constructor( /** The name of the price. */ @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name - @JsonProperty("unit_with_proration_config") - @ExcludeMissing - fun _unitWithProrationConfig(): JsonField = unitWithProrationConfig - /** The id of the billable metric for the price. Only needed if the price is usage-based. */ @JsonProperty("billable_metric_id") @ExcludeMissing @@ -25215,17 +25229,17 @@ constructor( private var validated: Boolean = false - fun validate(): NewFloatingUnitWithProrationPrice = apply { + fun validate(): NewFloatingGroupedAllocationPrice = apply { if (validated) { return@apply } cadence() currency() + groupedAllocationConfig().validate() itemId() modelType() name() - unitWithProrationConfig().validate() billableMetricId() billedInAdvance() billingCycleConfiguration().ifPresent { it.validate() } @@ -25249,10 +25263,10 @@ constructor( private var cadence: JsonField? = null private var currency: JsonField? = null + private var groupedAllocationConfig: JsonField? = null private var itemId: JsonField? = null private var modelType: JsonField? = null private var name: JsonField? = null - private var unitWithProrationConfig: JsonField? = null private var billableMetricId: JsonField = JsonMissing.of() private var billedInAdvance: JsonField = JsonMissing.of() private var billingCycleConfiguration: JsonField = @@ -25268,27 +25282,27 @@ constructor( @JvmSynthetic internal fun from( - newFloatingUnitWithProrationPrice: NewFloatingUnitWithProrationPrice + newFloatingGroupedAllocationPrice: NewFloatingGroupedAllocationPrice ) = apply { - cadence = newFloatingUnitWithProrationPrice.cadence - currency = newFloatingUnitWithProrationPrice.currency - itemId = newFloatingUnitWithProrationPrice.itemId - modelType = newFloatingUnitWithProrationPrice.modelType - name = newFloatingUnitWithProrationPrice.name - unitWithProrationConfig = newFloatingUnitWithProrationPrice.unitWithProrationConfig - billableMetricId = newFloatingUnitWithProrationPrice.billableMetricId - billedInAdvance = newFloatingUnitWithProrationPrice.billedInAdvance + cadence = newFloatingGroupedAllocationPrice.cadence + currency = newFloatingGroupedAllocationPrice.currency + groupedAllocationConfig = newFloatingGroupedAllocationPrice.groupedAllocationConfig + itemId = newFloatingGroupedAllocationPrice.itemId + modelType = newFloatingGroupedAllocationPrice.modelType + name = newFloatingGroupedAllocationPrice.name + billableMetricId = newFloatingGroupedAllocationPrice.billableMetricId + billedInAdvance = newFloatingGroupedAllocationPrice.billedInAdvance billingCycleConfiguration = - newFloatingUnitWithProrationPrice.billingCycleConfiguration - conversionRate = newFloatingUnitWithProrationPrice.conversionRate - externalPriceId = newFloatingUnitWithProrationPrice.externalPriceId - fixedPriceQuantity = newFloatingUnitWithProrationPrice.fixedPriceQuantity - invoiceGroupingKey = newFloatingUnitWithProrationPrice.invoiceGroupingKey + newFloatingGroupedAllocationPrice.billingCycleConfiguration + conversionRate = newFloatingGroupedAllocationPrice.conversionRate + externalPriceId = newFloatingGroupedAllocationPrice.externalPriceId + fixedPriceQuantity = newFloatingGroupedAllocationPrice.fixedPriceQuantity + invoiceGroupingKey = newFloatingGroupedAllocationPrice.invoiceGroupingKey invoicingCycleConfiguration = - newFloatingUnitWithProrationPrice.invoicingCycleConfiguration - metadata = newFloatingUnitWithProrationPrice.metadata + newFloatingGroupedAllocationPrice.invoicingCycleConfiguration + metadata = newFloatingGroupedAllocationPrice.metadata additionalProperties = - newFloatingUnitWithProrationPrice.additionalProperties.toMutableMap() + newFloatingGroupedAllocationPrice.additionalProperties.toMutableMap() } /** The cadence to bill for this price on. */ @@ -25303,6 +25317,13 @@ constructor( /** An ISO 4217 currency string for which this price is billed in. */ fun currency(currency: JsonField) = apply { this.currency = currency } + fun groupedAllocationConfig(groupedAllocationConfig: GroupedAllocationConfig) = + groupedAllocationConfig(JsonField.of(groupedAllocationConfig)) + + fun groupedAllocationConfig( + groupedAllocationConfig: JsonField + ) = apply { this.groupedAllocationConfig = groupedAllocationConfig } + /** The id of the item the plan will be associated with. */ fun itemId(itemId: String) = itemId(JsonField.of(itemId)) @@ -25319,13 +25340,6 @@ constructor( /** The name of the price. */ fun name(name: JsonField) = apply { this.name = name } - fun unitWithProrationConfig(unitWithProrationConfig: UnitWithProrationConfig) = - unitWithProrationConfig(JsonField.of(unitWithProrationConfig)) - - fun unitWithProrationConfig( - unitWithProrationConfig: JsonField - ) = apply { this.unitWithProrationConfig = unitWithProrationConfig } - /** * The id of the billable metric for the price. Only needed if the price is usage-based. */ @@ -25528,14 +25542,14 @@ constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): NewFloatingUnitWithProrationPrice = - NewFloatingUnitWithProrationPrice( + fun build(): NewFloatingGroupedAllocationPrice = + NewFloatingGroupedAllocationPrice( checkRequired("cadence", cadence), checkRequired("currency", currency), + checkRequired("groupedAllocationConfig", groupedAllocationConfig), checkRequired("itemId", itemId), checkRequired("modelType", modelType), checkRequired("name", name), - checkRequired("unitWithProrationConfig", unitWithProrationConfig), billableMetricId, billedInAdvance, billingCycleConfiguration, @@ -25549,6 +25563,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -25630,59 +25645,8 @@ constructor( override fun toString() = value.toString() } - class ModelType - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { - - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - - companion object { - - @JvmField val UNIT_WITH_PRORATION = of("unit_with_proration") - - @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) - } - - enum class Known { - UNIT_WITH_PRORATION, - } - - enum class Value { - UNIT_WITH_PRORATION, - _UNKNOWN, - } - - fun value(): Value = - when (this) { - UNIT_WITH_PRORATION -> Value.UNIT_WITH_PRORATION - else -> Value._UNKNOWN - } - - fun known(): Known = - when (this) { - UNIT_WITH_PRORATION -> Known.UNIT_WITH_PRORATION - 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() - } - @NoAutoDetect - class UnitWithProrationConfig + class GroupedAllocationConfig @JsonCreator private constructor( @JsonAnySetter @@ -25695,7 +25659,7 @@ constructor( private var validated: Boolean = false - fun validate(): UnitWithProrationConfig = apply { + fun validate(): GroupedAllocationConfig = apply { if (validated) { return@apply } @@ -25715,9 +25679,9 @@ constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(unitWithProrationConfig: UnitWithProrationConfig) = apply { + internal fun from(groupedAllocationConfig: GroupedAllocationConfig) = apply { additionalProperties = - unitWithProrationConfig.additionalProperties.toMutableMap() + groupedAllocationConfig.additionalProperties.toMutableMap() } fun additionalProperties(additionalProperties: Map) = apply { @@ -25742,8 +25706,8 @@ constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): UnitWithProrationConfig = - UnitWithProrationConfig(additionalProperties.toImmutable()) + fun build(): GroupedAllocationConfig = + GroupedAllocationConfig(additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { @@ -25751,7 +25715,7 @@ constructor( return true } - return /* spotless:off */ other is UnitWithProrationConfig && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is GroupedAllocationConfig && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ @@ -25761,7 +25725,58 @@ constructor( override fun hashCode(): Int = hashCode override fun toString() = - "UnitWithProrationConfig{additionalProperties=$additionalProperties}" + "GroupedAllocationConfig{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 GROUPED_ALLOCATION = of("grouped_allocation") + + @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) + } + + enum class Known { + GROUPED_ALLOCATION, + } + + enum class Value { + GROUPED_ALLOCATION, + _UNKNOWN, + } + + fun value(): Value = + when (this) { + GROUPED_ALLOCATION -> Value.GROUPED_ALLOCATION + else -> Value._UNKNOWN + } + + fun known(): Known = + when (this) { + GROUPED_ALLOCATION -> Known.GROUPED_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() } /** For custom cadence: specifies the duration of the billing period in days or months. */ @@ -25875,6 +25890,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -26065,6 +26081,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -26230,21 +26247,21 @@ constructor( return true } - return /* spotless:off */ other is NewFloatingUnitWithProrationPrice && cadence == other.cadence && currency == other.currency && itemId == other.itemId && modelType == other.modelType && name == other.name && unitWithProrationConfig == other.unitWithProrationConfig && billableMetricId == other.billableMetricId && billedInAdvance == other.billedInAdvance && billingCycleConfiguration == other.billingCycleConfiguration && conversionRate == other.conversionRate && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && metadata == other.metadata && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is NewFloatingGroupedAllocationPrice && cadence == other.cadence && currency == other.currency && groupedAllocationConfig == other.groupedAllocationConfig && itemId == other.itemId && modelType == other.modelType && name == other.name && billableMetricId == other.billableMetricId && billedInAdvance == other.billedInAdvance && billingCycleConfiguration == other.billingCycleConfiguration && conversionRate == other.conversionRate && 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, currency, itemId, modelType, name, unitWithProrationConfig, billableMetricId, billedInAdvance, billingCycleConfiguration, conversionRate, externalPriceId, fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, metadata, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(cadence, currency, groupedAllocationConfig, itemId, modelType, name, billableMetricId, billedInAdvance, billingCycleConfiguration, conversionRate, externalPriceId, fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, metadata, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "NewFloatingUnitWithProrationPrice{cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, unitWithProrationConfig=$unitWithProrationConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" + "NewFloatingGroupedAllocationPrice{cadence=$cadence, currency=$currency, groupedAllocationConfig=$groupedAllocationConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" } @NoAutoDetect - class NewFloatingGroupedAllocationPrice + class NewFloatingGroupedWithProratedMinimumPrice @JsonCreator private constructor( @JsonProperty("cadence") @@ -26253,9 +26270,10 @@ constructor( @JsonProperty("currency") @ExcludeMissing private val currency: JsonField = JsonMissing.of(), - @JsonProperty("grouped_allocation_config") + @JsonProperty("grouped_with_prorated_minimum_config") @ExcludeMissing - private val groupedAllocationConfig: JsonField = JsonMissing.of(), + private val groupedWithProratedMinimumConfig: JsonField = + JsonMissing.of(), @JsonProperty("item_id") @ExcludeMissing private val itemId: JsonField = JsonMissing.of(), @@ -26304,8 +26322,8 @@ constructor( /** An ISO 4217 currency string for which this price is billed in. */ fun currency(): String = currency.getRequired("currency") - fun groupedAllocationConfig(): GroupedAllocationConfig = - groupedAllocationConfig.getRequired("grouped_allocation_config") + fun groupedWithProratedMinimumConfig(): GroupedWithProratedMinimumConfig = + groupedWithProratedMinimumConfig.getRequired("grouped_with_prorated_minimum_config") /** The id of the item the plan will be associated with. */ fun itemId(): String = itemId.getRequired("item_id") @@ -26370,9 +26388,10 @@ constructor( /** An ISO 4217 currency string for which this price is billed in. */ @JsonProperty("currency") @ExcludeMissing fun _currency(): JsonField = currency - @JsonProperty("grouped_allocation_config") + @JsonProperty("grouped_with_prorated_minimum_config") @ExcludeMissing - fun _groupedAllocationConfig(): JsonField = groupedAllocationConfig + fun _groupedWithProratedMinimumConfig(): JsonField = + groupedWithProratedMinimumConfig /** The id of the item the plan will be associated with. */ @JsonProperty("item_id") @ExcludeMissing fun _itemId(): JsonField = itemId @@ -26445,14 +26464,14 @@ constructor( private var validated: Boolean = false - fun validate(): NewFloatingGroupedAllocationPrice = apply { + fun validate(): NewFloatingGroupedWithProratedMinimumPrice = apply { if (validated) { return@apply } cadence() currency() - groupedAllocationConfig().validate() + groupedWithProratedMinimumConfig().validate() itemId() modelType() name() @@ -26479,7 +26498,9 @@ constructor( private var cadence: JsonField? = null private var currency: JsonField? = null - private var groupedAllocationConfig: JsonField? = null + private var groupedWithProratedMinimumConfig: + JsonField? = + null private var itemId: JsonField? = null private var modelType: JsonField? = null private var name: JsonField? = null @@ -26498,27 +26519,29 @@ constructor( @JvmSynthetic internal fun from( - newFloatingGroupedAllocationPrice: NewFloatingGroupedAllocationPrice + newFloatingGroupedWithProratedMinimumPrice: + NewFloatingGroupedWithProratedMinimumPrice ) = apply { - cadence = newFloatingGroupedAllocationPrice.cadence - currency = newFloatingGroupedAllocationPrice.currency - groupedAllocationConfig = newFloatingGroupedAllocationPrice.groupedAllocationConfig - itemId = newFloatingGroupedAllocationPrice.itemId - modelType = newFloatingGroupedAllocationPrice.modelType - name = newFloatingGroupedAllocationPrice.name - billableMetricId = newFloatingGroupedAllocationPrice.billableMetricId - billedInAdvance = newFloatingGroupedAllocationPrice.billedInAdvance + cadence = newFloatingGroupedWithProratedMinimumPrice.cadence + currency = newFloatingGroupedWithProratedMinimumPrice.currency + groupedWithProratedMinimumConfig = + newFloatingGroupedWithProratedMinimumPrice.groupedWithProratedMinimumConfig + itemId = newFloatingGroupedWithProratedMinimumPrice.itemId + modelType = newFloatingGroupedWithProratedMinimumPrice.modelType + name = newFloatingGroupedWithProratedMinimumPrice.name + billableMetricId = newFloatingGroupedWithProratedMinimumPrice.billableMetricId + billedInAdvance = newFloatingGroupedWithProratedMinimumPrice.billedInAdvance billingCycleConfiguration = - newFloatingGroupedAllocationPrice.billingCycleConfiguration - conversionRate = newFloatingGroupedAllocationPrice.conversionRate - externalPriceId = newFloatingGroupedAllocationPrice.externalPriceId - fixedPriceQuantity = newFloatingGroupedAllocationPrice.fixedPriceQuantity - invoiceGroupingKey = newFloatingGroupedAllocationPrice.invoiceGroupingKey + newFloatingGroupedWithProratedMinimumPrice.billingCycleConfiguration + conversionRate = newFloatingGroupedWithProratedMinimumPrice.conversionRate + externalPriceId = newFloatingGroupedWithProratedMinimumPrice.externalPriceId + fixedPriceQuantity = newFloatingGroupedWithProratedMinimumPrice.fixedPriceQuantity + invoiceGroupingKey = newFloatingGroupedWithProratedMinimumPrice.invoiceGroupingKey invoicingCycleConfiguration = - newFloatingGroupedAllocationPrice.invoicingCycleConfiguration - metadata = newFloatingGroupedAllocationPrice.metadata + newFloatingGroupedWithProratedMinimumPrice.invoicingCycleConfiguration + metadata = newFloatingGroupedWithProratedMinimumPrice.metadata additionalProperties = - newFloatingGroupedAllocationPrice.additionalProperties.toMutableMap() + newFloatingGroupedWithProratedMinimumPrice.additionalProperties.toMutableMap() } /** The cadence to bill for this price on. */ @@ -26533,12 +26556,13 @@ constructor( /** An ISO 4217 currency string for which this price is billed in. */ fun currency(currency: JsonField) = apply { this.currency = currency } - fun groupedAllocationConfig(groupedAllocationConfig: GroupedAllocationConfig) = - groupedAllocationConfig(JsonField.of(groupedAllocationConfig)) + fun groupedWithProratedMinimumConfig( + groupedWithProratedMinimumConfig: GroupedWithProratedMinimumConfig + ) = groupedWithProratedMinimumConfig(JsonField.of(groupedWithProratedMinimumConfig)) - fun groupedAllocationConfig( - groupedAllocationConfig: JsonField - ) = apply { this.groupedAllocationConfig = groupedAllocationConfig } + fun groupedWithProratedMinimumConfig( + groupedWithProratedMinimumConfig: JsonField + ) = apply { this.groupedWithProratedMinimumConfig = groupedWithProratedMinimumConfig } /** The id of the item the plan will be associated with. */ fun itemId(itemId: String) = itemId(JsonField.of(itemId)) @@ -26758,11 +26782,14 @@ constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): NewFloatingGroupedAllocationPrice = - NewFloatingGroupedAllocationPrice( + fun build(): NewFloatingGroupedWithProratedMinimumPrice = + NewFloatingGroupedWithProratedMinimumPrice( checkRequired("cadence", cadence), checkRequired("currency", currency), - checkRequired("groupedAllocationConfig", groupedAllocationConfig), + checkRequired( + "groupedWithProratedMinimumConfig", + groupedWithProratedMinimumConfig + ), checkRequired("itemId", itemId), checkRequired("modelType", modelType), checkRequired("name", name), @@ -26779,6 +26806,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -26861,7 +26889,7 @@ constructor( } @NoAutoDetect - class GroupedAllocationConfig + class GroupedWithProratedMinimumConfig @JsonCreator private constructor( @JsonAnySetter @@ -26874,7 +26902,7 @@ constructor( private var validated: Boolean = false - fun validate(): GroupedAllocationConfig = apply { + fun validate(): GroupedWithProratedMinimumConfig = apply { if (validated) { return@apply } @@ -26894,9 +26922,11 @@ constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(groupedAllocationConfig: GroupedAllocationConfig) = apply { + internal fun from( + groupedWithProratedMinimumConfig: GroupedWithProratedMinimumConfig + ) = apply { additionalProperties = - groupedAllocationConfig.additionalProperties.toMutableMap() + groupedWithProratedMinimumConfig.additionalProperties.toMutableMap() } fun additionalProperties(additionalProperties: Map) = apply { @@ -26921,8 +26951,8 @@ constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): GroupedAllocationConfig = - GroupedAllocationConfig(additionalProperties.toImmutable()) + fun build(): GroupedWithProratedMinimumConfig = + GroupedWithProratedMinimumConfig(additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { @@ -26930,7 +26960,7 @@ constructor( return true } - return /* spotless:off */ other is GroupedAllocationConfig && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is GroupedWithProratedMinimumConfig && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ @@ -26940,7 +26970,7 @@ constructor( override fun hashCode(): Int = hashCode override fun toString() = - "GroupedAllocationConfig{additionalProperties=$additionalProperties}" + "GroupedWithProratedMinimumConfig{additionalProperties=$additionalProperties}" } class ModelType @@ -26953,29 +26983,29 @@ constructor( companion object { - @JvmField val GROUPED_ALLOCATION = of("grouped_allocation") + @JvmField val GROUPED_WITH_PRORATED_MINIMUM = of("grouped_with_prorated_minimum") @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } enum class Known { - GROUPED_ALLOCATION, + GROUPED_WITH_PRORATED_MINIMUM, } enum class Value { - GROUPED_ALLOCATION, + GROUPED_WITH_PRORATED_MINIMUM, _UNKNOWN, } fun value(): Value = when (this) { - GROUPED_ALLOCATION -> Value.GROUPED_ALLOCATION + GROUPED_WITH_PRORATED_MINIMUM -> Value.GROUPED_WITH_PRORATED_MINIMUM else -> Value._UNKNOWN } fun known(): Known = when (this) { - GROUPED_ALLOCATION -> Known.GROUPED_ALLOCATION + GROUPED_WITH_PRORATED_MINIMUM -> Known.GROUPED_WITH_PRORATED_MINIMUM else -> throw OrbInvalidDataException("Unknown ModelType: $value") } @@ -27105,6 +27135,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -27295,6 +27326,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -27460,21 +27492,21 @@ constructor( return true } - return /* spotless:off */ other is NewFloatingGroupedAllocationPrice && cadence == other.cadence && currency == other.currency && groupedAllocationConfig == other.groupedAllocationConfig && itemId == other.itemId && modelType == other.modelType && name == other.name && billableMetricId == other.billableMetricId && billedInAdvance == other.billedInAdvance && billingCycleConfiguration == other.billingCycleConfiguration && conversionRate == other.conversionRate && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && metadata == other.metadata && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is NewFloatingGroupedWithProratedMinimumPrice && cadence == other.cadence && currency == other.currency && groupedWithProratedMinimumConfig == other.groupedWithProratedMinimumConfig && itemId == other.itemId && modelType == other.modelType && name == other.name && billableMetricId == other.billableMetricId && billedInAdvance == other.billedInAdvance && billingCycleConfiguration == other.billingCycleConfiguration && conversionRate == other.conversionRate && 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, currency, groupedAllocationConfig, itemId, modelType, name, billableMetricId, billedInAdvance, billingCycleConfiguration, conversionRate, externalPriceId, fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, metadata, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(cadence, currency, groupedWithProratedMinimumConfig, itemId, modelType, name, billableMetricId, billedInAdvance, billingCycleConfiguration, conversionRate, externalPriceId, fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, metadata, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "NewFloatingGroupedAllocationPrice{cadence=$cadence, currency=$currency, groupedAllocationConfig=$groupedAllocationConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" + "NewFloatingGroupedWithProratedMinimumPrice{cadence=$cadence, currency=$currency, groupedWithProratedMinimumConfig=$groupedWithProratedMinimumConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" } @NoAutoDetect - class NewFloatingGroupedWithProratedMinimumPrice + class NewFloatingGroupedWithMeteredMinimumPrice @JsonCreator private constructor( @JsonProperty("cadence") @@ -27483,9 +27515,9 @@ constructor( @JsonProperty("currency") @ExcludeMissing private val currency: JsonField = JsonMissing.of(), - @JsonProperty("grouped_with_prorated_minimum_config") + @JsonProperty("grouped_with_metered_minimum_config") @ExcludeMissing - private val groupedWithProratedMinimumConfig: JsonField = + private val groupedWithMeteredMinimumConfig: JsonField = JsonMissing.of(), @JsonProperty("item_id") @ExcludeMissing @@ -27535,8 +27567,8 @@ constructor( /** An ISO 4217 currency string for which this price is billed in. */ fun currency(): String = currency.getRequired("currency") - fun groupedWithProratedMinimumConfig(): GroupedWithProratedMinimumConfig = - groupedWithProratedMinimumConfig.getRequired("grouped_with_prorated_minimum_config") + fun groupedWithMeteredMinimumConfig(): GroupedWithMeteredMinimumConfig = + groupedWithMeteredMinimumConfig.getRequired("grouped_with_metered_minimum_config") /** The id of the item the plan will be associated with. */ fun itemId(): String = itemId.getRequired("item_id") @@ -27601,10 +27633,10 @@ constructor( /** An ISO 4217 currency string for which this price is billed in. */ @JsonProperty("currency") @ExcludeMissing fun _currency(): JsonField = currency - @JsonProperty("grouped_with_prorated_minimum_config") + @JsonProperty("grouped_with_metered_minimum_config") @ExcludeMissing - fun _groupedWithProratedMinimumConfig(): JsonField = - groupedWithProratedMinimumConfig + fun _groupedWithMeteredMinimumConfig(): JsonField = + groupedWithMeteredMinimumConfig /** The id of the item the plan will be associated with. */ @JsonProperty("item_id") @ExcludeMissing fun _itemId(): JsonField = itemId @@ -27677,14 +27709,14 @@ constructor( private var validated: Boolean = false - fun validate(): NewFloatingGroupedWithProratedMinimumPrice = apply { + fun validate(): NewFloatingGroupedWithMeteredMinimumPrice = apply { if (validated) { return@apply } cadence() currency() - groupedWithProratedMinimumConfig().validate() + groupedWithMeteredMinimumConfig().validate() itemId() modelType() name() @@ -27711,8 +27743,8 @@ constructor( private var cadence: JsonField? = null private var currency: JsonField? = null - private var groupedWithProratedMinimumConfig: - JsonField? = + private var groupedWithMeteredMinimumConfig: + JsonField? = null private var itemId: JsonField? = null private var modelType: JsonField? = null @@ -27732,29 +27764,28 @@ constructor( @JvmSynthetic internal fun from( - newFloatingGroupedWithProratedMinimumPrice: - NewFloatingGroupedWithProratedMinimumPrice + newFloatingGroupedWithMeteredMinimumPrice: NewFloatingGroupedWithMeteredMinimumPrice ) = apply { - cadence = newFloatingGroupedWithProratedMinimumPrice.cadence - currency = newFloatingGroupedWithProratedMinimumPrice.currency - groupedWithProratedMinimumConfig = - newFloatingGroupedWithProratedMinimumPrice.groupedWithProratedMinimumConfig - itemId = newFloatingGroupedWithProratedMinimumPrice.itemId - modelType = newFloatingGroupedWithProratedMinimumPrice.modelType - name = newFloatingGroupedWithProratedMinimumPrice.name - billableMetricId = newFloatingGroupedWithProratedMinimumPrice.billableMetricId - billedInAdvance = newFloatingGroupedWithProratedMinimumPrice.billedInAdvance + cadence = newFloatingGroupedWithMeteredMinimumPrice.cadence + currency = newFloatingGroupedWithMeteredMinimumPrice.currency + groupedWithMeteredMinimumConfig = + newFloatingGroupedWithMeteredMinimumPrice.groupedWithMeteredMinimumConfig + itemId = newFloatingGroupedWithMeteredMinimumPrice.itemId + modelType = newFloatingGroupedWithMeteredMinimumPrice.modelType + name = newFloatingGroupedWithMeteredMinimumPrice.name + billableMetricId = newFloatingGroupedWithMeteredMinimumPrice.billableMetricId + billedInAdvance = newFloatingGroupedWithMeteredMinimumPrice.billedInAdvance billingCycleConfiguration = - newFloatingGroupedWithProratedMinimumPrice.billingCycleConfiguration - conversionRate = newFloatingGroupedWithProratedMinimumPrice.conversionRate - externalPriceId = newFloatingGroupedWithProratedMinimumPrice.externalPriceId - fixedPriceQuantity = newFloatingGroupedWithProratedMinimumPrice.fixedPriceQuantity - invoiceGroupingKey = newFloatingGroupedWithProratedMinimumPrice.invoiceGroupingKey + newFloatingGroupedWithMeteredMinimumPrice.billingCycleConfiguration + conversionRate = newFloatingGroupedWithMeteredMinimumPrice.conversionRate + externalPriceId = newFloatingGroupedWithMeteredMinimumPrice.externalPriceId + fixedPriceQuantity = newFloatingGroupedWithMeteredMinimumPrice.fixedPriceQuantity + invoiceGroupingKey = newFloatingGroupedWithMeteredMinimumPrice.invoiceGroupingKey invoicingCycleConfiguration = - newFloatingGroupedWithProratedMinimumPrice.invoicingCycleConfiguration - metadata = newFloatingGroupedWithProratedMinimumPrice.metadata + newFloatingGroupedWithMeteredMinimumPrice.invoicingCycleConfiguration + metadata = newFloatingGroupedWithMeteredMinimumPrice.metadata additionalProperties = - newFloatingGroupedWithProratedMinimumPrice.additionalProperties.toMutableMap() + newFloatingGroupedWithMeteredMinimumPrice.additionalProperties.toMutableMap() } /** The cadence to bill for this price on. */ @@ -27769,13 +27800,13 @@ constructor( /** An ISO 4217 currency string for which this price is billed in. */ fun currency(currency: JsonField) = apply { this.currency = currency } - fun groupedWithProratedMinimumConfig( - groupedWithProratedMinimumConfig: GroupedWithProratedMinimumConfig - ) = groupedWithProratedMinimumConfig(JsonField.of(groupedWithProratedMinimumConfig)) + fun groupedWithMeteredMinimumConfig( + groupedWithMeteredMinimumConfig: GroupedWithMeteredMinimumConfig + ) = groupedWithMeteredMinimumConfig(JsonField.of(groupedWithMeteredMinimumConfig)) - fun groupedWithProratedMinimumConfig( - groupedWithProratedMinimumConfig: JsonField - ) = apply { this.groupedWithProratedMinimumConfig = groupedWithProratedMinimumConfig } + fun groupedWithMeteredMinimumConfig( + groupedWithMeteredMinimumConfig: JsonField + ) = apply { this.groupedWithMeteredMinimumConfig = groupedWithMeteredMinimumConfig } /** The id of the item the plan will be associated with. */ fun itemId(itemId: String) = itemId(JsonField.of(itemId)) @@ -27995,13 +28026,13 @@ constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): NewFloatingGroupedWithProratedMinimumPrice = - NewFloatingGroupedWithProratedMinimumPrice( + fun build(): NewFloatingGroupedWithMeteredMinimumPrice = + NewFloatingGroupedWithMeteredMinimumPrice( checkRequired("cadence", cadence), checkRequired("currency", currency), checkRequired( - "groupedWithProratedMinimumConfig", - groupedWithProratedMinimumConfig + "groupedWithMeteredMinimumConfig", + groupedWithMeteredMinimumConfig ), checkRequired("itemId", itemId), checkRequired("modelType", modelType), @@ -28019,6 +28050,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -28101,7 +28133,7 @@ constructor( } @NoAutoDetect - class GroupedWithProratedMinimumConfig + class GroupedWithMeteredMinimumConfig @JsonCreator private constructor( @JsonAnySetter @@ -28114,7 +28146,7 @@ constructor( private var validated: Boolean = false - fun validate(): GroupedWithProratedMinimumConfig = apply { + fun validate(): GroupedWithMeteredMinimumConfig = apply { if (validated) { return@apply } @@ -28135,10 +28167,10 @@ constructor( @JvmSynthetic internal fun from( - groupedWithProratedMinimumConfig: GroupedWithProratedMinimumConfig + groupedWithMeteredMinimumConfig: GroupedWithMeteredMinimumConfig ) = apply { additionalProperties = - groupedWithProratedMinimumConfig.additionalProperties.toMutableMap() + groupedWithMeteredMinimumConfig.additionalProperties.toMutableMap() } fun additionalProperties(additionalProperties: Map) = apply { @@ -28163,8 +28195,8 @@ constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): GroupedWithProratedMinimumConfig = - GroupedWithProratedMinimumConfig(additionalProperties.toImmutable()) + fun build(): GroupedWithMeteredMinimumConfig = + GroupedWithMeteredMinimumConfig(additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { @@ -28172,7 +28204,7 @@ constructor( return true } - return /* spotless:off */ other is GroupedWithProratedMinimumConfig && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is GroupedWithMeteredMinimumConfig && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ @@ -28182,7 +28214,7 @@ constructor( override fun hashCode(): Int = hashCode override fun toString() = - "GroupedWithProratedMinimumConfig{additionalProperties=$additionalProperties}" + "GroupedWithMeteredMinimumConfig{additionalProperties=$additionalProperties}" } class ModelType @@ -28195,29 +28227,29 @@ constructor( companion object { - @JvmField val GROUPED_WITH_PRORATED_MINIMUM = of("grouped_with_prorated_minimum") + @JvmField val GROUPED_WITH_METERED_MINIMUM = of("grouped_with_metered_minimum") @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } enum class Known { - GROUPED_WITH_PRORATED_MINIMUM, + GROUPED_WITH_METERED_MINIMUM, } enum class Value { - GROUPED_WITH_PRORATED_MINIMUM, + GROUPED_WITH_METERED_MINIMUM, _UNKNOWN, } fun value(): Value = when (this) { - GROUPED_WITH_PRORATED_MINIMUM -> Value.GROUPED_WITH_PRORATED_MINIMUM + GROUPED_WITH_METERED_MINIMUM -> Value.GROUPED_WITH_METERED_MINIMUM else -> Value._UNKNOWN } fun known(): Known = when (this) { - GROUPED_WITH_PRORATED_MINIMUM -> Known.GROUPED_WITH_PRORATED_MINIMUM + GROUPED_WITH_METERED_MINIMUM -> Known.GROUPED_WITH_METERED_MINIMUM else -> throw OrbInvalidDataException("Unknown ModelType: $value") } @@ -28347,6 +28379,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -28537,6 +28570,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -28702,21 +28736,21 @@ constructor( return true } - return /* spotless:off */ other is NewFloatingGroupedWithProratedMinimumPrice && cadence == other.cadence && currency == other.currency && groupedWithProratedMinimumConfig == other.groupedWithProratedMinimumConfig && itemId == other.itemId && modelType == other.modelType && name == other.name && billableMetricId == other.billableMetricId && billedInAdvance == other.billedInAdvance && billingCycleConfiguration == other.billingCycleConfiguration && conversionRate == other.conversionRate && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && metadata == other.metadata && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is NewFloatingGroupedWithMeteredMinimumPrice && cadence == other.cadence && currency == other.currency && groupedWithMeteredMinimumConfig == other.groupedWithMeteredMinimumConfig && itemId == other.itemId && modelType == other.modelType && name == other.name && billableMetricId == other.billableMetricId && billedInAdvance == other.billedInAdvance && billingCycleConfiguration == other.billingCycleConfiguration && conversionRate == other.conversionRate && 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, currency, groupedWithProratedMinimumConfig, itemId, modelType, name, billableMetricId, billedInAdvance, billingCycleConfiguration, conversionRate, externalPriceId, fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, metadata, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(cadence, currency, groupedWithMeteredMinimumConfig, itemId, modelType, name, billableMetricId, billedInAdvance, billingCycleConfiguration, conversionRate, externalPriceId, fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, metadata, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "NewFloatingGroupedWithProratedMinimumPrice{cadence=$cadence, currency=$currency, groupedWithProratedMinimumConfig=$groupedWithProratedMinimumConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" + "NewFloatingGroupedWithMeteredMinimumPrice{cadence=$cadence, currency=$currency, groupedWithMeteredMinimumConfig=$groupedWithMeteredMinimumConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" } @NoAutoDetect - class NewFloatingGroupedWithMeteredMinimumPrice + class NewFloatingMatrixWithDisplayNamePrice @JsonCreator private constructor( @JsonProperty("cadence") @@ -28725,13 +28759,13 @@ constructor( @JsonProperty("currency") @ExcludeMissing private val currency: JsonField = JsonMissing.of(), - @JsonProperty("grouped_with_metered_minimum_config") - @ExcludeMissing - private val groupedWithMeteredMinimumConfig: JsonField = - JsonMissing.of(), @JsonProperty("item_id") @ExcludeMissing private val itemId: JsonField = JsonMissing.of(), + @JsonProperty("matrix_with_display_name_config") + @ExcludeMissing + private val matrixWithDisplayNameConfig: JsonField = + JsonMissing.of(), @JsonProperty("model_type") @ExcludeMissing private val modelType: JsonField = JsonMissing.of(), @@ -28777,12 +28811,12 @@ constructor( /** An ISO 4217 currency string for which this price is billed in. */ fun currency(): String = currency.getRequired("currency") - fun groupedWithMeteredMinimumConfig(): GroupedWithMeteredMinimumConfig = - groupedWithMeteredMinimumConfig.getRequired("grouped_with_metered_minimum_config") - /** The id of the item the plan will be associated with. */ fun itemId(): String = itemId.getRequired("item_id") + fun matrixWithDisplayNameConfig(): MatrixWithDisplayNameConfig = + matrixWithDisplayNameConfig.getRequired("matrix_with_display_name_config") + fun modelType(): ModelType = modelType.getRequired("model_type") /** The name of the price. */ @@ -28843,14 +28877,14 @@ constructor( /** An ISO 4217 currency string for which this price is billed in. */ @JsonProperty("currency") @ExcludeMissing fun _currency(): JsonField = currency - @JsonProperty("grouped_with_metered_minimum_config") - @ExcludeMissing - fun _groupedWithMeteredMinimumConfig(): JsonField = - groupedWithMeteredMinimumConfig - /** The id of the item the plan will be associated with. */ @JsonProperty("item_id") @ExcludeMissing fun _itemId(): JsonField = itemId + @JsonProperty("matrix_with_display_name_config") + @ExcludeMissing + fun _matrixWithDisplayNameConfig(): JsonField = + matrixWithDisplayNameConfig + @JsonProperty("model_type") @ExcludeMissing fun _modelType(): JsonField = modelType @@ -28919,15 +28953,15 @@ constructor( private var validated: Boolean = false - fun validate(): NewFloatingGroupedWithMeteredMinimumPrice = apply { + fun validate(): NewFloatingMatrixWithDisplayNamePrice = apply { if (validated) { return@apply } cadence() currency() - groupedWithMeteredMinimumConfig().validate() itemId() + matrixWithDisplayNameConfig().validate() modelType() name() billableMetricId() @@ -28953,10 +28987,8 @@ constructor( private var cadence: JsonField? = null private var currency: JsonField? = null - private var groupedWithMeteredMinimumConfig: - JsonField? = - null private var itemId: JsonField? = null + private var matrixWithDisplayNameConfig: JsonField? = null private var modelType: JsonField? = null private var name: JsonField? = null private var billableMetricId: JsonField = JsonMissing.of() @@ -28974,28 +29006,28 @@ constructor( @JvmSynthetic internal fun from( - newFloatingGroupedWithMeteredMinimumPrice: NewFloatingGroupedWithMeteredMinimumPrice + newFloatingMatrixWithDisplayNamePrice: NewFloatingMatrixWithDisplayNamePrice ) = apply { - cadence = newFloatingGroupedWithMeteredMinimumPrice.cadence - currency = newFloatingGroupedWithMeteredMinimumPrice.currency - groupedWithMeteredMinimumConfig = - newFloatingGroupedWithMeteredMinimumPrice.groupedWithMeteredMinimumConfig - itemId = newFloatingGroupedWithMeteredMinimumPrice.itemId - modelType = newFloatingGroupedWithMeteredMinimumPrice.modelType - name = newFloatingGroupedWithMeteredMinimumPrice.name - billableMetricId = newFloatingGroupedWithMeteredMinimumPrice.billableMetricId - billedInAdvance = newFloatingGroupedWithMeteredMinimumPrice.billedInAdvance + cadence = newFloatingMatrixWithDisplayNamePrice.cadence + currency = newFloatingMatrixWithDisplayNamePrice.currency + itemId = newFloatingMatrixWithDisplayNamePrice.itemId + matrixWithDisplayNameConfig = + newFloatingMatrixWithDisplayNamePrice.matrixWithDisplayNameConfig + modelType = newFloatingMatrixWithDisplayNamePrice.modelType + name = newFloatingMatrixWithDisplayNamePrice.name + billableMetricId = newFloatingMatrixWithDisplayNamePrice.billableMetricId + billedInAdvance = newFloatingMatrixWithDisplayNamePrice.billedInAdvance billingCycleConfiguration = - newFloatingGroupedWithMeteredMinimumPrice.billingCycleConfiguration - conversionRate = newFloatingGroupedWithMeteredMinimumPrice.conversionRate - externalPriceId = newFloatingGroupedWithMeteredMinimumPrice.externalPriceId - fixedPriceQuantity = newFloatingGroupedWithMeteredMinimumPrice.fixedPriceQuantity - invoiceGroupingKey = newFloatingGroupedWithMeteredMinimumPrice.invoiceGroupingKey + newFloatingMatrixWithDisplayNamePrice.billingCycleConfiguration + conversionRate = newFloatingMatrixWithDisplayNamePrice.conversionRate + externalPriceId = newFloatingMatrixWithDisplayNamePrice.externalPriceId + fixedPriceQuantity = newFloatingMatrixWithDisplayNamePrice.fixedPriceQuantity + invoiceGroupingKey = newFloatingMatrixWithDisplayNamePrice.invoiceGroupingKey invoicingCycleConfiguration = - newFloatingGroupedWithMeteredMinimumPrice.invoicingCycleConfiguration - metadata = newFloatingGroupedWithMeteredMinimumPrice.metadata + newFloatingMatrixWithDisplayNamePrice.invoicingCycleConfiguration + metadata = newFloatingMatrixWithDisplayNamePrice.metadata additionalProperties = - newFloatingGroupedWithMeteredMinimumPrice.additionalProperties.toMutableMap() + newFloatingMatrixWithDisplayNamePrice.additionalProperties.toMutableMap() } /** The cadence to bill for this price on. */ @@ -29010,20 +29042,20 @@ constructor( /** An ISO 4217 currency string for which this price is billed in. */ fun currency(currency: JsonField) = apply { this.currency = currency } - fun groupedWithMeteredMinimumConfig( - groupedWithMeteredMinimumConfig: GroupedWithMeteredMinimumConfig - ) = groupedWithMeteredMinimumConfig(JsonField.of(groupedWithMeteredMinimumConfig)) - - fun groupedWithMeteredMinimumConfig( - groupedWithMeteredMinimumConfig: JsonField - ) = apply { this.groupedWithMeteredMinimumConfig = groupedWithMeteredMinimumConfig } - /** 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 matrixWithDisplayNameConfig( + matrixWithDisplayNameConfig: MatrixWithDisplayNameConfig + ) = matrixWithDisplayNameConfig(JsonField.of(matrixWithDisplayNameConfig)) + + fun matrixWithDisplayNameConfig( + matrixWithDisplayNameConfig: JsonField + ) = apply { this.matrixWithDisplayNameConfig = matrixWithDisplayNameConfig } + fun modelType(modelType: ModelType) = modelType(JsonField.of(modelType)) fun modelType(modelType: JsonField) = apply { this.modelType = modelType } @@ -29236,15 +29268,12 @@ constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): NewFloatingGroupedWithMeteredMinimumPrice = - NewFloatingGroupedWithMeteredMinimumPrice( + fun build(): NewFloatingMatrixWithDisplayNamePrice = + NewFloatingMatrixWithDisplayNamePrice( checkRequired("cadence", cadence), checkRequired("currency", currency), - checkRequired( - "groupedWithMeteredMinimumConfig", - groupedWithMeteredMinimumConfig - ), checkRequired("itemId", itemId), + checkRequired("matrixWithDisplayNameConfig", matrixWithDisplayNameConfig), checkRequired("modelType", modelType), checkRequired("name", name), billableMetricId, @@ -29260,6 +29289,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -29342,7 +29372,7 @@ constructor( } @NoAutoDetect - class GroupedWithMeteredMinimumConfig + class MatrixWithDisplayNameConfig @JsonCreator private constructor( @JsonAnySetter @@ -29355,7 +29385,7 @@ constructor( private var validated: Boolean = false - fun validate(): GroupedWithMeteredMinimumConfig = apply { + fun validate(): MatrixWithDisplayNameConfig = apply { if (validated) { return@apply } @@ -29375,12 +29405,11 @@ constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from( - groupedWithMeteredMinimumConfig: GroupedWithMeteredMinimumConfig - ) = apply { - additionalProperties = - groupedWithMeteredMinimumConfig.additionalProperties.toMutableMap() - } + internal fun from(matrixWithDisplayNameConfig: MatrixWithDisplayNameConfig) = + apply { + additionalProperties = + matrixWithDisplayNameConfig.additionalProperties.toMutableMap() + } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -29404,8 +29433,8 @@ constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): GroupedWithMeteredMinimumConfig = - GroupedWithMeteredMinimumConfig(additionalProperties.toImmutable()) + fun build(): MatrixWithDisplayNameConfig = + MatrixWithDisplayNameConfig(additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { @@ -29413,7 +29442,7 @@ constructor( return true } - return /* spotless:off */ other is GroupedWithMeteredMinimumConfig && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is MatrixWithDisplayNameConfig && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ @@ -29423,7 +29452,7 @@ constructor( override fun hashCode(): Int = hashCode override fun toString() = - "GroupedWithMeteredMinimumConfig{additionalProperties=$additionalProperties}" + "MatrixWithDisplayNameConfig{additionalProperties=$additionalProperties}" } class ModelType @@ -29436,29 +29465,29 @@ constructor( companion object { - @JvmField val GROUPED_WITH_METERED_MINIMUM = of("grouped_with_metered_minimum") + @JvmField val MATRIX_WITH_DISPLAY_NAME = of("matrix_with_display_name") @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } enum class Known { - GROUPED_WITH_METERED_MINIMUM, + MATRIX_WITH_DISPLAY_NAME, } enum class Value { - GROUPED_WITH_METERED_MINIMUM, + MATRIX_WITH_DISPLAY_NAME, _UNKNOWN, } fun value(): Value = when (this) { - GROUPED_WITH_METERED_MINIMUM -> Value.GROUPED_WITH_METERED_MINIMUM + MATRIX_WITH_DISPLAY_NAME -> Value.MATRIX_WITH_DISPLAY_NAME else -> Value._UNKNOWN } fun known(): Known = when (this) { - GROUPED_WITH_METERED_MINIMUM -> Known.GROUPED_WITH_METERED_MINIMUM + MATRIX_WITH_DISPLAY_NAME -> Known.MATRIX_WITH_DISPLAY_NAME else -> throw OrbInvalidDataException("Unknown ModelType: $value") } @@ -29588,6 +29617,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -29778,6 +29808,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -29943,23 +29974,26 @@ constructor( return true } - return /* spotless:off */ other is NewFloatingGroupedWithMeteredMinimumPrice && cadence == other.cadence && currency == other.currency && groupedWithMeteredMinimumConfig == other.groupedWithMeteredMinimumConfig && itemId == other.itemId && modelType == other.modelType && name == other.name && billableMetricId == other.billableMetricId && billedInAdvance == other.billedInAdvance && billingCycleConfiguration == other.billingCycleConfiguration && conversionRate == other.conversionRate && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && metadata == other.metadata && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is NewFloatingMatrixWithDisplayNamePrice && cadence == other.cadence && currency == other.currency && itemId == other.itemId && matrixWithDisplayNameConfig == other.matrixWithDisplayNameConfig && modelType == other.modelType && name == other.name && billableMetricId == other.billableMetricId && billedInAdvance == other.billedInAdvance && billingCycleConfiguration == other.billingCycleConfiguration && conversionRate == other.conversionRate && 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, currency, groupedWithMeteredMinimumConfig, itemId, modelType, name, billableMetricId, billedInAdvance, billingCycleConfiguration, conversionRate, externalPriceId, fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, metadata, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(cadence, currency, itemId, matrixWithDisplayNameConfig, modelType, name, billableMetricId, billedInAdvance, billingCycleConfiguration, conversionRate, externalPriceId, fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, metadata, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "NewFloatingGroupedWithMeteredMinimumPrice{cadence=$cadence, currency=$currency, groupedWithMeteredMinimumConfig=$groupedWithMeteredMinimumConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" + "NewFloatingMatrixWithDisplayNamePrice{cadence=$cadence, currency=$currency, itemId=$itemId, matrixWithDisplayNameConfig=$matrixWithDisplayNameConfig, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" } @NoAutoDetect - class NewFloatingMatrixWithDisplayNamePrice + class NewFloatingBulkWithProrationPrice @JsonCreator private constructor( + @JsonProperty("bulk_with_proration_config") + @ExcludeMissing + private val bulkWithProrationConfig: JsonField = JsonMissing.of(), @JsonProperty("cadence") @ExcludeMissing private val cadence: JsonField = JsonMissing.of(), @@ -29969,10 +30003,6 @@ constructor( @JsonProperty("item_id") @ExcludeMissing private val itemId: JsonField = JsonMissing.of(), - @JsonProperty("matrix_with_display_name_config") - @ExcludeMissing - private val matrixWithDisplayNameConfig: JsonField = - JsonMissing.of(), @JsonProperty("model_type") @ExcludeMissing private val modelType: JsonField = JsonMissing.of(), @@ -30012,6 +30042,9 @@ constructor( private val additionalProperties: Map = immutableEmptyMap(), ) { + fun bulkWithProrationConfig(): BulkWithProrationConfig = + bulkWithProrationConfig.getRequired("bulk_with_proration_config") + /** The cadence to bill for this price on. */ fun cadence(): Cadence = cadence.getRequired("cadence") @@ -30021,9 +30054,6 @@ constructor( /** The id of the item the plan will be associated with. */ fun itemId(): String = itemId.getRequired("item_id") - fun matrixWithDisplayNameConfig(): MatrixWithDisplayNameConfig = - matrixWithDisplayNameConfig.getRequired("matrix_with_display_name_config") - fun modelType(): ModelType = modelType.getRequired("model_type") /** The name of the price. */ @@ -30078,6 +30108,10 @@ constructor( */ fun metadata(): Optional = Optional.ofNullable(metadata.getNullable("metadata")) + @JsonProperty("bulk_with_proration_config") + @ExcludeMissing + fun _bulkWithProrationConfig(): JsonField = bulkWithProrationConfig + /** The cadence to bill for this price on. */ @JsonProperty("cadence") @ExcludeMissing fun _cadence(): JsonField = cadence @@ -30087,11 +30121,6 @@ constructor( /** The id of the item the plan will be associated with. */ @JsonProperty("item_id") @ExcludeMissing fun _itemId(): JsonField = itemId - @JsonProperty("matrix_with_display_name_config") - @ExcludeMissing - fun _matrixWithDisplayNameConfig(): JsonField = - matrixWithDisplayNameConfig - @JsonProperty("model_type") @ExcludeMissing fun _modelType(): JsonField = modelType @@ -30160,15 +30189,15 @@ constructor( private var validated: Boolean = false - fun validate(): NewFloatingMatrixWithDisplayNamePrice = apply { + fun validate(): NewFloatingBulkWithProrationPrice = apply { if (validated) { return@apply } + bulkWithProrationConfig().validate() cadence() currency() itemId() - matrixWithDisplayNameConfig().validate() modelType() name() billableMetricId() @@ -30192,10 +30221,10 @@ constructor( class Builder { + private var bulkWithProrationConfig: JsonField? = null private var cadence: JsonField? = null private var currency: JsonField? = null private var itemId: JsonField? = null - private var matrixWithDisplayNameConfig: JsonField? = null private var modelType: JsonField? = null private var name: JsonField? = null private var billableMetricId: JsonField = JsonMissing.of() @@ -30213,30 +30242,36 @@ constructor( @JvmSynthetic internal fun from( - newFloatingMatrixWithDisplayNamePrice: NewFloatingMatrixWithDisplayNamePrice + newFloatingBulkWithProrationPrice: NewFloatingBulkWithProrationPrice ) = apply { - cadence = newFloatingMatrixWithDisplayNamePrice.cadence - currency = newFloatingMatrixWithDisplayNamePrice.currency - itemId = newFloatingMatrixWithDisplayNamePrice.itemId - matrixWithDisplayNameConfig = - newFloatingMatrixWithDisplayNamePrice.matrixWithDisplayNameConfig - modelType = newFloatingMatrixWithDisplayNamePrice.modelType - name = newFloatingMatrixWithDisplayNamePrice.name - billableMetricId = newFloatingMatrixWithDisplayNamePrice.billableMetricId - billedInAdvance = newFloatingMatrixWithDisplayNamePrice.billedInAdvance + bulkWithProrationConfig = newFloatingBulkWithProrationPrice.bulkWithProrationConfig + cadence = newFloatingBulkWithProrationPrice.cadence + currency = newFloatingBulkWithProrationPrice.currency + itemId = newFloatingBulkWithProrationPrice.itemId + modelType = newFloatingBulkWithProrationPrice.modelType + name = newFloatingBulkWithProrationPrice.name + billableMetricId = newFloatingBulkWithProrationPrice.billableMetricId + billedInAdvance = newFloatingBulkWithProrationPrice.billedInAdvance billingCycleConfiguration = - newFloatingMatrixWithDisplayNamePrice.billingCycleConfiguration - conversionRate = newFloatingMatrixWithDisplayNamePrice.conversionRate - externalPriceId = newFloatingMatrixWithDisplayNamePrice.externalPriceId - fixedPriceQuantity = newFloatingMatrixWithDisplayNamePrice.fixedPriceQuantity - invoiceGroupingKey = newFloatingMatrixWithDisplayNamePrice.invoiceGroupingKey + newFloatingBulkWithProrationPrice.billingCycleConfiguration + conversionRate = newFloatingBulkWithProrationPrice.conversionRate + externalPriceId = newFloatingBulkWithProrationPrice.externalPriceId + fixedPriceQuantity = newFloatingBulkWithProrationPrice.fixedPriceQuantity + invoiceGroupingKey = newFloatingBulkWithProrationPrice.invoiceGroupingKey invoicingCycleConfiguration = - newFloatingMatrixWithDisplayNamePrice.invoicingCycleConfiguration - metadata = newFloatingMatrixWithDisplayNamePrice.metadata + newFloatingBulkWithProrationPrice.invoicingCycleConfiguration + metadata = newFloatingBulkWithProrationPrice.metadata additionalProperties = - newFloatingMatrixWithDisplayNamePrice.additionalProperties.toMutableMap() + newFloatingBulkWithProrationPrice.additionalProperties.toMutableMap() } + fun bulkWithProrationConfig(bulkWithProrationConfig: BulkWithProrationConfig) = + bulkWithProrationConfig(JsonField.of(bulkWithProrationConfig)) + + fun bulkWithProrationConfig( + bulkWithProrationConfig: JsonField + ) = apply { this.bulkWithProrationConfig = bulkWithProrationConfig } + /** The cadence to bill for this price on. */ fun cadence(cadence: Cadence) = cadence(JsonField.of(cadence)) @@ -30255,14 +30290,6 @@ constructor( /** The id of the item the plan will be associated with. */ fun itemId(itemId: JsonField) = apply { this.itemId = itemId } - fun matrixWithDisplayNameConfig( - matrixWithDisplayNameConfig: MatrixWithDisplayNameConfig - ) = matrixWithDisplayNameConfig(JsonField.of(matrixWithDisplayNameConfig)) - - fun matrixWithDisplayNameConfig( - matrixWithDisplayNameConfig: JsonField - ) = apply { this.matrixWithDisplayNameConfig = matrixWithDisplayNameConfig } - fun modelType(modelType: ModelType) = modelType(JsonField.of(modelType)) fun modelType(modelType: JsonField) = apply { this.modelType = modelType } @@ -30475,12 +30502,12 @@ constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): NewFloatingMatrixWithDisplayNamePrice = - NewFloatingMatrixWithDisplayNamePrice( + fun build(): NewFloatingBulkWithProrationPrice = + NewFloatingBulkWithProrationPrice( + checkRequired("bulkWithProrationConfig", bulkWithProrationConfig), checkRequired("cadence", cadence), checkRequired("currency", currency), checkRequired("itemId", itemId), - checkRequired("matrixWithDisplayNameConfig", matrixWithDisplayNameConfig), checkRequired("modelType", modelType), checkRequired("name", name), billableMetricId, @@ -30496,6 +30523,90 @@ constructor( ) } + @NoAutoDetect + class BulkWithProrationConfig + @JsonCreator + private constructor( + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): BulkWithProrationConfig = 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(bulkWithProrationConfig: BulkWithProrationConfig) = apply { + additionalProperties = + bulkWithProrationConfig.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(): BulkWithProrationConfig = + BulkWithProrationConfig(additionalProperties.toImmutable()) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is BulkWithProrationConfig && 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() = + "BulkWithProrationConfig{additionalProperties=$additionalProperties}" + } + + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -30577,90 +30688,6 @@ constructor( override fun toString() = value.toString() } - @NoAutoDetect - class MatrixWithDisplayNameConfig - @JsonCreator - private constructor( - @JsonAnySetter - private val additionalProperties: Map = immutableEmptyMap(), - ) { - - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = additionalProperties - - private var validated: Boolean = false - - fun validate(): MatrixWithDisplayNameConfig = 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(matrixWithDisplayNameConfig: MatrixWithDisplayNameConfig) = - apply { - additionalProperties = - matrixWithDisplayNameConfig.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(): MatrixWithDisplayNameConfig = - MatrixWithDisplayNameConfig(additionalProperties.toImmutable()) - } - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is MatrixWithDisplayNameConfig && 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() = - "MatrixWithDisplayNameConfig{additionalProperties=$additionalProperties}" - } - class ModelType @JsonCreator private constructor( @@ -30671,29 +30698,29 @@ constructor( companion object { - @JvmField val MATRIX_WITH_DISPLAY_NAME = of("matrix_with_display_name") + @JvmField val BULK_WITH_PRORATION = of("bulk_with_proration") @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } enum class Known { - MATRIX_WITH_DISPLAY_NAME, + BULK_WITH_PRORATION, } enum class Value { - MATRIX_WITH_DISPLAY_NAME, + BULK_WITH_PRORATION, _UNKNOWN, } fun value(): Value = when (this) { - MATRIX_WITH_DISPLAY_NAME -> Value.MATRIX_WITH_DISPLAY_NAME + BULK_WITH_PRORATION -> Value.BULK_WITH_PRORATION else -> Value._UNKNOWN } fun known(): Known = when (this) { - MATRIX_WITH_DISPLAY_NAME -> Known.MATRIX_WITH_DISPLAY_NAME + BULK_WITH_PRORATION -> Known.BULK_WITH_PRORATION else -> throw OrbInvalidDataException("Unknown ModelType: $value") } @@ -30823,6 +30850,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -31013,6 +31041,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -31178,32 +31207,33 @@ constructor( return true } - return /* spotless:off */ other is NewFloatingMatrixWithDisplayNamePrice && cadence == other.cadence && currency == other.currency && itemId == other.itemId && matrixWithDisplayNameConfig == other.matrixWithDisplayNameConfig && modelType == other.modelType && name == other.name && billableMetricId == other.billableMetricId && billedInAdvance == other.billedInAdvance && billingCycleConfiguration == other.billingCycleConfiguration && conversionRate == other.conversionRate && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && metadata == other.metadata && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is NewFloatingBulkWithProrationPrice && bulkWithProrationConfig == other.bulkWithProrationConfig && cadence == other.cadence && currency == other.currency && itemId == other.itemId && modelType == other.modelType && name == other.name && billableMetricId == other.billableMetricId && billedInAdvance == other.billedInAdvance && billingCycleConfiguration == other.billingCycleConfiguration && conversionRate == other.conversionRate && 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, currency, itemId, matrixWithDisplayNameConfig, modelType, name, billableMetricId, billedInAdvance, billingCycleConfiguration, conversionRate, externalPriceId, fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, metadata, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(bulkWithProrationConfig, cadence, currency, itemId, modelType, name, billableMetricId, billedInAdvance, billingCycleConfiguration, conversionRate, externalPriceId, fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, metadata, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "NewFloatingMatrixWithDisplayNamePrice{cadence=$cadence, currency=$currency, itemId=$itemId, matrixWithDisplayNameConfig=$matrixWithDisplayNameConfig, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" + "NewFloatingBulkWithProrationPrice{bulkWithProrationConfig=$bulkWithProrationConfig, cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" } @NoAutoDetect - class NewFloatingBulkWithProrationPrice + class NewFloatingGroupedTieredPackagePrice @JsonCreator private constructor( - @JsonProperty("bulk_with_proration_config") - @ExcludeMissing - private val bulkWithProrationConfig: JsonField = JsonMissing.of(), @JsonProperty("cadence") @ExcludeMissing private val cadence: JsonField = JsonMissing.of(), @JsonProperty("currency") @ExcludeMissing private val currency: JsonField = JsonMissing.of(), + @JsonProperty("grouped_tiered_package_config") + @ExcludeMissing + private val groupedTieredPackageConfig: JsonField = + JsonMissing.of(), @JsonProperty("item_id") @ExcludeMissing private val itemId: JsonField = JsonMissing.of(), @@ -31246,15 +31276,15 @@ constructor( private val additionalProperties: Map = immutableEmptyMap(), ) { - fun bulkWithProrationConfig(): BulkWithProrationConfig = - bulkWithProrationConfig.getRequired("bulk_with_proration_config") - /** The cadence to bill for this price on. */ fun cadence(): Cadence = cadence.getRequired("cadence") /** An ISO 4217 currency string for which this price is billed in. */ fun currency(): String = currency.getRequired("currency") + fun groupedTieredPackageConfig(): GroupedTieredPackageConfig = + groupedTieredPackageConfig.getRequired("grouped_tiered_package_config") + /** The id of the item the plan will be associated with. */ fun itemId(): String = itemId.getRequired("item_id") @@ -31312,16 +31342,17 @@ constructor( */ fun metadata(): Optional = Optional.ofNullable(metadata.getNullable("metadata")) - @JsonProperty("bulk_with_proration_config") - @ExcludeMissing - fun _bulkWithProrationConfig(): JsonField = bulkWithProrationConfig - /** The cadence to bill for this price on. */ @JsonProperty("cadence") @ExcludeMissing fun _cadence(): JsonField = cadence /** An ISO 4217 currency string for which this price is billed in. */ @JsonProperty("currency") @ExcludeMissing fun _currency(): JsonField = currency + @JsonProperty("grouped_tiered_package_config") + @ExcludeMissing + fun _groupedTieredPackageConfig(): JsonField = + groupedTieredPackageConfig + /** The id of the item the plan will be associated with. */ @JsonProperty("item_id") @ExcludeMissing fun _itemId(): JsonField = itemId @@ -31393,14 +31424,14 @@ constructor( private var validated: Boolean = false - fun validate(): NewFloatingBulkWithProrationPrice = apply { + fun validate(): NewFloatingGroupedTieredPackagePrice = apply { if (validated) { return@apply } - bulkWithProrationConfig().validate() cadence() currency() + groupedTieredPackageConfig().validate() itemId() modelType() name() @@ -31425,9 +31456,9 @@ constructor( class Builder { - private var bulkWithProrationConfig: JsonField? = null private var cadence: JsonField? = null private var currency: JsonField? = null + private var groupedTieredPackageConfig: JsonField? = null private var itemId: JsonField? = null private var modelType: JsonField? = null private var name: JsonField? = null @@ -31446,36 +31477,30 @@ constructor( @JvmSynthetic internal fun from( - newFloatingBulkWithProrationPrice: NewFloatingBulkWithProrationPrice + newFloatingGroupedTieredPackagePrice: NewFloatingGroupedTieredPackagePrice ) = apply { - bulkWithProrationConfig = newFloatingBulkWithProrationPrice.bulkWithProrationConfig - cadence = newFloatingBulkWithProrationPrice.cadence - currency = newFloatingBulkWithProrationPrice.currency - itemId = newFloatingBulkWithProrationPrice.itemId - modelType = newFloatingBulkWithProrationPrice.modelType - name = newFloatingBulkWithProrationPrice.name - billableMetricId = newFloatingBulkWithProrationPrice.billableMetricId - billedInAdvance = newFloatingBulkWithProrationPrice.billedInAdvance + cadence = newFloatingGroupedTieredPackagePrice.cadence + currency = newFloatingGroupedTieredPackagePrice.currency + groupedTieredPackageConfig = + newFloatingGroupedTieredPackagePrice.groupedTieredPackageConfig + itemId = newFloatingGroupedTieredPackagePrice.itemId + modelType = newFloatingGroupedTieredPackagePrice.modelType + name = newFloatingGroupedTieredPackagePrice.name + billableMetricId = newFloatingGroupedTieredPackagePrice.billableMetricId + billedInAdvance = newFloatingGroupedTieredPackagePrice.billedInAdvance billingCycleConfiguration = - newFloatingBulkWithProrationPrice.billingCycleConfiguration - conversionRate = newFloatingBulkWithProrationPrice.conversionRate - externalPriceId = newFloatingBulkWithProrationPrice.externalPriceId - fixedPriceQuantity = newFloatingBulkWithProrationPrice.fixedPriceQuantity - invoiceGroupingKey = newFloatingBulkWithProrationPrice.invoiceGroupingKey + newFloatingGroupedTieredPackagePrice.billingCycleConfiguration + conversionRate = newFloatingGroupedTieredPackagePrice.conversionRate + externalPriceId = newFloatingGroupedTieredPackagePrice.externalPriceId + fixedPriceQuantity = newFloatingGroupedTieredPackagePrice.fixedPriceQuantity + invoiceGroupingKey = newFloatingGroupedTieredPackagePrice.invoiceGroupingKey invoicingCycleConfiguration = - newFloatingBulkWithProrationPrice.invoicingCycleConfiguration - metadata = newFloatingBulkWithProrationPrice.metadata + newFloatingGroupedTieredPackagePrice.invoicingCycleConfiguration + metadata = newFloatingGroupedTieredPackagePrice.metadata additionalProperties = - newFloatingBulkWithProrationPrice.additionalProperties.toMutableMap() + newFloatingGroupedTieredPackagePrice.additionalProperties.toMutableMap() } - fun bulkWithProrationConfig(bulkWithProrationConfig: BulkWithProrationConfig) = - bulkWithProrationConfig(JsonField.of(bulkWithProrationConfig)) - - fun bulkWithProrationConfig( - bulkWithProrationConfig: JsonField - ) = apply { this.bulkWithProrationConfig = bulkWithProrationConfig } - /** The cadence to bill for this price on. */ fun cadence(cadence: Cadence) = cadence(JsonField.of(cadence)) @@ -31488,6 +31513,13 @@ constructor( /** An ISO 4217 currency string for which this price is billed in. */ fun currency(currency: JsonField) = apply { this.currency = currency } + fun groupedTieredPackageConfig(groupedTieredPackageConfig: GroupedTieredPackageConfig) = + groupedTieredPackageConfig(JsonField.of(groupedTieredPackageConfig)) + + fun groupedTieredPackageConfig( + groupedTieredPackageConfig: JsonField + ) = apply { this.groupedTieredPackageConfig = groupedTieredPackageConfig } + /** The id of the item the plan will be associated with. */ fun itemId(itemId: String) = itemId(JsonField.of(itemId)) @@ -31706,11 +31738,11 @@ constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): NewFloatingBulkWithProrationPrice = - NewFloatingBulkWithProrationPrice( - checkRequired("bulkWithProrationConfig", bulkWithProrationConfig), + fun build(): NewFloatingGroupedTieredPackagePrice = + NewFloatingGroupedTieredPackagePrice( checkRequired("cadence", cadence), checkRequired("currency", currency), + checkRequired("groupedTieredPackageConfig", groupedTieredPackageConfig), checkRequired("itemId", itemId), checkRequired("modelType", modelType), checkRequired("name", name), @@ -31727,89 +31759,7 @@ constructor( ) } - @NoAutoDetect - class BulkWithProrationConfig - @JsonCreator - private constructor( - @JsonAnySetter - private val additionalProperties: Map = immutableEmptyMap(), - ) { - - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = additionalProperties - - private var validated: Boolean = false - - fun validate(): BulkWithProrationConfig = 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(bulkWithProrationConfig: BulkWithProrationConfig) = apply { - additionalProperties = - bulkWithProrationConfig.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(): BulkWithProrationConfig = - BulkWithProrationConfig(additionalProperties.toImmutable()) - } - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is BulkWithProrationConfig && 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() = - "BulkWithProrationConfig{additionalProperties=$additionalProperties}" - } - + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -31891,6 +31841,89 @@ constructor( override fun toString() = value.toString() } + @NoAutoDetect + class GroupedTieredPackageConfig + @JsonCreator + private constructor( + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): GroupedTieredPackageConfig = 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(groupedTieredPackageConfig: GroupedTieredPackageConfig) = apply { + additionalProperties = + groupedTieredPackageConfig.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(): GroupedTieredPackageConfig = + GroupedTieredPackageConfig(additionalProperties.toImmutable()) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is GroupedTieredPackageConfig && 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() = + "GroupedTieredPackageConfig{additionalProperties=$additionalProperties}" + } + class ModelType @JsonCreator private constructor( @@ -31901,29 +31934,29 @@ constructor( companion object { - @JvmField val BULK_WITH_PRORATION = of("bulk_with_proration") + @JvmField val GROUPED_TIERED_PACKAGE = of("grouped_tiered_package") @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } enum class Known { - BULK_WITH_PRORATION, + GROUPED_TIERED_PACKAGE, } enum class Value { - BULK_WITH_PRORATION, + GROUPED_TIERED_PACKAGE, _UNKNOWN, } fun value(): Value = when (this) { - BULK_WITH_PRORATION -> Value.BULK_WITH_PRORATION + GROUPED_TIERED_PACKAGE -> Value.GROUPED_TIERED_PACKAGE else -> Value._UNKNOWN } fun known(): Known = when (this) { - BULK_WITH_PRORATION -> Known.BULK_WITH_PRORATION + GROUPED_TIERED_PACKAGE -> Known.GROUPED_TIERED_PACKAGE else -> throw OrbInvalidDataException("Unknown ModelType: $value") } @@ -32053,1239 +32086,7 @@ constructor( ) } - 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 NewFloatingBulkWithProrationPrice && bulkWithProrationConfig == other.bulkWithProrationConfig && cadence == other.cadence && currency == other.currency && itemId == other.itemId && modelType == other.modelType && name == other.name && billableMetricId == other.billableMetricId && billedInAdvance == other.billedInAdvance && billingCycleConfiguration == other.billingCycleConfiguration && conversionRate == other.conversionRate && 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(bulkWithProrationConfig, cadence, currency, itemId, modelType, name, billableMetricId, billedInAdvance, billingCycleConfiguration, conversionRate, externalPriceId, fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, metadata, additionalProperties) } - /* spotless:on */ - - override fun hashCode(): Int = hashCode - - override fun toString() = - "NewFloatingBulkWithProrationPrice{bulkWithProrationConfig=$bulkWithProrationConfig, cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" - } - - @NoAutoDetect - class NewFloatingGroupedTieredPackagePrice - @JsonCreator - private constructor( - @JsonProperty("cadence") - @ExcludeMissing - private val cadence: JsonField = JsonMissing.of(), - @JsonProperty("currency") - @ExcludeMissing - private val currency: JsonField = JsonMissing.of(), - @JsonProperty("grouped_tiered_package_config") - @ExcludeMissing - private val groupedTieredPackageConfig: JsonField = - JsonMissing.of(), - @JsonProperty("item_id") - @ExcludeMissing - private val itemId: 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("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(), - ) { - - /** The cadence to bill for this price on. */ - fun cadence(): Cadence = cadence.getRequired("cadence") - - /** An ISO 4217 currency string for which this price is billed in. */ - fun currency(): String = currency.getRequired("currency") - - fun groupedTieredPackageConfig(): GroupedTieredPackageConfig = - groupedTieredPackageConfig.getRequired("grouped_tiered_package_config") - - /** The id of the item the plan will be associated with. */ - fun itemId(): String = itemId.getRequired("item_id") - - fun modelType(): ModelType = modelType.getRequired("model_type") - - /** The name of the price. */ - fun name(): String = name.getRequired("name") - - /** 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")) - - /** - * 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")) - - /** For custom cadence: specifies the duration of the billing period in days or months. */ - fun billingCycleConfiguration(): Optional = - Optional.ofNullable( - billingCycleConfiguration.getNullable("billing_cycle_configuration") - ) - - /** The per unit conversion rate of the price currency to the invoicing currency. */ - fun conversionRate(): Optional = - Optional.ofNullable(conversionRate.getNullable("conversion_rate")) - - /** An alias for the price. */ - fun externalPriceId(): Optional = - Optional.ofNullable(externalPriceId.getNullable("external_price_id")) - - /** If the Price represents a fixed cost, this represents the quantity of units applied. */ - fun fixedPriceQuantity(): Optional = - Optional.ofNullable(fixedPriceQuantity.getNullable("fixed_price_quantity")) - - /** The property used to group this price on an invoice */ - fun invoiceGroupingKey(): Optional = - Optional.ofNullable(invoiceGroupingKey.getNullable("invoice_grouping_key")) - - /** - * 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") - ) - - /** - * 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")) - - /** The cadence to bill for this price on. */ - @JsonProperty("cadence") @ExcludeMissing fun _cadence(): JsonField = cadence - - /** An ISO 4217 currency string for which this price is billed in. */ - @JsonProperty("currency") @ExcludeMissing fun _currency(): JsonField = currency - - @JsonProperty("grouped_tiered_package_config") - @ExcludeMissing - fun _groupedTieredPackageConfig(): JsonField = - groupedTieredPackageConfig - - /** The id of the item the plan will be associated with. */ - @JsonProperty("item_id") @ExcludeMissing fun _itemId(): JsonField = itemId - - @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 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(): NewFloatingGroupedTieredPackagePrice = apply { - if (validated) { - return@apply - } - - cadence() - currency() - groupedTieredPackageConfig().validate() - itemId() - modelType() - name() - billableMetricId() - billedInAdvance() - billingCycleConfiguration().ifPresent { it.validate() } - conversionRate() - 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 currency: JsonField? = null - private var groupedTieredPackageConfig: JsonField? = null - private var itemId: 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 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( - newFloatingGroupedTieredPackagePrice: NewFloatingGroupedTieredPackagePrice - ) = apply { - cadence = newFloatingGroupedTieredPackagePrice.cadence - currency = newFloatingGroupedTieredPackagePrice.currency - groupedTieredPackageConfig = - newFloatingGroupedTieredPackagePrice.groupedTieredPackageConfig - itemId = newFloatingGroupedTieredPackagePrice.itemId - modelType = newFloatingGroupedTieredPackagePrice.modelType - name = newFloatingGroupedTieredPackagePrice.name - billableMetricId = newFloatingGroupedTieredPackagePrice.billableMetricId - billedInAdvance = newFloatingGroupedTieredPackagePrice.billedInAdvance - billingCycleConfiguration = - newFloatingGroupedTieredPackagePrice.billingCycleConfiguration - conversionRate = newFloatingGroupedTieredPackagePrice.conversionRate - externalPriceId = newFloatingGroupedTieredPackagePrice.externalPriceId - fixedPriceQuantity = newFloatingGroupedTieredPackagePrice.fixedPriceQuantity - invoiceGroupingKey = newFloatingGroupedTieredPackagePrice.invoiceGroupingKey - invoicingCycleConfiguration = - newFloatingGroupedTieredPackagePrice.invoicingCycleConfiguration - metadata = newFloatingGroupedTieredPackagePrice.metadata - additionalProperties = - newFloatingGroupedTieredPackagePrice.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 } - - /** An ISO 4217 currency string for which this price is billed in. */ - fun currency(currency: String) = currency(JsonField.of(currency)) - - /** An ISO 4217 currency string for which this price is billed in. */ - fun currency(currency: JsonField) = apply { this.currency = currency } - - fun groupedTieredPackageConfig(groupedTieredPackageConfig: GroupedTieredPackageConfig) = - groupedTieredPackageConfig(JsonField.of(groupedTieredPackageConfig)) - - fun groupedTieredPackageConfig( - groupedTieredPackageConfig: JsonField - ) = apply { this.groupedTieredPackageConfig = groupedTieredPackageConfig } - - /** 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 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 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(): NewFloatingGroupedTieredPackagePrice = - NewFloatingGroupedTieredPackagePrice( - checkRequired("cadence", cadence), - checkRequired("currency", currency), - checkRequired("groupedTieredPackageConfig", groupedTieredPackageConfig), - checkRequired("itemId", itemId), - checkRequired("modelType", modelType), - checkRequired("name", name), - billableMetricId, - billedInAdvance, - billingCycleConfiguration, - conversionRate, - 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 GroupedTieredPackageConfig - @JsonCreator - private constructor( - @JsonAnySetter - private val additionalProperties: Map = immutableEmptyMap(), - ) { - - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = additionalProperties - - private var validated: Boolean = false - - fun validate(): GroupedTieredPackageConfig = 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(groupedTieredPackageConfig: GroupedTieredPackageConfig) = apply { - additionalProperties = - groupedTieredPackageConfig.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(): GroupedTieredPackageConfig = - GroupedTieredPackageConfig(additionalProperties.toImmutable()) - } - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is GroupedTieredPackageConfig && 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() = - "GroupedTieredPackageConfig{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 GROUPED_TIERED_PACKAGE = of("grouped_tiered_package") - - @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) - } - - enum class Known { - GROUPED_TIERED_PACKAGE, - } - - enum class Value { - GROUPED_TIERED_PACKAGE, - _UNKNOWN, - } - - fun value(): Value = - when (this) { - GROUPED_TIERED_PACKAGE -> Value.GROUPED_TIERED_PACKAGE - else -> Value._UNKNOWN - } - - fun known(): Known = - when (this) { - GROUPED_TIERED_PACKAGE -> Known.GROUPED_TIERED_PACKAGE - 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( @@ -33476,6 +32277,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceEvaluateParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceEvaluateParams.kt index 92aec1a6..cea9a59d 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceEvaluateParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceEvaluateParams.kt @@ -23,8 +23,8 @@ import java.util.Optional /** * This endpoint is used to evaluate the output of a price for a given customer and time range. It * enables filtering and grouping the output using - * [computed properties](../guides/extensibility/advanced-metrics#computed-properties), supporting - * the following workflows: + * [computed properties](/extensibility/advanced-metrics#computed-properties), supporting the + * following workflows: * 1. Showing detailed usage and costs to the end customer. * 2. Auditing subtotals on invoice line items. * @@ -62,15 +62,14 @@ constructor( fun externalCustomerId(): Optional = body.externalCustomerId() /** - * A boolean [computed property](../guides/extensibility/advanced-metrics#computed-properties) - * used to filter the underlying billable metric + * A boolean [computed property](/extensibility/advanced-metrics#computed-properties) used to + * filter the underlying billable metric */ fun filter(): Optional = body.filter() /** - * Properties (or - * [computed properties](../guides/extensibility/advanced-metrics#computed-properties)) used to - * group the underlying billable metric + * Properties (or [computed properties](/extensibility/advanced-metrics#computed-properties)) + * used to group the underlying billable metric */ fun groupingKeys(): Optional> = body.groupingKeys() @@ -87,15 +86,14 @@ constructor( fun _externalCustomerId(): JsonField = body._externalCustomerId() /** - * A boolean [computed property](../guides/extensibility/advanced-metrics#computed-properties) - * used to filter the underlying billable metric + * A boolean [computed property](/extensibility/advanced-metrics#computed-properties) used to + * filter the underlying billable metric */ fun _filter(): JsonField = body._filter() /** - * Properties (or - * [computed properties](../guides/extensibility/advanced-metrics#computed-properties)) used to - * group the underlying billable metric + * Properties (or [computed properties](/extensibility/advanced-metrics#computed-properties)) + * used to group the underlying billable metric */ fun _groupingKeys(): JsonField> = body._groupingKeys() @@ -159,16 +157,15 @@ constructor( Optional.ofNullable(externalCustomerId.getNullable("external_customer_id")) /** - * A boolean - * [computed property](../guides/extensibility/advanced-metrics#computed-properties) used to - * filter the underlying billable metric + * A boolean [computed property](/extensibility/advanced-metrics#computed-properties) used + * to filter the underlying billable metric */ fun filter(): Optional = Optional.ofNullable(filter.getNullable("filter")) /** * Properties (or - * [computed properties](../guides/extensibility/advanced-metrics#computed-properties)) used - * to group the underlying billable metric + * [computed properties](/extensibility/advanced-metrics#computed-properties)) used to group + * the underlying billable metric */ fun groupingKeys(): Optional> = Optional.ofNullable(groupingKeys.getNullable("grouping_keys")) @@ -194,16 +191,15 @@ constructor( fun _externalCustomerId(): JsonField = externalCustomerId /** - * A boolean - * [computed property](../guides/extensibility/advanced-metrics#computed-properties) used to - * filter the underlying billable metric + * A boolean [computed property](/extensibility/advanced-metrics#computed-properties) used + * to filter the underlying billable metric */ @JsonProperty("filter") @ExcludeMissing fun _filter(): JsonField = filter /** * Properties (or - * [computed properties](../guides/extensibility/advanced-metrics#computed-properties)) used - * to group the underlying billable metric + * [computed properties](/extensibility/advanced-metrics#computed-properties)) used to group + * the underlying billable metric */ @JsonProperty("grouping_keys") @ExcludeMissing @@ -298,37 +294,34 @@ constructor( } /** - * A boolean - * [computed property](../guides/extensibility/advanced-metrics#computed-properties) + * A boolean [computed property](/extensibility/advanced-metrics#computed-properties) * used to filter the underlying billable metric */ fun filter(filter: String?) = filter(JsonField.ofNullable(filter)) /** - * A boolean - * [computed property](../guides/extensibility/advanced-metrics#computed-properties) + * A boolean [computed property](/extensibility/advanced-metrics#computed-properties) * used to filter the underlying billable metric */ fun filter(filter: Optional) = filter(filter.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 underlying billable metric */ fun filter(filter: JsonField) = apply { this.filter = filter } /** * Properties (or - * [computed properties](../guides/extensibility/advanced-metrics#computed-properties)) - * used to group the underlying billable metric + * [computed properties](/extensibility/advanced-metrics#computed-properties)) used to + * group the underlying billable metric */ fun groupingKeys(groupingKeys: List) = groupingKeys(JsonField.of(groupingKeys)) /** * Properties (or - * [computed properties](../guides/extensibility/advanced-metrics#computed-properties)) - * used to group the underlying billable metric + * [computed properties](/extensibility/advanced-metrics#computed-properties)) used to + * group the underlying billable metric */ fun groupingKeys(groupingKeys: JsonField>) = apply { this.groupingKeys = groupingKeys.map { it.toMutableList() } @@ -336,8 +329,8 @@ constructor( /** * Properties (or - * [computed properties](../guides/extensibility/advanced-metrics#computed-properties)) - * used to group the underlying billable metric + * [computed properties](/extensibility/advanced-metrics#computed-properties)) used to + * group the underlying billable metric */ fun addGroupingKey(groupingKey: String) = apply { groupingKeys = @@ -468,37 +461,34 @@ constructor( } /** - * A boolean - * [computed property](../guides/extensibility/advanced-metrics#computed-properties) used to - * filter the underlying billable metric + * A boolean [computed property](/extensibility/advanced-metrics#computed-properties) used + * to filter the underlying billable metric */ fun filter(filter: String?) = apply { body.filter(filter) } /** - * A boolean - * [computed property](../guides/extensibility/advanced-metrics#computed-properties) used to - * filter the underlying billable metric + * A boolean [computed property](/extensibility/advanced-metrics#computed-properties) used + * to filter the underlying billable metric */ fun filter(filter: Optional) = filter(filter.orElse(null)) /** - * A boolean - * [computed property](../guides/extensibility/advanced-metrics#computed-properties) used to - * filter the underlying billable metric + * A boolean [computed property](/extensibility/advanced-metrics#computed-properties) used + * to filter the underlying billable metric */ fun filter(filter: JsonField) = apply { body.filter(filter) } /** * Properties (or - * [computed properties](../guides/extensibility/advanced-metrics#computed-properties)) used - * to group the underlying billable metric + * [computed properties](/extensibility/advanced-metrics#computed-properties)) used to group + * the underlying billable metric */ fun groupingKeys(groupingKeys: List) = apply { body.groupingKeys(groupingKeys) } /** * Properties (or - * [computed properties](../guides/extensibility/advanced-metrics#computed-properties)) used - * to group the underlying billable metric + * [computed properties](/extensibility/advanced-metrics#computed-properties)) used to group + * the underlying billable metric */ fun groupingKeys(groupingKeys: JsonField>) = apply { body.groupingKeys(groupingKeys) @@ -506,8 +496,8 @@ constructor( /** * Properties (or - * [computed properties](../guides/extensibility/advanced-metrics#computed-properties)) used - * to group the underlying billable metric + * [computed properties](/extensibility/advanced-metrics#computed-properties)) used to group + * the underlying billable metric */ fun addGroupingKey(groupingKey: String) = apply { body.addGroupingKey(groupingKey) } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceExternalPriceIdFetchParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceExternalPriceIdFetchParams.kt index bb63e542..937dbba9 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceExternalPriceIdFetchParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceExternalPriceIdFetchParams.kt @@ -10,7 +10,7 @@ import java.util.Objects /** * This endpoint returns a price given an external price id. See the - * [price creation API](../reference/create-price) for more information about external price + * [price creation API](/api-reference/price/create-price) for more information about external price * aliases. */ class PriceExternalPriceIdFetchParams diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceListPage.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceListPage.kt index 48aba038..c9ba68e8 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceListPage.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceListPage.kt @@ -19,6 +19,10 @@ import java.util.Optional import java.util.stream.Stream import java.util.stream.StreamSupport +/** + * This endpoint is used to list all add-on prices created using the + * [price creation endpoint](/api-reference/price/create-price). + */ class PriceListPage private constructor( private val pricesService: PriceService, diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceListPageAsync.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceListPageAsync.kt index 4d79fbc2..56d4f816 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceListPageAsync.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceListPageAsync.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 list all add-on prices created using the + * [price creation endpoint](/api-reference/price/create-price). + */ class PriceListPageAsync private constructor( private val pricesService: PriceServiceAsync, diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceListParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceListParams.kt index 9d144c9c..3e8c8bd1 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceListParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceListParams.kt @@ -10,7 +10,7 @@ import java.util.Optional /** * This endpoint is used to list all add-on prices created using the - * [price creation endpoint](../reference/create-price). + * [price creation endpoint](/api-reference/price/create-price). */ class PriceListParams constructor( diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/Subscription.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/Subscription.kt index a544bea5..49c20cb0 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/Subscription.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/Subscription.kt @@ -32,8 +32,7 @@ import java.util.Optional import kotlin.jvm.optionals.getOrNull /** - * A [subscription](../guides/core-concepts.mdx#subscription) represents the purchase of a plan by a - * customer. + * A [subscription](/core-concepts#subscription) represents the purchase of a plan by a customer. * * By default, subscriptions begin on the day that they're created and renew automatically for each * billing cycle at the cadence that's configured in the plan definition. @@ -185,8 +184,8 @@ private constructor( * 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. + * identifier. See [Customer ID Aliases](/events-and-metrics/customer-aliases) for further + * information about how these aliases work in Orb. * * In addition to having an identifier in your system, a customer may exist in a payment * provider solution like Stripe. Use the `payment_provider_id` and the `payment_provider` enum @@ -194,8 +193,8 @@ private constructor( * * 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. */ fun customer(): Customer = customer.getRequired("customer") @@ -242,9 +241,9 @@ private constructor( fun netTerms(): Long = netTerms.getRequired("net_terms") /** - * 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). */ fun plan(): Plan = plan.getRequired("plan") @@ -324,8 +323,8 @@ private constructor( * 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. + * identifier. See [Customer ID Aliases](/events-and-metrics/customer-aliases) for further + * information about how these aliases work in Orb. * * In addition to having an identifier in your system, a customer may exist in a payment * provider solution like Stripe. Use the `payment_provider_id` and the `payment_provider` enum @@ -333,8 +332,8 @@ private constructor( * * 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. */ @JsonProperty("customer") @ExcludeMissing fun _customer(): JsonField = customer @@ -388,9 +387,9 @@ private constructor( @JsonProperty("net_terms") @ExcludeMissing fun _netTerms(): JsonField = netTerms /** - * 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). */ @JsonProperty("plan") @ExcludeMissing fun _plan(): JsonField = plan @@ -685,8 +684,8 @@ private constructor( * 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. + * identifier. See [Customer ID Aliases](/events-and-metrics/customer-aliases) for further + * information about how these aliases work in Orb. * * In addition to having an identifier in your system, a customer may exist in a payment * provider solution like Stripe. Use the `payment_provider_id` and the `payment_provider` @@ -694,8 +693,8 @@ private constructor( * * 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. + * account's timezone. See [Timezone localization](/essentials/timezones) for information on + * what this timezone parameter influences within Orb. */ fun customer(customer: Customer) = customer(JsonField.of(customer)) @@ -705,8 +704,8 @@ private constructor( * 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. + * identifier. See [Customer ID Aliases](/events-and-metrics/customer-aliases) for further + * information about how these aliases work in Orb. * * In addition to having an identifier in your system, a customer may exist in a payment * provider solution like Stripe. Use the `payment_provider_id` and the `payment_provider` @@ -714,8 +713,8 @@ private constructor( * * 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. + * account's timezone. See [Timezone localization](/essentials/timezones) for information on + * what this timezone parameter influences within Orb. */ fun customer(customer: JsonField) = apply { this.customer = customer } @@ -897,18 +896,16 @@ private constructor( fun netTerms(netTerms: JsonField) = apply { this.netTerms = netTerms } /** - * 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). */ fun plan(plan: Plan) = plan(JsonField.of(plan)) /** - * 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). */ fun plan(plan: JsonField) = apply { this.plan = plan } @@ -5392,224 +5389,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") @@ -5671,224 +5452,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 @@ -6094,224 +5659,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.of(price)) @@ -6324,224 +5673,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 } @@ -6554,224 +5687,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)) @@ -6784,224 +5701,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)) @@ -7014,224 +5715,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)) @@ -7244,224 +5729,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)) @@ -7474,224 +5743,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(tieredBpsPrice: Price.TieredBpsPrice) = price(Price.ofTieredBpsPrice(tieredBpsPrice)) @@ -7705,684 +5758,36 @@ 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" - * } - * ... - * } - * ``` + * 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. + * 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. * - * ```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" - * } - * ] - * } - * ... - * ``` + * 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. * - * ## 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)) @@ -8395,224 +5800,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)) @@ -8626,224 +5815,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)) @@ -8857,224 +5830,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)) @@ -9088,224 +5845,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)) @@ -9319,224 +5860,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)) @@ -9550,224 +5875,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)) @@ -9781,455 +5890,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)) @@ -10243,224 +5920,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)) @@ -10474,224 +5935,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)) @@ -10705,224 +5950,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)) @@ -10936,224 +5965,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)) @@ -11167,224 +5980,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)) @@ -11398,224 +5995,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)) @@ -11629,224 +6010,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)) @@ -11860,459 +6025,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)) - /** * The start date of the price interval. This is the date that Orb starts billing for * this price. diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionCancelParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionCancelParams.kt index 497b3ce0..04a706ef 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionCancelParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionCancelParams.kt @@ -71,7 +71,7 @@ import java.util.Optional * invoice, Orb will generate a balance refund for the current period. If the cancellation is before * the most recently issued invoice, Orb will void the intervening invoice and generate a new one * based on the new dates for the subscription. See the section on - * [cancellation behaviors](../guides/product-catalog/creating-subscriptions.md#cancellation-behaviors). + * [cancellation behaviors](/product-catalog/creating-subscriptions#cancellation-behaviors). */ class SubscriptionCancelParams constructor( @@ -450,6 +450,7 @@ constructor( ) } + /** Determines the timing of subscription cancellation */ class CancelOption @JsonCreator private constructor( diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionCancelResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionCancelResponse.kt index c5513eed..70f0d2b8 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionCancelResponse.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionCancelResponse.kt @@ -167,8 +167,8 @@ private constructor( * 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. + * identifier. See [Customer ID Aliases](/events-and-metrics/customer-aliases) for further + * information about how these aliases work in Orb. * * In addition to having an identifier in your system, a customer may exist in a payment * provider solution like Stripe. Use the `payment_provider_id` and the `payment_provider` enum @@ -176,8 +176,8 @@ private constructor( * * 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. */ fun customer(): Customer = customer.getRequired("customer") @@ -224,9 +224,9 @@ private constructor( fun netTerms(): Long = netTerms.getRequired("net_terms") /** - * 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). */ fun plan(): Plan = plan.getRequired("plan") @@ -306,8 +306,8 @@ private constructor( * 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. + * identifier. See [Customer ID Aliases](/events-and-metrics/customer-aliases) for further + * information about how these aliases work in Orb. * * In addition to having an identifier in your system, a customer may exist in a payment * provider solution like Stripe. Use the `payment_provider_id` and the `payment_provider` enum @@ -315,8 +315,8 @@ private constructor( * * 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. */ @JsonProperty("customer") @ExcludeMissing fun _customer(): JsonField = customer @@ -370,9 +370,9 @@ private constructor( @JsonProperty("net_terms") @ExcludeMissing fun _netTerms(): JsonField = netTerms /** - * 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). */ @JsonProperty("plan") @ExcludeMissing fun _plan(): JsonField = plan @@ -672,8 +672,8 @@ private constructor( * 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. + * identifier. See [Customer ID Aliases](/events-and-metrics/customer-aliases) for further + * information about how these aliases work in Orb. * * In addition to having an identifier in your system, a customer may exist in a payment * provider solution like Stripe. Use the `payment_provider_id` and the `payment_provider` @@ -681,8 +681,8 @@ private constructor( * * 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. + * account's timezone. See [Timezone localization](/essentials/timezones) for information on + * what this timezone parameter influences within Orb. */ fun customer(customer: Customer) = customer(JsonField.of(customer)) @@ -692,8 +692,8 @@ private constructor( * 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. + * identifier. See [Customer ID Aliases](/events-and-metrics/customer-aliases) for further + * information about how these aliases work in Orb. * * In addition to having an identifier in your system, a customer may exist in a payment * provider solution like Stripe. Use the `payment_provider_id` and the `payment_provider` @@ -701,8 +701,8 @@ private constructor( * * 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. + * account's timezone. See [Timezone localization](/essentials/timezones) for information on + * what this timezone parameter influences within Orb. */ fun customer(customer: JsonField) = apply { this.customer = customer } @@ -884,18 +884,16 @@ private constructor( fun netTerms(netTerms: JsonField) = apply { this.netTerms = netTerms } /** - * 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). */ fun plan(plan: Plan) = plan(JsonField.of(plan)) /** - * 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). */ fun plan(plan: JsonField) = apply { this.plan = plan } @@ -5379,224 +5377,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") @@ -5658,224 +5440,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 @@ -6081,224 +5647,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.of(price)) @@ -6311,224 +5661,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 } @@ -6541,224 +5675,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)) @@ -6771,224 +5689,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)) @@ -7001,224 +5703,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)) @@ -7231,224 +5717,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)) @@ -7461,224 +5731,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(tieredBpsPrice: Price.TieredBpsPrice) = price(Price.ofTieredBpsPrice(tieredBpsPrice)) @@ -7692,684 +5746,36 @@ 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" - * } - * ... - * } - * ``` + * 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. + * 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. * - * ```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" - * } - * ] - * } - * ... - * ``` + * 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. * - * ## 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)) @@ -8382,224 +5788,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)) @@ -8613,224 +5803,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)) @@ -8844,224 +5818,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)) @@ -9075,224 +5833,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)) @@ -9306,224 +5848,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)) @@ -9537,224 +5863,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)) @@ -9768,455 +5878,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)) @@ -10230,224 +5908,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)) @@ -10461,224 +5923,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)) @@ -10692,224 +5938,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)) @@ -10923,224 +5953,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)) @@ -11154,224 +5968,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)) @@ -11385,224 +5983,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)) @@ -11616,224 +5998,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)) @@ -11847,459 +6013,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)) - /** * The start date of the price interval. This is the date that Orb starts billing for * this price. diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionCreateParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionCreateParams.kt index 6ff88aa6..13f0c889 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionCreateParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionCreateParams.kt @@ -42,7 +42,7 @@ import kotlin.jvm.optionals.getOrNull * billing cycle at the cadence that's configured in the plan definition. * * The default configuration for subscriptions in Orb is **In-advance billing** and **Beginning of - * month alignment** (see [Subscription](../guides/concepts#subscription) for more details). + * month alignment** (see [Subscription](/core-concepts##subscription) for more details). * * In order to change the alignment behavior, Orb also supports billing subscriptions on the day of * the month they are created. If `align_billing_with_subscription_start_date = true` is specified, @@ -64,26 +64,26 @@ import kotlin.jvm.optionals.getOrNull * created. This is useful when a customer has prices that differ from the default prices for a * specific plan. * - * :::info This feature is only available for accounts that have migrated to Subscription Overrides + * This feature is only available for accounts that have migrated to Subscription Overrides * Version 2. You can find your Subscription Overrides Version at the bottom of your - * [Plans page](https://app.withorb.com/plans) ::: + * [Plans page](https://app.withorb.com/plans) * * ### Adding Prices * * To add prices, provide a list of objects with the key `add_prices`. An object in the list must * specify an existing add-on price with a `price_id` or `external_price_id` field, or create a new * add-on price by including an object with the key `price`, identical to what would be used in the - * request body for the [create price endpoint](../reference/create-price). See the - * [Price resource](../reference/price) for the specification of different price model - * configurations possible in this object. + * request body for the [create price endpoint](/api-reference/price/create-price). See the + * [Price resource](/product-catalog/price-configuration) for the specification of different price + * model configurations possible in this object. * * If the plan has phases, each object in the list must include a number with `plan_phase_order` key * to indicate which phase the price should be added to. * * An object in the list can specify an optional `start_date` and optional `end_date`. This is * equivalent to creating a price interval with the - * [add/edit price intervals endpoint](../reference/add-edit-price-intervals). If unspecified, the - * start or end date of the phase or subscription will be used. + * [add/edit price intervals endpoint](/api-reference/price-interval/add-or-edit-price-intervals). + * If unspecified, the start or end date of the phase or subscription will be used. * * An object in the list can specify an optional `minimum_amount`, `maximum_amount`, or `discounts`. * This will create adjustments which apply only to this price. @@ -104,12 +104,14 @@ import kotlin.jvm.optionals.getOrNull * price to replace it with by either referencing an existing add-on price with a `price_id` or * `external_price_id` field, or by creating a new add-on price by including an object with the key * `price`, identical to what would be used in the request body for the - * [create price endpoint](../reference/create-price). See the [Price resource](../reference/price) - * for the specification of different price model configurations possible in this object. + * [create price endpoint](/api-reference/price/create-price). See the + * [Price resource](/product-catalog/price-configuration) for the specification of different price + * model configurations possible in this object. * * For fixed fees, an object in the list can supply a `fixed_price_quantity` instead of a `price`, * `price_id`, or `external_price_id` field. This will update only the quantity for the price, - * similar to the [Update price quantity](../reference/update-fixed-fee-quantity) endpoint. + * similar to the [Update price quantity](/api-reference/subscription/update-price-quantity) + * endpoint. * * The replacement price will have the same phase, if applicable, and the same start and end dates * as the price it replaces. @@ -126,7 +128,7 @@ import kotlin.jvm.optionals.getOrNull * * To add adjustments, provide a list of objects with the key `add_adjustments`. An object in the * list must include an object with the key `adjustment`, identical to the adjustment object in the - * [add/edit price intervals endpoint](../reference/add-edit-price-intervals). + * [add/edit price intervals endpoint](/api-reference/price-interval/add-or-edit-price-intervals). * * If the plan has phases, each object in the list must include a number with `plan_phase_order` key * to indicate which phase the adjustment should be added to. @@ -145,16 +147,16 @@ import kotlin.jvm.optionals.getOrNull * in the list must specify a plan adjustment to replace with the `replaces_adjustment_id` key, and * it must specify an adjustment to replace it with by including an object with the key * `adjustment`, identical to the adjustment object in the - * [add/edit price intervals endpoint](../reference/add-edit-price-intervals). + * [add/edit price intervals endpoint](/api-reference/price-interval/add-or-edit-price-intervals). * * The replacement adjustment will have the same phase, if applicable, and the same start and end * dates as the adjustment it replaces. * * ## Price overrides (DEPRECATED) * - * :::info Price overrides are being phased out in favor adding/removing/replacing prices. (See - * [Customize your customer's subscriptions](../reference/create-subscription#customize-your-customers-subscriptions)) - * ::: + * Price overrides are being phased out in favor adding/removing/replacing prices. (See + * [Customize your customer's subscriptions](/api-reference/subscription/create-subscription)) + * * * Price overrides are used to update some or all prices in a plan for the specific subscription * being created. This is useful when a new customer has negotiated a rate that is unique to the @@ -162,9 +164,9 @@ import kotlin.jvm.optionals.getOrNull * * To override prices, provide a list of objects with the key `price_overrides`. The price object in * the list of overrides is expected to contain the existing price id, the `model_type` and - * configuration. (See the [Price resource](../reference/price) for the specification of different - * price model configurations.) The numerical values can be updated, but the billable metric, - * cadence, type, and name of a price can not be overridden. + * configuration. (See the [Price resource](/product-catalog/price-configuration) for the + * specification of different price model configurations.) The numerical values can be updated, but + * the billable metric, cadence, type, and name of a price can not be overridden. * * ### Maximums and Minimums * @@ -292,7 +294,7 @@ constructor( */ fun autoCollection(): Optional = body.autoCollection() - fun awsRegion(): Optional = body.awsRegion() + @Deprecated("deprecated") fun awsRegion(): Optional = body.awsRegion() fun billingCycleAnchorConfiguration(): Optional = body.billingCycleAnchorConfiguration() @@ -304,7 +306,7 @@ constructor( */ fun couponRedemptionCode(): Optional = body.couponRedemptionCode() - fun creditsOverageRate(): Optional = body.creditsOverageRate() + @Deprecated("deprecated") fun creditsOverageRate(): Optional = body.creditsOverageRate() fun customerId(): Optional = body.customerId() @@ -318,8 +320,10 @@ constructor( fun externalCustomerId(): Optional = body.externalCustomerId() + @Deprecated("deprecated") fun externalMarketplace(): Optional = body.externalMarketplace() + @Deprecated("deprecated") fun externalMarketplaceReportingId(): Optional = body.externalMarketplaceReportingId() /** @@ -330,8 +334,8 @@ constructor( /** * An additional filter to apply to usage queries. This filter must be expressed as a boolean - * [computed property](../guides/extensibility/advanced-metrics#computed-properties). If null, - * usage queries will not include any additional filter. + * [computed property](/extensibility/advanced-metrics#computed-properties). If null, usage + * queries will not include any additional filter. */ fun filter(): Optional = body.filter() @@ -359,6 +363,7 @@ constructor( */ fun netTerms(): Optional = body.netTerms() + @Deprecated("deprecated") fun perCreditOverageAmount(): Optional = body.perCreditOverageAmount() /** @@ -374,6 +379,7 @@ constructor( fun planVersionNumber(): Optional = body.planVersionNumber() /** Optionally provide a list of overrides for prices on the plan */ + @Deprecated("deprecated") fun priceOverrides(): Optional> = body.priceOverrides() /** @@ -430,7 +436,7 @@ constructor( */ fun _autoCollection(): JsonField = body._autoCollection() - fun _awsRegion(): JsonField = body._awsRegion() + @Deprecated("deprecated") fun _awsRegion(): JsonField = body._awsRegion() fun _billingCycleAnchorConfiguration(): JsonField = body._billingCycleAnchorConfiguration() @@ -442,6 +448,7 @@ constructor( */ fun _couponRedemptionCode(): JsonField = body._couponRedemptionCode() + @Deprecated("deprecated") fun _creditsOverageRate(): JsonField = body._creditsOverageRate() fun _customerId(): JsonField = body._customerId() @@ -456,8 +463,10 @@ constructor( fun _externalCustomerId(): JsonField = body._externalCustomerId() + @Deprecated("deprecated") fun _externalMarketplace(): JsonField = body._externalMarketplace() + @Deprecated("deprecated") fun _externalMarketplaceReportingId(): JsonField = body._externalMarketplaceReportingId() @@ -469,8 +478,8 @@ constructor( /** * An additional filter to apply to usage queries. This filter must be expressed as a boolean - * [computed property](../guides/extensibility/advanced-metrics#computed-properties). If null, - * usage queries will not include any additional filter. + * [computed property](/extensibility/advanced-metrics#computed-properties). If null, usage + * queries will not include any additional filter. */ fun _filter(): JsonField = body._filter() @@ -498,6 +507,7 @@ constructor( */ fun _netTerms(): JsonField = body._netTerms() + @Deprecated("deprecated") fun _perCreditOverageAmount(): JsonField = body._perCreditOverageAmount() /** @@ -513,6 +523,7 @@ constructor( fun _planVersionNumber(): JsonField = body._planVersionNumber() /** Optionally provide a list of overrides for prices on the plan */ + @Deprecated("deprecated") fun _priceOverrides(): JsonField> = body._priceOverrides() /** @@ -687,6 +698,7 @@ constructor( fun autoCollection(): Optional = Optional.ofNullable(autoCollection.getNullable("auto_collection")) + @Deprecated("deprecated") fun awsRegion(): Optional = Optional.ofNullable(awsRegion.getNullable("aws_region")) fun billingCycleAnchorConfiguration(): Optional = @@ -702,6 +714,7 @@ constructor( fun couponRedemptionCode(): Optional = Optional.ofNullable(couponRedemptionCode.getNullable("coupon_redemption_code")) + @Deprecated("deprecated") fun creditsOverageRate(): Optional = Optional.ofNullable(creditsOverageRate.getNullable("credits_overage_rate")) @@ -721,9 +734,11 @@ constructor( fun externalCustomerId(): Optional = Optional.ofNullable(externalCustomerId.getNullable("external_customer_id")) + @Deprecated("deprecated") fun externalMarketplace(): Optional = Optional.ofNullable(externalMarketplace.getNullable("external_marketplace")) + @Deprecated("deprecated") fun externalMarketplaceReportingId(): Optional = Optional.ofNullable( externalMarketplaceReportingId.getNullable("external_marketplace_reporting_id") @@ -738,8 +753,7 @@ constructor( /** * An additional filter to apply to usage queries. This filter must be expressed as a - * boolean - * [computed property](../guides/extensibility/advanced-metrics#computed-properties). If + * boolean [computed property](/extensibility/advanced-metrics#computed-properties). If * null, usage queries will not include any additional filter. */ fun filter(): Optional = Optional.ofNullable(filter.getNullable("filter")) @@ -770,6 +784,7 @@ constructor( */ fun netTerms(): Optional = Optional.ofNullable(netTerms.getNullable("net_terms")) + @Deprecated("deprecated") fun perCreditOverageAmount(): Optional = Optional.ofNullable(perCreditOverageAmount.getNullable("per_credit_overage_amount")) @@ -787,6 +802,7 @@ constructor( Optional.ofNullable(planVersionNumber.getNullable("plan_version_number")) /** Optionally provide a list of overrides for prices on the plan */ + @Deprecated("deprecated") fun priceOverrides(): Optional> = Optional.ofNullable(priceOverrides.getNullable("price_overrides")) @@ -858,7 +874,10 @@ constructor( @ExcludeMissing fun _autoCollection(): JsonField = autoCollection - @JsonProperty("aws_region") @ExcludeMissing fun _awsRegion(): JsonField = awsRegion + @Deprecated("deprecated") + @JsonProperty("aws_region") + @ExcludeMissing + fun _awsRegion(): JsonField = awsRegion @JsonProperty("billing_cycle_anchor_configuration") @ExcludeMissing @@ -874,6 +893,7 @@ constructor( @ExcludeMissing fun _couponRedemptionCode(): JsonField = couponRedemptionCode + @Deprecated("deprecated") @JsonProperty("credits_overage_rate") @ExcludeMissing fun _creditsOverageRate(): JsonField = creditsOverageRate @@ -898,10 +918,12 @@ constructor( @ExcludeMissing fun _externalCustomerId(): JsonField = externalCustomerId + @Deprecated("deprecated") @JsonProperty("external_marketplace") @ExcludeMissing fun _externalMarketplace(): JsonField = externalMarketplace + @Deprecated("deprecated") @JsonProperty("external_marketplace_reporting_id") @ExcludeMissing fun _externalMarketplaceReportingId(): JsonField = externalMarketplaceReportingId @@ -916,8 +938,7 @@ constructor( /** * An additional filter to apply to usage queries. This filter must be expressed as a - * boolean - * [computed property](../guides/extensibility/advanced-metrics#computed-properties). If + * boolean [computed property](/extensibility/advanced-metrics#computed-properties). If * null, usage queries will not include any additional filter. */ @JsonProperty("filter") @ExcludeMissing fun _filter(): JsonField = filter @@ -950,6 +971,7 @@ constructor( */ @JsonProperty("net_terms") @ExcludeMissing fun _netTerms(): JsonField = netTerms + @Deprecated("deprecated") @JsonProperty("per_credit_overage_amount") @ExcludeMissing fun _perCreditOverageAmount(): JsonField = perCreditOverageAmount @@ -969,6 +991,7 @@ constructor( fun _planVersionNumber(): JsonField = planVersionNumber /** Optionally provide a list of overrides for prices on the plan */ + @Deprecated("deprecated") @JsonProperty("price_overrides") @ExcludeMissing fun _priceOverrides(): JsonField> = priceOverrides @@ -1266,10 +1289,13 @@ constructor( this.autoCollection = autoCollection } + @Deprecated("deprecated") fun awsRegion(awsRegion: String?) = awsRegion(JsonField.ofNullable(awsRegion)) + @Deprecated("deprecated") fun awsRegion(awsRegion: Optional) = awsRegion(awsRegion.orElse(null)) + @Deprecated("deprecated") fun awsRegion(awsRegion: JsonField) = apply { this.awsRegion = awsRegion } fun billingCycleAnchorConfiguration( @@ -1312,16 +1338,20 @@ constructor( this.couponRedemptionCode = couponRedemptionCode } + @Deprecated("deprecated") fun creditsOverageRate(creditsOverageRate: Double?) = creditsOverageRate(JsonField.ofNullable(creditsOverageRate)) + @Deprecated("deprecated") fun creditsOverageRate(creditsOverageRate: Double) = creditsOverageRate(creditsOverageRate as Double?) + @Deprecated("deprecated") @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun creditsOverageRate(creditsOverageRate: Optional) = creditsOverageRate(creditsOverageRate.orElse(null) as Double?) + @Deprecated("deprecated") fun creditsOverageRate(creditsOverageRate: JsonField) = apply { this.creditsOverageRate = creditsOverageRate } @@ -1370,22 +1400,28 @@ constructor( this.externalCustomerId = externalCustomerId } + @Deprecated("deprecated") fun externalMarketplace(externalMarketplace: ExternalMarketplace?) = externalMarketplace(JsonField.ofNullable(externalMarketplace)) + @Deprecated("deprecated") fun externalMarketplace(externalMarketplace: Optional) = externalMarketplace(externalMarketplace.orElse(null)) + @Deprecated("deprecated") fun externalMarketplace(externalMarketplace: JsonField) = apply { this.externalMarketplace = externalMarketplace } + @Deprecated("deprecated") fun externalMarketplaceReportingId(externalMarketplaceReportingId: String?) = externalMarketplaceReportingId(JsonField.ofNullable(externalMarketplaceReportingId)) + @Deprecated("deprecated") fun externalMarketplaceReportingId(externalMarketplaceReportingId: Optional) = externalMarketplaceReportingId(externalMarketplaceReportingId.orElse(null)) + @Deprecated("deprecated") fun externalMarketplaceReportingId(externalMarketplaceReportingId: JsonField) = apply { this.externalMarketplaceReportingId = externalMarketplaceReportingId @@ -1415,24 +1451,21 @@ constructor( /** * An additional filter to apply to usage queries. This filter must be expressed as a - * boolean - * [computed property](../guides/extensibility/advanced-metrics#computed-properties). If + * boolean [computed property](/extensibility/advanced-metrics#computed-properties). If * null, usage queries will not include any additional filter. */ fun filter(filter: String?) = filter(JsonField.ofNullable(filter)) /** * An additional filter to apply to usage queries. This filter must be expressed as a - * boolean - * [computed property](../guides/extensibility/advanced-metrics#computed-properties). If + * boolean [computed property](/extensibility/advanced-metrics#computed-properties). If * null, usage queries will not include any additional filter. */ fun filter(filter: Optional) = filter(filter.orElse(null)) /** * An additional filter to apply to usage queries. This filter must be expressed as a - * boolean - * [computed property](../guides/extensibility/advanced-metrics#computed-properties). If + * boolean [computed property](/extensibility/advanced-metrics#computed-properties). If * null, usage queries will not include any additional filter. */ fun filter(filter: JsonField) = apply { this.filter = filter } @@ -1530,16 +1563,20 @@ constructor( */ fun netTerms(netTerms: JsonField) = apply { this.netTerms = netTerms } + @Deprecated("deprecated") fun perCreditOverageAmount(perCreditOverageAmount: Double?) = perCreditOverageAmount(JsonField.ofNullable(perCreditOverageAmount)) + @Deprecated("deprecated") fun perCreditOverageAmount(perCreditOverageAmount: Double) = perCreditOverageAmount(perCreditOverageAmount as Double?) + @Deprecated("deprecated") @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun perCreditOverageAmount(perCreditOverageAmount: Optional) = perCreditOverageAmount(perCreditOverageAmount.orElse(null) as Double?) + @Deprecated("deprecated") fun perCreditOverageAmount(perCreditOverageAmount: JsonField) = apply { this.perCreditOverageAmount = perCreditOverageAmount } @@ -1593,19 +1630,23 @@ constructor( } /** Optionally provide a list of overrides for prices on the plan */ + @Deprecated("deprecated") fun priceOverrides(priceOverrides: List?) = priceOverrides(JsonField.ofNullable(priceOverrides)) /** Optionally provide a list of overrides for prices on the plan */ + @Deprecated("deprecated") fun priceOverrides(priceOverrides: Optional>) = priceOverrides(priceOverrides.orElse(null)) /** Optionally provide a list of overrides for prices on the plan */ + @Deprecated("deprecated") fun priceOverrides(priceOverrides: JsonField>) = apply { this.priceOverrides = priceOverrides.map { it.toMutableList() } } /** Optionally provide a list of overrides for prices on the plan */ + @Deprecated("deprecated") fun addPriceOverride(priceOverride: JsonValue) = apply { priceOverrides = (priceOverrides ?: JsonField.of(mutableListOf())).apply { @@ -2005,10 +2046,13 @@ constructor( body.autoCollection(autoCollection) } + @Deprecated("deprecated") fun awsRegion(awsRegion: String?) = apply { body.awsRegion(awsRegion) } + @Deprecated("deprecated") fun awsRegion(awsRegion: Optional) = awsRegion(awsRegion.orElse(null)) + @Deprecated("deprecated") fun awsRegion(awsRegion: JsonField) = apply { body.awsRegion(awsRegion) } fun billingCycleAnchorConfiguration( @@ -2049,17 +2093,21 @@ constructor( body.couponRedemptionCode(couponRedemptionCode) } + @Deprecated("deprecated") fun creditsOverageRate(creditsOverageRate: Double?) = apply { body.creditsOverageRate(creditsOverageRate) } + @Deprecated("deprecated") fun creditsOverageRate(creditsOverageRate: Double) = creditsOverageRate(creditsOverageRate as Double?) + @Deprecated("deprecated") @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun creditsOverageRate(creditsOverageRate: Optional) = creditsOverageRate(creditsOverageRate.orElse(null) as Double?) + @Deprecated("deprecated") fun creditsOverageRate(creditsOverageRate: JsonField) = apply { body.creditsOverageRate(creditsOverageRate) } @@ -2110,24 +2158,30 @@ constructor( body.externalCustomerId(externalCustomerId) } + @Deprecated("deprecated") fun externalMarketplace(externalMarketplace: ExternalMarketplace?) = apply { body.externalMarketplace(externalMarketplace) } + @Deprecated("deprecated") fun externalMarketplace(externalMarketplace: Optional) = externalMarketplace(externalMarketplace.orElse(null)) + @Deprecated("deprecated") fun externalMarketplace(externalMarketplace: JsonField) = apply { body.externalMarketplace(externalMarketplace) } + @Deprecated("deprecated") fun externalMarketplaceReportingId(externalMarketplaceReportingId: String?) = apply { body.externalMarketplaceReportingId(externalMarketplaceReportingId) } + @Deprecated("deprecated") fun externalMarketplaceReportingId(externalMarketplaceReportingId: Optional) = externalMarketplaceReportingId(externalMarketplaceReportingId.orElse(null)) + @Deprecated("deprecated") fun externalMarketplaceReportingId(externalMarketplaceReportingId: JsonField) = apply { body.externalMarketplaceReportingId(externalMarketplaceReportingId) @@ -2156,24 +2210,21 @@ constructor( /** * An additional filter to apply to usage queries. This filter must be expressed as a - * boolean - * [computed property](../guides/extensibility/advanced-metrics#computed-properties). If + * boolean [computed property](/extensibility/advanced-metrics#computed-properties). If * null, usage queries will not include any additional filter. */ fun filter(filter: String?) = apply { body.filter(filter) } /** * An additional filter to apply to usage queries. This filter must be expressed as a - * boolean - * [computed property](../guides/extensibility/advanced-metrics#computed-properties). If + * boolean [computed property](/extensibility/advanced-metrics#computed-properties). If * null, usage queries will not include any additional filter. */ fun filter(filter: Optional) = filter(filter.orElse(null)) /** * An additional filter to apply to usage queries. This filter must be expressed as a - * boolean - * [computed property](../guides/extensibility/advanced-metrics#computed-properties). If + * boolean [computed property](/extensibility/advanced-metrics#computed-properties). If * null, usage queries will not include any additional filter. */ fun filter(filter: JsonField) = apply { body.filter(filter) } @@ -2273,17 +2324,21 @@ constructor( */ fun netTerms(netTerms: JsonField) = apply { body.netTerms(netTerms) } + @Deprecated("deprecated") fun perCreditOverageAmount(perCreditOverageAmount: Double?) = apply { body.perCreditOverageAmount(perCreditOverageAmount) } + @Deprecated("deprecated") fun perCreditOverageAmount(perCreditOverageAmount: Double) = perCreditOverageAmount(perCreditOverageAmount as Double?) + @Deprecated("deprecated") @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun perCreditOverageAmount(perCreditOverageAmount: Optional) = perCreditOverageAmount(perCreditOverageAmount.orElse(null) as Double?) + @Deprecated("deprecated") fun perCreditOverageAmount(perCreditOverageAmount: JsonField) = apply { body.perCreditOverageAmount(perCreditOverageAmount) } @@ -2338,20 +2393,24 @@ constructor( } /** Optionally provide a list of overrides for prices on the plan */ + @Deprecated("deprecated") fun priceOverrides(priceOverrides: List?) = apply { body.priceOverrides(priceOverrides) } /** Optionally provide a list of overrides for prices on the plan */ + @Deprecated("deprecated") fun priceOverrides(priceOverrides: Optional>) = priceOverrides(priceOverrides.orElse(null)) /** Optionally provide a list of overrides for prices on the plan */ + @Deprecated("deprecated") fun priceOverrides(priceOverrides: JsonField>) = apply { body.priceOverrides(priceOverrides) } /** Optionally provide a list of overrides for prices on the plan */ + @Deprecated("deprecated") fun addPriceOverride(priceOverride: JsonValue) = apply { body.addPriceOverride(priceOverride) } @@ -4452,6 +4511,7 @@ constructor( /** * [DEPRECATED] Use add_adjustments instead. The subscription's discounts for this price. */ + @Deprecated("deprecated") fun discounts(): Optional> = Optional.ofNullable(discounts.getNullable("discounts")) @@ -4470,6 +4530,7 @@ constructor( * [DEPRECATED] Use add_adjustments instead. The subscription's maximum amount for this * price. */ + @Deprecated("deprecated") fun maximumAmount(): Optional = Optional.ofNullable(maximumAmount.getNullable("maximum_amount")) @@ -4477,6 +4538,7 @@ constructor( * [DEPRECATED] Use add_adjustments instead. The subscription's minimum amount for this * price. */ + @Deprecated("deprecated") fun minimumAmount(): Optional = Optional.ofNullable(minimumAmount.getNullable("minimum_amount")) @@ -4500,6 +4562,7 @@ constructor( /** * [DEPRECATED] Use add_adjustments instead. The subscription's discounts for this price. */ + @Deprecated("deprecated") @JsonProperty("discounts") @ExcludeMissing fun _discounts(): JsonField> = discounts @@ -4521,6 +4584,7 @@ constructor( * [DEPRECATED] Use add_adjustments instead. The subscription's maximum amount for this * price. */ + @Deprecated("deprecated") @JsonProperty("maximum_amount") @ExcludeMissing fun _maximumAmount(): JsonField = maximumAmount @@ -4529,6 +4593,7 @@ constructor( * [DEPRECATED] Use add_adjustments instead. The subscription's minimum amount for this * price. */ + @Deprecated("deprecated") @JsonProperty("minimum_amount") @ExcludeMissing fun _minimumAmount(): JsonField = minimumAmount @@ -4613,18 +4678,21 @@ constructor( * [DEPRECATED] Use add_adjustments instead. The subscription's discounts for this * price. */ + @Deprecated("deprecated") fun discounts(discounts: List?) = discounts(JsonField.ofNullable(discounts)) /** * [DEPRECATED] Use add_adjustments instead. The subscription's discounts for this * price. */ + @Deprecated("deprecated") fun discounts(discounts: Optional>) = discounts(discounts.orElse(null)) /** * [DEPRECATED] Use add_adjustments instead. The subscription's discounts for this * price. */ + @Deprecated("deprecated") fun discounts(discounts: JsonField>) = apply { this.discounts = discounts.map { it.toMutableList() } } @@ -4633,6 +4701,7 @@ constructor( * [DEPRECATED] Use add_adjustments instead. The subscription's discounts for this * price. */ + @Deprecated("deprecated") fun addDiscount(discount: Discount) = apply { discounts = (discounts ?: JsonField.of(mutableListOf())).apply { @@ -4681,6 +4750,7 @@ constructor( * [DEPRECATED] Use add_adjustments instead. The subscription's maximum amount for this * price. */ + @Deprecated("deprecated") fun maximumAmount(maximumAmount: String?) = maximumAmount(JsonField.ofNullable(maximumAmount)) @@ -4688,6 +4758,7 @@ constructor( * [DEPRECATED] Use add_adjustments instead. The subscription's maximum amount for this * price. */ + @Deprecated("deprecated") fun maximumAmount(maximumAmount: Optional) = maximumAmount(maximumAmount.orElse(null)) @@ -4695,6 +4766,7 @@ constructor( * [DEPRECATED] Use add_adjustments instead. The subscription's maximum amount for this * price. */ + @Deprecated("deprecated") fun maximumAmount(maximumAmount: JsonField) = apply { this.maximumAmount = maximumAmount } @@ -4703,6 +4775,7 @@ constructor( * [DEPRECATED] Use add_adjustments instead. The subscription's minimum amount for this * price. */ + @Deprecated("deprecated") fun minimumAmount(minimumAmount: String?) = minimumAmount(JsonField.ofNullable(minimumAmount)) @@ -4710,6 +4783,7 @@ constructor( * [DEPRECATED] Use add_adjustments instead. The subscription's minimum amount for this * price. */ + @Deprecated("deprecated") fun minimumAmount(minimumAmount: Optional) = minimumAmount(minimumAmount.orElse(null)) @@ -4717,6 +4791,7 @@ constructor( * [DEPRECATED] Use add_adjustments instead. The subscription's minimum amount for this * price. */ + @Deprecated("deprecated") fun minimumAmount(minimumAmount: JsonField) = apply { this.minimumAmount = minimumAmount } @@ -6836,6 +6911,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -7196,6 +7272,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -7392,6 +7469,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -8224,6 +8302,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -8620,6 +8699,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -8816,6 +8896,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -9648,6 +9729,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -10274,6 +10356,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -10470,6 +10553,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -11302,6 +11386,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -11866,6 +11951,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -12062,6 +12148,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -12896,6 +12983,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -13473,6 +13561,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -13669,6 +13758,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -14632,6 +14722,7 @@ constructor( "BpsConfig{bps=$bps, perUnitMaximum=$perUnitMaximum, additionalProperties=$additionalProperties}" } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -14884,6 +14975,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -15080,6 +15172,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -16212,6 +16305,7 @@ constructor( "BulkBpsConfig{tiers=$tiers, additionalProperties=$additionalProperties}" } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -16464,6 +16558,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -16660,6 +16755,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -17758,6 +17854,7 @@ constructor( "BulkConfig{tiers=$tiers, additionalProperties=$additionalProperties}" } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -18010,6 +18107,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -18206,6 +18304,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -19049,6 +19148,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -19386,6 +19486,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -19582,6 +19683,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -20417,6 +20519,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -20753,6 +20856,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -20949,6 +21053,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -21789,6 +21894,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -22126,6 +22232,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -22322,6 +22429,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -23159,6 +23267,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -23495,6 +23604,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -23691,6 +23801,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -24539,6 +24650,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -24877,6 +24989,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -25073,6 +25186,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -25915,6 +26029,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -26252,6 +26367,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -26448,6 +26564,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -27288,6 +27405,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -27625,6 +27743,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -27821,6 +27940,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -28661,6 +28781,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -28998,6 +29119,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -29194,6 +29316,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -30056,6 +30179,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -30395,6 +30519,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -30591,6 +30716,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -31516,6 +31642,7 @@ constructor( "BulkWithProrationConfig{additionalProperties=$additionalProperties}" } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -31768,6 +31895,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -31964,6 +32092,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -32370,6 +32499,7 @@ constructor( "BillingCycleAnchorConfiguration{day=$day, month=$month, year=$year, additionalProperties=$additionalProperties}" } + @Deprecated("deprecated") class ExternalMarketplace @JsonCreator private constructor( @@ -34464,6 +34594,7 @@ constructor( * [DEPRECATED] Use add_adjustments instead. The subscription's discounts for the * replacement price. */ + @Deprecated("deprecated") fun discounts(): Optional> = Optional.ofNullable(discounts.getNullable("discounts")) @@ -34479,6 +34610,7 @@ constructor( * [DEPRECATED] Use add_adjustments instead. The subscription's maximum amount for the * replacement price. */ + @Deprecated("deprecated") fun maximumAmount(): Optional = Optional.ofNullable(maximumAmount.getNullable("maximum_amount")) @@ -34486,6 +34618,7 @@ constructor( * [DEPRECATED] Use add_adjustments instead. The subscription's minimum amount for the * replacement price. */ + @Deprecated("deprecated") fun minimumAmount(): Optional = Optional.ofNullable(minimumAmount.getNullable("minimum_amount")) @@ -34504,6 +34637,7 @@ constructor( * [DEPRECATED] Use add_adjustments instead. The subscription's discounts for the * replacement price. */ + @Deprecated("deprecated") @JsonProperty("discounts") @ExcludeMissing fun _discounts(): JsonField> = discounts @@ -34522,6 +34656,7 @@ constructor( * [DEPRECATED] Use add_adjustments instead. The subscription's maximum amount for the * replacement price. */ + @Deprecated("deprecated") @JsonProperty("maximum_amount") @ExcludeMissing fun _maximumAmount(): JsonField = maximumAmount @@ -34530,6 +34665,7 @@ constructor( * [DEPRECATED] Use add_adjustments instead. The subscription's minimum amount for the * replacement price. */ + @Deprecated("deprecated") @JsonProperty("minimum_amount") @ExcludeMissing fun _minimumAmount(): JsonField = minimumAmount @@ -34607,18 +34743,21 @@ constructor( * [DEPRECATED] Use add_adjustments instead. The subscription's discounts for the * replacement price. */ + @Deprecated("deprecated") fun discounts(discounts: List?) = discounts(JsonField.ofNullable(discounts)) /** * [DEPRECATED] Use add_adjustments instead. The subscription's discounts for the * replacement price. */ + @Deprecated("deprecated") fun discounts(discounts: Optional>) = discounts(discounts.orElse(null)) /** * [DEPRECATED] Use add_adjustments instead. The subscription's discounts for the * replacement price. */ + @Deprecated("deprecated") fun discounts(discounts: JsonField>) = apply { this.discounts = discounts.map { it.toMutableList() } } @@ -34627,6 +34766,7 @@ constructor( * [DEPRECATED] Use add_adjustments instead. The subscription's discounts for the * replacement price. */ + @Deprecated("deprecated") fun addDiscount(discount: Discount) = apply { discounts = (discounts ?: JsonField.of(mutableListOf())).apply { @@ -34675,6 +34815,7 @@ constructor( * [DEPRECATED] Use add_adjustments instead. The subscription's maximum amount for the * replacement price. */ + @Deprecated("deprecated") fun maximumAmount(maximumAmount: String?) = maximumAmount(JsonField.ofNullable(maximumAmount)) @@ -34682,6 +34823,7 @@ constructor( * [DEPRECATED] Use add_adjustments instead. The subscription's maximum amount for the * replacement price. */ + @Deprecated("deprecated") fun maximumAmount(maximumAmount: Optional) = maximumAmount(maximumAmount.orElse(null)) @@ -34689,6 +34831,7 @@ constructor( * [DEPRECATED] Use add_adjustments instead. The subscription's maximum amount for the * replacement price. */ + @Deprecated("deprecated") fun maximumAmount(maximumAmount: JsonField) = apply { this.maximumAmount = maximumAmount } @@ -34697,6 +34840,7 @@ constructor( * [DEPRECATED] Use add_adjustments instead. The subscription's minimum amount for the * replacement price. */ + @Deprecated("deprecated") fun minimumAmount(minimumAmount: String?) = minimumAmount(JsonField.ofNullable(minimumAmount)) @@ -34704,6 +34848,7 @@ constructor( * [DEPRECATED] Use add_adjustments instead. The subscription's minimum amount for the * replacement price. */ + @Deprecated("deprecated") fun minimumAmount(minimumAmount: Optional) = minimumAmount(minimumAmount.orElse(null)) @@ -34711,6 +34856,7 @@ constructor( * [DEPRECATED] Use add_adjustments instead. The subscription's minimum amount for the * replacement price. */ + @Deprecated("deprecated") fun minimumAmount(minimumAmount: JsonField) = apply { this.minimumAmount = minimumAmount } @@ -36789,6 +36935,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -37149,6 +37296,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -37345,6 +37493,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -38177,6 +38326,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -38573,6 +38723,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -38769,6 +38920,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -39601,6 +39753,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -40227,6 +40380,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -40423,6 +40577,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -41255,6 +41410,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -41819,6 +41975,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -42015,6 +42172,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -42849,6 +43007,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -43426,6 +43585,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -43622,6 +43782,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -44585,6 +44746,7 @@ constructor( "BpsConfig{bps=$bps, perUnitMaximum=$perUnitMaximum, additionalProperties=$additionalProperties}" } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -44837,6 +44999,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -45033,6 +45196,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -46165,6 +46329,7 @@ constructor( "BulkBpsConfig{tiers=$tiers, additionalProperties=$additionalProperties}" } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -46417,6 +46582,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -46613,6 +46779,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -47711,6 +47878,7 @@ constructor( "BulkConfig{tiers=$tiers, additionalProperties=$additionalProperties}" } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -47963,6 +48131,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -48159,6 +48328,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -49002,6 +49172,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -49339,6 +49510,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -49535,6 +49707,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -50370,6 +50543,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -50706,6 +50880,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -50902,6 +51077,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -51742,6 +51918,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -52079,6 +52256,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -52275,6 +52453,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -53112,6 +53291,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -53448,6 +53628,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -53644,6 +53825,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -54492,6 +54674,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -54830,6 +55013,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -55026,6 +55210,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -55868,6 +56053,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -56205,6 +56391,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -56401,6 +56588,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -57241,6 +57429,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -57578,6 +57767,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -57774,6 +57964,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -58614,6 +58805,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -58951,6 +59143,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -59147,6 +59340,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -60009,6 +60203,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -60348,6 +60543,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -60544,6 +60740,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -61469,6 +61666,7 @@ constructor( "BulkWithProrationConfig{additionalProperties=$additionalProperties}" } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -61721,6 +61919,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -61917,6 +62116,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionCreateResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionCreateResponse.kt index b4ce5109..910bf64a 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionCreateResponse.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionCreateResponse.kt @@ -167,8 +167,8 @@ private constructor( * 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. + * identifier. See [Customer ID Aliases](/events-and-metrics/customer-aliases) for further + * information about how these aliases work in Orb. * * In addition to having an identifier in your system, a customer may exist in a payment * provider solution like Stripe. Use the `payment_provider_id` and the `payment_provider` enum @@ -176,8 +176,8 @@ private constructor( * * 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. */ fun customer(): Customer = customer.getRequired("customer") @@ -224,9 +224,9 @@ private constructor( fun netTerms(): Long = netTerms.getRequired("net_terms") /** - * 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). */ fun plan(): Plan = plan.getRequired("plan") @@ -306,8 +306,8 @@ private constructor( * 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. + * identifier. See [Customer ID Aliases](/events-and-metrics/customer-aliases) for further + * information about how these aliases work in Orb. * * In addition to having an identifier in your system, a customer may exist in a payment * provider solution like Stripe. Use the `payment_provider_id` and the `payment_provider` enum @@ -315,8 +315,8 @@ private constructor( * * 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. */ @JsonProperty("customer") @ExcludeMissing fun _customer(): JsonField = customer @@ -370,9 +370,9 @@ private constructor( @JsonProperty("net_terms") @ExcludeMissing fun _netTerms(): JsonField = netTerms /** - * 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). */ @JsonProperty("plan") @ExcludeMissing fun _plan(): JsonField = plan @@ -672,8 +672,8 @@ private constructor( * 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. + * identifier. See [Customer ID Aliases](/events-and-metrics/customer-aliases) for further + * information about how these aliases work in Orb. * * In addition to having an identifier in your system, a customer may exist in a payment * provider solution like Stripe. Use the `payment_provider_id` and the `payment_provider` @@ -681,8 +681,8 @@ private constructor( * * 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. + * account's timezone. See [Timezone localization](/essentials/timezones) for information on + * what this timezone parameter influences within Orb. */ fun customer(customer: Customer) = customer(JsonField.of(customer)) @@ -692,8 +692,8 @@ private constructor( * 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. + * identifier. See [Customer ID Aliases](/events-and-metrics/customer-aliases) for further + * information about how these aliases work in Orb. * * In addition to having an identifier in your system, a customer may exist in a payment * provider solution like Stripe. Use the `payment_provider_id` and the `payment_provider` @@ -701,8 +701,8 @@ private constructor( * * 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. + * account's timezone. See [Timezone localization](/essentials/timezones) for information on + * what this timezone parameter influences within Orb. */ fun customer(customer: JsonField) = apply { this.customer = customer } @@ -884,18 +884,16 @@ private constructor( fun netTerms(netTerms: JsonField) = apply { this.netTerms = netTerms } /** - * 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). */ fun plan(plan: Plan) = plan(JsonField.of(plan)) /** - * 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). */ fun plan(plan: JsonField) = apply { this.plan = plan } @@ -5379,224 +5377,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") @@ -5658,224 +5440,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 @@ -6081,224 +5647,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.of(price)) @@ -6311,224 +5661,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 } @@ -6541,224 +5675,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)) @@ -6771,224 +5689,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)) @@ -7001,224 +5703,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)) @@ -7231,224 +5717,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)) @@ -7461,224 +5731,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(tieredBpsPrice: Price.TieredBpsPrice) = price(Price.ofTieredBpsPrice(tieredBpsPrice)) @@ -7692,684 +5746,36 @@ 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" - * } - * ... - * } - * ``` + * 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. + * 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. * - * ```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" - * } - * ] - * } - * ... - * ``` + * 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. * - * ## 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)) @@ -8382,224 +5788,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)) @@ -8613,224 +5803,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)) @@ -8844,224 +5818,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)) @@ -9075,224 +5833,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)) @@ -9306,224 +5848,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)) @@ -9537,224 +5863,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)) @@ -9768,455 +5878,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)) @@ -10230,224 +5908,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)) @@ -10461,224 +5923,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)) @@ -10692,224 +5938,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)) @@ -10923,224 +5953,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)) @@ -11154,224 +5968,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)) @@ -11385,224 +5983,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)) @@ -11616,224 +5998,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)) @@ -11847,459 +6013,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)) - /** * The start date of the price interval. This is the date that Orb starts billing for * this price. diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionFetchCostsParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionFetchCostsParams.kt index d090d00c..61c4803a 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionFetchCostsParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionFetchCostsParams.kt @@ -266,6 +266,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/SubscriptionFetchCostsResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionFetchCostsResponse.kt index dbfcd2c4..0de70482 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionFetchCostsResponse.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionFetchCostsResponse.kt @@ -314,224 +314,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") @@ -553,224 +337,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 @@ -834,228 +402,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)) @@ -1068,228 +416,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 } @@ -1302,228 +430,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)) @@ -1536,228 +444,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)) @@ -1771,228 +459,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)) @@ -2005,228 +473,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)) @@ -2239,228 +487,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)) @@ -2474,697 +502,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)) @@ -3177,228 +545,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)) @@ -3412,228 +560,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)) @@ -3647,228 +575,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)) @@ -3882,228 +590,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)) @@ -4117,228 +605,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)) @@ -4352,228 +620,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)) @@ -4587,463 +635,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)) @@ -5057,228 +665,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)) @@ -5292,228 +680,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)) @@ -5527,228 +695,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)) @@ -5762,228 +710,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)) @@ -5997,228 +725,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)) @@ -6232,228 +740,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)) @@ -6467,228 +755,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)) @@ -6702,467 +770,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/SubscriptionFetchParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionFetchParams.kt index 73424fdf..3e6a6ce6 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionFetchParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionFetchParams.kt @@ -9,7 +9,7 @@ import com.withorb.api.core.http.QueryParams import java.util.Objects /** - * This endpoint is used to fetch a [Subscription](../guides/concepts#subscription) given an + * This endpoint is used to fetch a [Subscription](/core-concepts##subscription) given an * identifier. */ class SubscriptionFetchParams diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionFetchSchedulePage.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionFetchSchedulePage.kt index 7f18e668..805a2741 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionFetchSchedulePage.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionFetchSchedulePage.kt @@ -19,6 +19,11 @@ import java.util.Optional import java.util.stream.Stream import java.util.stream.StreamSupport +/** + * This endpoint returns a [paginated](/api-reference/pagination) list of all plans associated with + * a subscription along with their start and end dates. This list contains the subscription's + * initial plan along with past and future plan changes. + */ class SubscriptionFetchSchedulePage private constructor( private val subscriptionsService: SubscriptionService, diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionFetchSchedulePageAsync.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionFetchSchedulePageAsync.kt index df5334c9..5212bec0 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionFetchSchedulePageAsync.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionFetchSchedulePageAsync.kt @@ -20,6 +20,11 @@ import java.util.concurrent.CompletableFuture import java.util.concurrent.Executor import java.util.function.Predicate +/** + * This endpoint returns a [paginated](/api-reference/pagination) list of all plans associated with + * a subscription along with their start and end dates. This list contains the subscription's + * initial plan along with past and future plan changes. + */ class SubscriptionFetchSchedulePageAsync private constructor( private val subscriptionsService: SubscriptionServiceAsync, diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionFetchScheduleParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionFetchScheduleParams.kt index b0d0ca66..df91b277 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionFetchScheduleParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionFetchScheduleParams.kt @@ -12,9 +12,9 @@ import java.util.Objects import java.util.Optional /** - * This endpoint returns a [paginated](../reference/pagination) list of all plans associated with a - * subscription along with their start and end dates. This list contains the subscription's initial - * plan along with past and future plan changes. + * This endpoint returns a [paginated](/api-reference/pagination) list of all plans associated with + * a subscription along with their start and end dates. This list contains the subscription's + * initial plan along with past and future plan changes. */ class SubscriptionFetchScheduleParams constructor( diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionFetchUsageParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionFetchUsageParams.kt index 1b8aa4e6..5aa17853 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionFetchUsageParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionFetchUsageParams.kt @@ -538,6 +538,7 @@ constructor( ) } + /** This determines the windowing of usage reporting. */ class Granularity @JsonCreator private constructor( @@ -589,6 +590,11 @@ constructor( override fun toString() = value.toString() } + /** + * Controls whether Orb returns cumulative usage since the start of the billing period, or + * incremental day-by-day usage. 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/SubscriptionListPage.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionListPage.kt index 49198e6f..ea696fe9 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionListPage.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionListPage.kt @@ -19,6 +19,16 @@ import java.util.Optional import java.util.stream.Stream import java.util.stream.StreamSupport +/** + * This endpoint returns a list of all subscriptions for an account 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). + * + * Subscriptions can be filtered for a specific customer by using either the customer_id or + * external_customer_id query parameters. To filter subscriptions for multiple customers, use the + * customer_id[] or external_customer_id[] query parameters. + */ class SubscriptionListPage private constructor( private val subscriptionsService: SubscriptionService, diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionListPageAsync.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionListPageAsync.kt index 87dafec6..7ec4b472 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionListPageAsync.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionListPageAsync.kt @@ -20,6 +20,16 @@ import java.util.concurrent.CompletableFuture import java.util.concurrent.Executor import java.util.function.Predicate +/** + * This endpoint returns a list of all subscriptions for an account 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). + * + * Subscriptions can be filtered for a specific customer by using either the customer_id or + * external_customer_id query parameters. To filter subscriptions for multiple customers, use the + * customer_id[] or external_customer_id[] query parameters. + */ class SubscriptionListPageAsync private constructor( private val subscriptionsService: SubscriptionServiceAsync, diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionListParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionListParams.kt index cdf0f4a4..22259679 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionListParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionListParams.kt @@ -17,9 +17,9 @@ import java.util.Optional /** * This endpoint returns a list of all subscriptions for an account 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). * * Subscriptions can be filtered for a specific customer by using either the customer_id or * external_customer_id query parameters. To filter subscriptions for multiple customers, use the diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionPriceIntervalsParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionPriceIntervalsParams.kt index aca775dc..dc9d5f8a 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionPriceIntervalsParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionPriceIntervalsParams.kt @@ -35,9 +35,9 @@ import kotlin.jvm.optionals.getOrNull /** * This endpoint is used to add and edit subscription - * [price intervals](../reference/price-interval). By making modifications to a subscription’s price - * intervals, you can - * [flexibly and atomically control the billing behavior of a subscription](../guides/product-catalog/modifying-subscriptions). + * [price intervals](/api-reference/price-interval/add-or-edit-price-intervals). By making + * modifications to a subscription’s price intervals, you can + * [flexibly and atomically control the billing behavior of a subscription](/product-catalog/modifying-subscriptions). * * ## Adding price intervals * @@ -1077,10 +1077,6 @@ constructor( fun price(newFloatingGroupedTieredPrice: Price.NewFloatingGroupedTieredPrice) = price(Price.ofNewFloatingGroupedTieredPrice(newFloatingGroupedTieredPrice)) - /** The definition of a new price to create and add to the subscription. */ - fun price(newFloatingMaxGroupTieredPrice: Price.NewFloatingMaxGroupTieredPrice) = - price(Price.ofNewFloatingMaxGroupTieredPrice(newFloatingMaxGroupTieredPrice)) - /** The definition of a new price to create and add to the subscription. */ fun price(newFloatingTieredWithMinimumPrice: Price.NewFloatingTieredWithMinimumPrice) = price(Price.ofNewFloatingTieredWithMinimumPrice(newFloatingTieredWithMinimumPrice)) @@ -1525,6 +1521,7 @@ constructor( ) } + /** The cadence at which to allocate the amount to the customer. */ class Cadence @JsonCreator private constructor( @@ -2683,7 +2680,6 @@ constructor( null, private val newFloatingTieredPackagePrice: NewFloatingTieredPackagePrice? = null, private val newFloatingGroupedTieredPrice: NewFloatingGroupedTieredPrice? = null, - private val newFloatingMaxGroupTieredPrice: NewFloatingMaxGroupTieredPrice? = null, private val newFloatingTieredWithMinimumPrice: NewFloatingTieredWithMinimumPrice? = null, private val newFloatingPackageWithAllocationPrice: @@ -2754,9 +2750,6 @@ constructor( fun newFloatingGroupedTieredPrice(): Optional = Optional.ofNullable(newFloatingGroupedTieredPrice) - fun newFloatingMaxGroupTieredPrice(): Optional = - Optional.ofNullable(newFloatingMaxGroupTieredPrice) - fun newFloatingTieredWithMinimumPrice(): Optional = Optional.ofNullable(newFloatingTieredWithMinimumPrice) @@ -2826,8 +2819,6 @@ constructor( fun isNewFloatingGroupedTieredPrice(): Boolean = newFloatingGroupedTieredPrice != null - fun isNewFloatingMaxGroupTieredPrice(): Boolean = newFloatingMaxGroupTieredPrice != null - fun isNewFloatingTieredWithMinimumPrice(): Boolean = newFloatingTieredWithMinimumPrice != null @@ -2904,9 +2895,6 @@ constructor( fun asNewFloatingGroupedTieredPrice(): NewFloatingGroupedTieredPrice = newFloatingGroupedTieredPrice.getOrThrow("newFloatingGroupedTieredPrice") - fun asNewFloatingMaxGroupTieredPrice(): NewFloatingMaxGroupTieredPrice = - newFloatingMaxGroupTieredPrice.getOrThrow("newFloatingMaxGroupTieredPrice") - fun asNewFloatingTieredWithMinimumPrice(): NewFloatingTieredWithMinimumPrice = newFloatingTieredWithMinimumPrice.getOrThrow("newFloatingTieredWithMinimumPrice") @@ -2992,8 +2980,6 @@ constructor( visitor.visitNewFloatingTieredPackagePrice(newFloatingTieredPackagePrice) newFloatingGroupedTieredPrice != null -> visitor.visitNewFloatingGroupedTieredPrice(newFloatingGroupedTieredPrice) - newFloatingMaxGroupTieredPrice != null -> - visitor.visitNewFloatingMaxGroupTieredPrice(newFloatingMaxGroupTieredPrice) newFloatingTieredWithMinimumPrice != null -> visitor.visitNewFloatingTieredWithMinimumPrice( newFloatingTieredWithMinimumPrice @@ -3129,12 +3115,6 @@ constructor( newFloatingGroupedTieredPrice.validate() } - override fun visitNewFloatingMaxGroupTieredPrice( - newFloatingMaxGroupTieredPrice: NewFloatingMaxGroupTieredPrice - ) { - newFloatingMaxGroupTieredPrice.validate() - } - override fun visitNewFloatingTieredWithMinimumPrice( newFloatingTieredWithMinimumPrice: NewFloatingTieredWithMinimumPrice ) { @@ -3222,10 +3202,10 @@ constructor( return true } - return /* spotless:off */ other is Price && newFloatingUnitPrice == other.newFloatingUnitPrice && newFloatingPackagePrice == other.newFloatingPackagePrice && newFloatingMatrixPrice == other.newFloatingMatrixPrice && newFloatingMatrixWithAllocationPrice == other.newFloatingMatrixWithAllocationPrice && newFloatingTieredPrice == other.newFloatingTieredPrice && newFloatingTieredBpsPrice == other.newFloatingTieredBpsPrice && newFloatingBpsPrice == other.newFloatingBpsPrice && newFloatingBulkBpsPrice == other.newFloatingBulkBpsPrice && newFloatingBulkPrice == other.newFloatingBulkPrice && newFloatingThresholdTotalAmountPrice == other.newFloatingThresholdTotalAmountPrice && newFloatingTieredPackagePrice == other.newFloatingTieredPackagePrice && newFloatingGroupedTieredPrice == other.newFloatingGroupedTieredPrice && newFloatingMaxGroupTieredPrice == other.newFloatingMaxGroupTieredPrice && newFloatingTieredWithMinimumPrice == other.newFloatingTieredWithMinimumPrice && newFloatingPackageWithAllocationPrice == other.newFloatingPackageWithAllocationPrice && newFloatingTieredPackageWithMinimumPrice == other.newFloatingTieredPackageWithMinimumPrice && newFloatingUnitWithPercentPrice == other.newFloatingUnitWithPercentPrice && newFloatingTieredWithProrationPrice == other.newFloatingTieredWithProrationPrice && newFloatingUnitWithProrationPrice == other.newFloatingUnitWithProrationPrice && newFloatingGroupedAllocationPrice == other.newFloatingGroupedAllocationPrice && newFloatingGroupedWithProratedMinimumPrice == other.newFloatingGroupedWithProratedMinimumPrice && newFloatingGroupedWithMeteredMinimumPrice == other.newFloatingGroupedWithMeteredMinimumPrice && newFloatingMatrixWithDisplayNamePrice == other.newFloatingMatrixWithDisplayNamePrice && newFloatingBulkWithProrationPrice == other.newFloatingBulkWithProrationPrice && newFloatingGroupedTieredPackagePrice == other.newFloatingGroupedTieredPackagePrice /* spotless:on */ + return /* spotless:off */ other is Price && newFloatingUnitPrice == other.newFloatingUnitPrice && newFloatingPackagePrice == other.newFloatingPackagePrice && newFloatingMatrixPrice == other.newFloatingMatrixPrice && newFloatingMatrixWithAllocationPrice == other.newFloatingMatrixWithAllocationPrice && newFloatingTieredPrice == other.newFloatingTieredPrice && newFloatingTieredBpsPrice == other.newFloatingTieredBpsPrice && newFloatingBpsPrice == other.newFloatingBpsPrice && newFloatingBulkBpsPrice == other.newFloatingBulkBpsPrice && newFloatingBulkPrice == other.newFloatingBulkPrice && newFloatingThresholdTotalAmountPrice == other.newFloatingThresholdTotalAmountPrice && newFloatingTieredPackagePrice == other.newFloatingTieredPackagePrice && newFloatingGroupedTieredPrice == other.newFloatingGroupedTieredPrice && newFloatingTieredWithMinimumPrice == other.newFloatingTieredWithMinimumPrice && newFloatingPackageWithAllocationPrice == other.newFloatingPackageWithAllocationPrice && newFloatingTieredPackageWithMinimumPrice == other.newFloatingTieredPackageWithMinimumPrice && newFloatingUnitWithPercentPrice == other.newFloatingUnitWithPercentPrice && newFloatingTieredWithProrationPrice == other.newFloatingTieredWithProrationPrice && newFloatingUnitWithProrationPrice == other.newFloatingUnitWithProrationPrice && newFloatingGroupedAllocationPrice == other.newFloatingGroupedAllocationPrice && newFloatingGroupedWithProratedMinimumPrice == other.newFloatingGroupedWithProratedMinimumPrice && newFloatingGroupedWithMeteredMinimumPrice == other.newFloatingGroupedWithMeteredMinimumPrice && newFloatingMatrixWithDisplayNamePrice == other.newFloatingMatrixWithDisplayNamePrice && newFloatingBulkWithProrationPrice == other.newFloatingBulkWithProrationPrice && newFloatingGroupedTieredPackagePrice == other.newFloatingGroupedTieredPackagePrice /* spotless:on */ } - override fun hashCode(): Int = /* spotless:off */ Objects.hash(newFloatingUnitPrice, newFloatingPackagePrice, newFloatingMatrixPrice, newFloatingMatrixWithAllocationPrice, newFloatingTieredPrice, newFloatingTieredBpsPrice, newFloatingBpsPrice, newFloatingBulkBpsPrice, newFloatingBulkPrice, newFloatingThresholdTotalAmountPrice, newFloatingTieredPackagePrice, newFloatingGroupedTieredPrice, newFloatingMaxGroupTieredPrice, newFloatingTieredWithMinimumPrice, newFloatingPackageWithAllocationPrice, newFloatingTieredPackageWithMinimumPrice, newFloatingUnitWithPercentPrice, newFloatingTieredWithProrationPrice, newFloatingUnitWithProrationPrice, newFloatingGroupedAllocationPrice, newFloatingGroupedWithProratedMinimumPrice, newFloatingGroupedWithMeteredMinimumPrice, newFloatingMatrixWithDisplayNamePrice, newFloatingBulkWithProrationPrice, newFloatingGroupedTieredPackagePrice) /* spotless:on */ + override fun hashCode(): Int = /* spotless:off */ Objects.hash(newFloatingUnitPrice, newFloatingPackagePrice, newFloatingMatrixPrice, newFloatingMatrixWithAllocationPrice, newFloatingTieredPrice, newFloatingTieredBpsPrice, newFloatingBpsPrice, newFloatingBulkBpsPrice, newFloatingBulkPrice, newFloatingThresholdTotalAmountPrice, newFloatingTieredPackagePrice, newFloatingGroupedTieredPrice, newFloatingTieredWithMinimumPrice, newFloatingPackageWithAllocationPrice, newFloatingTieredPackageWithMinimumPrice, newFloatingUnitWithPercentPrice, newFloatingTieredWithProrationPrice, newFloatingUnitWithProrationPrice, newFloatingGroupedAllocationPrice, newFloatingGroupedWithProratedMinimumPrice, newFloatingGroupedWithMeteredMinimumPrice, newFloatingMatrixWithDisplayNamePrice, newFloatingBulkWithProrationPrice, newFloatingGroupedTieredPackagePrice) /* spotless:on */ override fun toString(): String = when { @@ -3252,8 +3232,6 @@ constructor( "Price{newFloatingTieredPackagePrice=$newFloatingTieredPackagePrice}" newFloatingGroupedTieredPrice != null -> "Price{newFloatingGroupedTieredPrice=$newFloatingGroupedTieredPrice}" - newFloatingMaxGroupTieredPrice != null -> - "Price{newFloatingMaxGroupTieredPrice=$newFloatingMaxGroupTieredPrice}" newFloatingTieredWithMinimumPrice != null -> "Price{newFloatingTieredWithMinimumPrice=$newFloatingTieredWithMinimumPrice}" newFloatingPackageWithAllocationPrice != null -> @@ -3343,11 +3321,6 @@ constructor( newFloatingGroupedTieredPrice: NewFloatingGroupedTieredPrice ) = Price(newFloatingGroupedTieredPrice = newFloatingGroupedTieredPrice) - @JvmStatic - fun ofNewFloatingMaxGroupTieredPrice( - newFloatingMaxGroupTieredPrice: NewFloatingMaxGroupTieredPrice - ) = Price(newFloatingMaxGroupTieredPrice = newFloatingMaxGroupTieredPrice) - @JvmStatic fun ofNewFloatingTieredWithMinimumPrice( newFloatingTieredWithMinimumPrice: NewFloatingTieredWithMinimumPrice @@ -3475,10 +3448,6 @@ constructor( newFloatingGroupedTieredPrice: NewFloatingGroupedTieredPrice ): T - fun visitNewFloatingMaxGroupTieredPrice( - newFloatingMaxGroupTieredPrice: NewFloatingMaxGroupTieredPrice - ): T - fun visitNewFloatingTieredWithMinimumPrice( newFloatingTieredWithMinimumPrice: NewFloatingTieredWithMinimumPrice ): T @@ -3651,14 +3620,6 @@ constructor( return Price(newFloatingGroupedTieredPrice = it, _json = json) } } - "max_group_tiered" -> { - tryDeserialize(node, jacksonTypeRef()) { - it.validate() - } - ?.let { - return Price(newFloatingMaxGroupTieredPrice = it, _json = json) - } - } "tiered_with_minimum" -> { tryDeserialize( node, @@ -3862,8 +3823,6 @@ constructor( generator.writeObject(value.newFloatingTieredPackagePrice) value.newFloatingGroupedTieredPrice != null -> generator.writeObject(value.newFloatingGroupedTieredPrice) - value.newFloatingMaxGroupTieredPrice != null -> - generator.writeObject(value.newFloatingMaxGroupTieredPrice) value.newFloatingTieredWithMinimumPrice != null -> generator.writeObject(value.newFloatingTieredWithMinimumPrice) value.newFloatingPackageWithAllocationPrice != null -> @@ -4479,6 +4438,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -4839,6 +4799,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -5035,6 +4996,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -5803,6 +5765,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -6199,6 +6162,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -6395,6 +6359,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -7162,6 +7127,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -7788,6 +7754,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -7984,6 +7951,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -8760,6 +8728,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -9415,6 +9384,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -9611,6 +9581,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -10378,6 +10349,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -10942,6 +10914,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -11138,6 +11111,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -11908,6 +11882,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -12485,6 +12460,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -12681,6 +12657,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -13580,6 +13557,7 @@ constructor( "BpsConfig{bps=$bps, perUnitMaximum=$perUnitMaximum, additionalProperties=$additionalProperties}" } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -13832,6 +13810,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -14028,6 +14007,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -15096,6 +15076,7 @@ constructor( "BulkBpsConfig{tiers=$tiers, additionalProperties=$additionalProperties}" } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -15348,6 +15329,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -15544,6 +15526,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -16578,6 +16561,7 @@ constructor( "BulkConfig{tiers=$tiers, additionalProperties=$additionalProperties}" } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -16830,6 +16814,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -17026,6 +17011,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -17802,6 +17788,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -18139,6 +18126,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -18335,6 +18323,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -19107,6 +19096,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -19443,6 +19433,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -19639,6 +19630,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -20411,6 +20403,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -20747,6 +20740,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -20943,6 +20937,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -21125,7 +21120,7 @@ constructor( } @NoAutoDetect - class NewFloatingMaxGroupTieredPrice + class NewFloatingTieredWithMinimumPrice @JsonCreator private constructor( @JsonProperty("cadence") @@ -21137,16 +21132,16 @@ constructor( @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("tiered_with_minimum_config") + @ExcludeMissing + private val tieredWithMinimumConfig: JsonField = + JsonMissing.of(), @JsonProperty("billable_metric_id") @ExcludeMissing private val billableMetricId: JsonField = JsonMissing.of(), @@ -21189,14 +21184,14 @@ constructor( /** The id of the item the plan will be associated with. */ fun itemId(): String = itemId.getRequired("item_id") - fun maxGroupTieredConfig(): MaxGroupTieredConfig = - maxGroupTieredConfig.getRequired("max_group_tiered_config") - fun modelType(): ModelType = modelType.getRequired("model_type") /** The name of the price. */ fun name(): String = name.getRequired("name") + fun tieredWithMinimumConfig(): TieredWithMinimumConfig = + tieredWithMinimumConfig.getRequired("tiered_with_minimum_config") + /** * The id of the billable metric for the price. Only needed if the price is * usage-based. @@ -21269,10 +21264,6 @@ constructor( /** 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 @@ -21280,6 +21271,11 @@ constructor( /** The name of the price. */ @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + @JsonProperty("tiered_with_minimum_config") + @ExcludeMissing + fun _tieredWithMinimumConfig(): JsonField = + tieredWithMinimumConfig + /** * The id of the billable metric for the price. Only needed if the price is * usage-based. @@ -21352,7 +21348,7 @@ constructor( private var validated: Boolean = false - fun validate(): NewFloatingMaxGroupTieredPrice = apply { + fun validate(): NewFloatingTieredWithMinimumPrice = apply { if (validated) { return@apply } @@ -21360,9 +21356,9 @@ constructor( cadence() currency() itemId() - maxGroupTieredConfig().validate() modelType() name() + tieredWithMinimumConfig().validate() billableMetricId() billedInAdvance() billingCycleConfiguration().ifPresent { it.validate() } @@ -21387,9 +21383,9 @@ constructor( private var cadence: JsonField? = null private var currency: JsonField? = null private var itemId: JsonField? = null - private var maxGroupTieredConfig: JsonField? = null private var modelType: JsonField? = null private var name: JsonField? = null + private var tieredWithMinimumConfig: JsonField? = null private var billableMetricId: JsonField = JsonMissing.of() private var billedInAdvance: JsonField = JsonMissing.of() private var billingCycleConfiguration: JsonField = @@ -21406,27 +21402,28 @@ constructor( @JvmSynthetic internal fun from( - newFloatingMaxGroupTieredPrice: NewFloatingMaxGroupTieredPrice + newFloatingTieredWithMinimumPrice: NewFloatingTieredWithMinimumPrice ) = apply { - cadence = newFloatingMaxGroupTieredPrice.cadence - currency = newFloatingMaxGroupTieredPrice.currency - itemId = newFloatingMaxGroupTieredPrice.itemId - maxGroupTieredConfig = newFloatingMaxGroupTieredPrice.maxGroupTieredConfig - modelType = newFloatingMaxGroupTieredPrice.modelType - name = newFloatingMaxGroupTieredPrice.name - billableMetricId = newFloatingMaxGroupTieredPrice.billableMetricId - billedInAdvance = newFloatingMaxGroupTieredPrice.billedInAdvance + cadence = newFloatingTieredWithMinimumPrice.cadence + currency = newFloatingTieredWithMinimumPrice.currency + itemId = newFloatingTieredWithMinimumPrice.itemId + modelType = newFloatingTieredWithMinimumPrice.modelType + name = newFloatingTieredWithMinimumPrice.name + tieredWithMinimumConfig = + newFloatingTieredWithMinimumPrice.tieredWithMinimumConfig + billableMetricId = newFloatingTieredWithMinimumPrice.billableMetricId + billedInAdvance = newFloatingTieredWithMinimumPrice.billedInAdvance billingCycleConfiguration = - newFloatingMaxGroupTieredPrice.billingCycleConfiguration - conversionRate = newFloatingMaxGroupTieredPrice.conversionRate - externalPriceId = newFloatingMaxGroupTieredPrice.externalPriceId - fixedPriceQuantity = newFloatingMaxGroupTieredPrice.fixedPriceQuantity - invoiceGroupingKey = newFloatingMaxGroupTieredPrice.invoiceGroupingKey + newFloatingTieredWithMinimumPrice.billingCycleConfiguration + conversionRate = newFloatingTieredWithMinimumPrice.conversionRate + externalPriceId = newFloatingTieredWithMinimumPrice.externalPriceId + fixedPriceQuantity = newFloatingTieredWithMinimumPrice.fixedPriceQuantity + invoiceGroupingKey = newFloatingTieredWithMinimumPrice.invoiceGroupingKey invoicingCycleConfiguration = - newFloatingMaxGroupTieredPrice.invoicingCycleConfiguration - metadata = newFloatingMaxGroupTieredPrice.metadata + newFloatingTieredWithMinimumPrice.invoicingCycleConfiguration + metadata = newFloatingTieredWithMinimumPrice.metadata additionalProperties = - newFloatingMaxGroupTieredPrice.additionalProperties.toMutableMap() + newFloatingTieredWithMinimumPrice.additionalProperties.toMutableMap() } /** The cadence to bill for this price on. */ @@ -21447,13 +21444,6 @@ constructor( /** 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 { @@ -21466,6 +21456,13 @@ constructor( /** The name of the price. */ fun name(name: JsonField) = apply { this.name = name } + fun tieredWithMinimumConfig(tieredWithMinimumConfig: TieredWithMinimumConfig) = + tieredWithMinimumConfig(JsonField.of(tieredWithMinimumConfig)) + + fun tieredWithMinimumConfig( + tieredWithMinimumConfig: JsonField + ) = apply { this.tieredWithMinimumConfig = tieredWithMinimumConfig } + /** * The id of the billable metric for the price. Only needed if the price is * usage-based. @@ -21694,14 +21691,14 @@ constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): NewFloatingMaxGroupTieredPrice = - NewFloatingMaxGroupTieredPrice( + fun build(): NewFloatingTieredWithMinimumPrice = + NewFloatingTieredWithMinimumPrice( checkRequired("cadence", cadence), checkRequired("currency", currency), checkRequired("itemId", itemId), - checkRequired("maxGroupTieredConfig", maxGroupTieredConfig), checkRequired("modelType", modelType), checkRequired("name", name), + checkRequired("tieredWithMinimumConfig", tieredWithMinimumConfig), billableMetricId, billedInAdvance, billingCycleConfiguration, @@ -21715,6 +21712,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -21797,8 +21795,60 @@ constructor( override fun toString() = value.toString() } + class ModelType + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + @com.fasterxml.jackson.annotation.JsonValue + fun _value(): JsonField = value + + companion object { + + @JvmField val TIERED_WITH_MINIMUM = of("tiered_with_minimum") + + @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) + } + + enum class Known { + TIERED_WITH_MINIMUM, + } + + enum class Value { + TIERED_WITH_MINIMUM, + _UNKNOWN, + } + + fun value(): Value = + when (this) { + TIERED_WITH_MINIMUM -> Value.TIERED_WITH_MINIMUM + else -> Value._UNKNOWN + } + + fun known(): Known = + when (this) { + TIERED_WITH_MINIMUM -> Known.TIERED_WITH_MINIMUM + 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() + } + @NoAutoDetect - class MaxGroupTieredConfig + class TieredWithMinimumConfig @JsonCreator private constructor( @JsonAnySetter @@ -21811,7 +21861,7 @@ constructor( private var validated: Boolean = false - fun validate(): MaxGroupTieredConfig = apply { + fun validate(): TieredWithMinimumConfig = apply { if (validated) { return@apply } @@ -21832,10 +21882,11 @@ constructor( mutableMapOf() @JvmSynthetic - internal fun from(maxGroupTieredConfig: MaxGroupTieredConfig) = apply { - additionalProperties = - maxGroupTieredConfig.additionalProperties.toMutableMap() - } + internal fun from(tieredWithMinimumConfig: TieredWithMinimumConfig) = + apply { + additionalProperties = + tieredWithMinimumConfig.additionalProperties.toMutableMap() + } fun additionalProperties(additionalProperties: Map) = apply { @@ -21859,8 +21910,8 @@ constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): MaxGroupTieredConfig = - MaxGroupTieredConfig(additionalProperties.toImmutable()) + fun build(): TieredWithMinimumConfig = + TieredWithMinimumConfig(additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { @@ -21868,7 +21919,7 @@ constructor( return true } - return /* spotless:off */ other is MaxGroupTieredConfig && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is TieredWithMinimumConfig && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ @@ -21878,59 +21929,7 @@ constructor( 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() + "TieredWithMinimumConfig{additionalProperties=$additionalProperties}" } /** @@ -22051,6 +22050,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -22247,6 +22247,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -22415,21 +22416,21 @@ constructor( return true } - return /* spotless:off */ other is NewFloatingMaxGroupTieredPrice && cadence == other.cadence && currency == other.currency && itemId == other.itemId && maxGroupTieredConfig == other.maxGroupTieredConfig && modelType == other.modelType && name == other.name && billableMetricId == other.billableMetricId && billedInAdvance == other.billedInAdvance && billingCycleConfiguration == other.billingCycleConfiguration && conversionRate == other.conversionRate && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && metadata == other.metadata && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is NewFloatingTieredWithMinimumPrice && cadence == other.cadence && currency == other.currency && itemId == other.itemId && modelType == other.modelType && name == other.name && tieredWithMinimumConfig == other.tieredWithMinimumConfig && billableMetricId == other.billableMetricId && billedInAdvance == other.billedInAdvance && billingCycleConfiguration == other.billingCycleConfiguration && conversionRate == other.conversionRate && 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, currency, itemId, maxGroupTieredConfig, modelType, name, billableMetricId, billedInAdvance, billingCycleConfiguration, conversionRate, externalPriceId, fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, metadata, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(cadence, currency, itemId, modelType, name, tieredWithMinimumConfig, billableMetricId, billedInAdvance, billingCycleConfiguration, conversionRate, externalPriceId, fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, metadata, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "NewFloatingMaxGroupTieredPrice{cadence=$cadence, currency=$currency, itemId=$itemId, maxGroupTieredConfig=$maxGroupTieredConfig, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" + "NewFloatingTieredWithMinimumPrice{cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, tieredWithMinimumConfig=$tieredWithMinimumConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" } @NoAutoDetect - class NewFloatingTieredWithMinimumPrice + class NewFloatingPackageWithAllocationPrice @JsonCreator private constructor( @JsonProperty("cadence") @@ -22447,9 +22448,9 @@ constructor( @JsonProperty("name") @ExcludeMissing private val name: JsonField = JsonMissing.of(), - @JsonProperty("tiered_with_minimum_config") + @JsonProperty("package_with_allocation_config") @ExcludeMissing - private val tieredWithMinimumConfig: JsonField = + private val packageWithAllocationConfig: JsonField = JsonMissing.of(), @JsonProperty("billable_metric_id") @ExcludeMissing @@ -22498,8 +22499,8 @@ constructor( /** The name of the price. */ fun name(): String = name.getRequired("name") - fun tieredWithMinimumConfig(): TieredWithMinimumConfig = - tieredWithMinimumConfig.getRequired("tiered_with_minimum_config") + fun packageWithAllocationConfig(): PackageWithAllocationConfig = + packageWithAllocationConfig.getRequired("package_with_allocation_config") /** * The id of the billable metric for the price. Only needed if the price is @@ -22580,10 +22581,10 @@ constructor( /** The name of the price. */ @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name - @JsonProperty("tiered_with_minimum_config") + @JsonProperty("package_with_allocation_config") @ExcludeMissing - fun _tieredWithMinimumConfig(): JsonField = - tieredWithMinimumConfig + fun _packageWithAllocationConfig(): JsonField = + packageWithAllocationConfig /** * The id of the billable metric for the price. Only needed if the price is @@ -22657,7 +22658,7 @@ constructor( private var validated: Boolean = false - fun validate(): NewFloatingTieredWithMinimumPrice = apply { + fun validate(): NewFloatingPackageWithAllocationPrice = apply { if (validated) { return@apply } @@ -22667,7 +22668,7 @@ constructor( itemId() modelType() name() - tieredWithMinimumConfig().validate() + packageWithAllocationConfig().validate() billableMetricId() billedInAdvance() billingCycleConfiguration().ifPresent { it.validate() } @@ -22694,7 +22695,9 @@ constructor( private var itemId: JsonField? = null private var modelType: JsonField? = null private var name: JsonField? = null - private var tieredWithMinimumConfig: JsonField? = null + private var packageWithAllocationConfig: + JsonField? = + null private var billableMetricId: JsonField = JsonMissing.of() private var billedInAdvance: JsonField = JsonMissing.of() private var billingCycleConfiguration: JsonField = @@ -22711,28 +22714,31 @@ constructor( @JvmSynthetic internal fun from( - newFloatingTieredWithMinimumPrice: NewFloatingTieredWithMinimumPrice + newFloatingPackageWithAllocationPrice: NewFloatingPackageWithAllocationPrice ) = apply { - cadence = newFloatingTieredWithMinimumPrice.cadence - currency = newFloatingTieredWithMinimumPrice.currency - itemId = newFloatingTieredWithMinimumPrice.itemId - modelType = newFloatingTieredWithMinimumPrice.modelType - name = newFloatingTieredWithMinimumPrice.name - tieredWithMinimumConfig = - newFloatingTieredWithMinimumPrice.tieredWithMinimumConfig - billableMetricId = newFloatingTieredWithMinimumPrice.billableMetricId - billedInAdvance = newFloatingTieredWithMinimumPrice.billedInAdvance + cadence = newFloatingPackageWithAllocationPrice.cadence + currency = newFloatingPackageWithAllocationPrice.currency + itemId = newFloatingPackageWithAllocationPrice.itemId + modelType = newFloatingPackageWithAllocationPrice.modelType + name = newFloatingPackageWithAllocationPrice.name + packageWithAllocationConfig = + newFloatingPackageWithAllocationPrice.packageWithAllocationConfig + billableMetricId = newFloatingPackageWithAllocationPrice.billableMetricId + billedInAdvance = newFloatingPackageWithAllocationPrice.billedInAdvance billingCycleConfiguration = - newFloatingTieredWithMinimumPrice.billingCycleConfiguration - conversionRate = newFloatingTieredWithMinimumPrice.conversionRate - externalPriceId = newFloatingTieredWithMinimumPrice.externalPriceId - fixedPriceQuantity = newFloatingTieredWithMinimumPrice.fixedPriceQuantity - invoiceGroupingKey = newFloatingTieredWithMinimumPrice.invoiceGroupingKey + newFloatingPackageWithAllocationPrice.billingCycleConfiguration + conversionRate = newFloatingPackageWithAllocationPrice.conversionRate + externalPriceId = newFloatingPackageWithAllocationPrice.externalPriceId + fixedPriceQuantity = + newFloatingPackageWithAllocationPrice.fixedPriceQuantity + invoiceGroupingKey = + newFloatingPackageWithAllocationPrice.invoiceGroupingKey invoicingCycleConfiguration = - newFloatingTieredWithMinimumPrice.invoicingCycleConfiguration - metadata = newFloatingTieredWithMinimumPrice.metadata + newFloatingPackageWithAllocationPrice.invoicingCycleConfiguration + metadata = newFloatingPackageWithAllocationPrice.metadata additionalProperties = - newFloatingTieredWithMinimumPrice.additionalProperties.toMutableMap() + newFloatingPackageWithAllocationPrice.additionalProperties + .toMutableMap() } /** The cadence to bill for this price on. */ @@ -22765,12 +22771,13 @@ constructor( /** The name of the price. */ fun name(name: JsonField) = apply { this.name = name } - fun tieredWithMinimumConfig(tieredWithMinimumConfig: TieredWithMinimumConfig) = - tieredWithMinimumConfig(JsonField.of(tieredWithMinimumConfig)) + fun packageWithAllocationConfig( + packageWithAllocationConfig: PackageWithAllocationConfig + ) = packageWithAllocationConfig(JsonField.of(packageWithAllocationConfig)) - fun tieredWithMinimumConfig( - tieredWithMinimumConfig: JsonField - ) = apply { this.tieredWithMinimumConfig = tieredWithMinimumConfig } + fun packageWithAllocationConfig( + packageWithAllocationConfig: JsonField + ) = apply { this.packageWithAllocationConfig = packageWithAllocationConfig } /** * The id of the billable metric for the price. Only needed if the price is @@ -23000,14 +23007,17 @@ constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): NewFloatingTieredWithMinimumPrice = - NewFloatingTieredWithMinimumPrice( + fun build(): NewFloatingPackageWithAllocationPrice = + NewFloatingPackageWithAllocationPrice( checkRequired("cadence", cadence), checkRequired("currency", currency), checkRequired("itemId", itemId), checkRequired("modelType", modelType), checkRequired("name", name), - checkRequired("tieredWithMinimumConfig", tieredWithMinimumConfig), + checkRequired( + "packageWithAllocationConfig", + packageWithAllocationConfig + ), billableMetricId, billedInAdvance, billingCycleConfiguration, @@ -23021,6 +23031,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -23114,29 +23125,29 @@ constructor( companion object { - @JvmField val TIERED_WITH_MINIMUM = of("tiered_with_minimum") + @JvmField val PACKAGE_WITH_ALLOCATION = of("package_with_allocation") @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } enum class Known { - TIERED_WITH_MINIMUM, + PACKAGE_WITH_ALLOCATION, } enum class Value { - TIERED_WITH_MINIMUM, + PACKAGE_WITH_ALLOCATION, _UNKNOWN, } fun value(): Value = when (this) { - TIERED_WITH_MINIMUM -> Value.TIERED_WITH_MINIMUM + PACKAGE_WITH_ALLOCATION -> Value.PACKAGE_WITH_ALLOCATION else -> Value._UNKNOWN } fun known(): Known = when (this) { - TIERED_WITH_MINIMUM -> Known.TIERED_WITH_MINIMUM + PACKAGE_WITH_ALLOCATION -> Known.PACKAGE_WITH_ALLOCATION else -> throw OrbInvalidDataException("Unknown ModelType: $value") } @@ -23156,7 +23167,7 @@ constructor( } @NoAutoDetect - class TieredWithMinimumConfig + class PackageWithAllocationConfig @JsonCreator private constructor( @JsonAnySetter @@ -23169,7 +23180,7 @@ constructor( private var validated: Boolean = false - fun validate(): TieredWithMinimumConfig = apply { + fun validate(): PackageWithAllocationConfig = apply { if (validated) { return@apply } @@ -23190,11 +23201,12 @@ constructor( mutableMapOf() @JvmSynthetic - internal fun from(tieredWithMinimumConfig: TieredWithMinimumConfig) = - apply { - additionalProperties = - tieredWithMinimumConfig.additionalProperties.toMutableMap() - } + internal fun from( + packageWithAllocationConfig: PackageWithAllocationConfig + ) = apply { + additionalProperties = + packageWithAllocationConfig.additionalProperties.toMutableMap() + } fun additionalProperties(additionalProperties: Map) = apply { @@ -23218,8 +23230,8 @@ constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): TieredWithMinimumConfig = - TieredWithMinimumConfig(additionalProperties.toImmutable()) + fun build(): PackageWithAllocationConfig = + PackageWithAllocationConfig(additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { @@ -23227,7 +23239,7 @@ constructor( return true } - return /* spotless:off */ other is TieredWithMinimumConfig && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is PackageWithAllocationConfig && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ @@ -23237,7 +23249,7 @@ constructor( override fun hashCode(): Int = hashCode override fun toString() = - "TieredWithMinimumConfig{additionalProperties=$additionalProperties}" + "PackageWithAllocationConfig{additionalProperties=$additionalProperties}" } /** @@ -23358,6 +23370,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -23554,6 +23567,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -23722,21 +23736,21 @@ constructor( return true } - return /* spotless:off */ other is NewFloatingTieredWithMinimumPrice && cadence == other.cadence && currency == other.currency && itemId == other.itemId && modelType == other.modelType && name == other.name && tieredWithMinimumConfig == other.tieredWithMinimumConfig && billableMetricId == other.billableMetricId && billedInAdvance == other.billedInAdvance && billingCycleConfiguration == other.billingCycleConfiguration && conversionRate == other.conversionRate && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && metadata == other.metadata && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is NewFloatingPackageWithAllocationPrice && cadence == other.cadence && currency == other.currency && itemId == other.itemId && modelType == other.modelType && name == other.name && packageWithAllocationConfig == other.packageWithAllocationConfig && billableMetricId == other.billableMetricId && billedInAdvance == other.billedInAdvance && billingCycleConfiguration == other.billingCycleConfiguration && conversionRate == other.conversionRate && 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, currency, itemId, modelType, name, tieredWithMinimumConfig, billableMetricId, billedInAdvance, billingCycleConfiguration, conversionRate, externalPriceId, fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, metadata, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(cadence, currency, itemId, modelType, name, packageWithAllocationConfig, billableMetricId, billedInAdvance, billingCycleConfiguration, conversionRate, externalPriceId, fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, metadata, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "NewFloatingTieredWithMinimumPrice{cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, tieredWithMinimumConfig=$tieredWithMinimumConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" + "NewFloatingPackageWithAllocationPrice{cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, packageWithAllocationConfig=$packageWithAllocationConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" } @NoAutoDetect - class NewFloatingPackageWithAllocationPrice + class NewFloatingTieredPackageWithMinimumPrice @JsonCreator private constructor( @JsonProperty("cadence") @@ -23754,9 +23768,10 @@ constructor( @JsonProperty("name") @ExcludeMissing private val name: JsonField = JsonMissing.of(), - @JsonProperty("package_with_allocation_config") + @JsonProperty("tiered_package_with_minimum_config") @ExcludeMissing - private val packageWithAllocationConfig: JsonField = + private val tieredPackageWithMinimumConfig: + JsonField = JsonMissing.of(), @JsonProperty("billable_metric_id") @ExcludeMissing @@ -23805,8 +23820,8 @@ constructor( /** The name of the price. */ fun name(): String = name.getRequired("name") - fun packageWithAllocationConfig(): PackageWithAllocationConfig = - packageWithAllocationConfig.getRequired("package_with_allocation_config") + fun tieredPackageWithMinimumConfig(): TieredPackageWithMinimumConfig = + tieredPackageWithMinimumConfig.getRequired("tiered_package_with_minimum_config") /** * The id of the billable metric for the price. Only needed if the price is @@ -23887,10 +23902,10 @@ constructor( /** The name of the price. */ @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name - @JsonProperty("package_with_allocation_config") + @JsonProperty("tiered_package_with_minimum_config") @ExcludeMissing - fun _packageWithAllocationConfig(): JsonField = - packageWithAllocationConfig + fun _tieredPackageWithMinimumConfig(): JsonField = + tieredPackageWithMinimumConfig /** * The id of the billable metric for the price. Only needed if the price is @@ -23964,7 +23979,7 @@ constructor( private var validated: Boolean = false - fun validate(): NewFloatingPackageWithAllocationPrice = apply { + fun validate(): NewFloatingTieredPackageWithMinimumPrice = apply { if (validated) { return@apply } @@ -23974,7 +23989,7 @@ constructor( itemId() modelType() name() - packageWithAllocationConfig().validate() + tieredPackageWithMinimumConfig().validate() billableMetricId() billedInAdvance() billingCycleConfiguration().ifPresent { it.validate() } @@ -24001,8 +24016,8 @@ constructor( private var itemId: JsonField? = null private var modelType: JsonField? = null private var name: JsonField? = null - private var packageWithAllocationConfig: - JsonField? = + private var tieredPackageWithMinimumConfig: + JsonField? = null private var billableMetricId: JsonField = JsonMissing.of() private var billedInAdvance: JsonField = JsonMissing.of() @@ -24020,30 +24035,31 @@ constructor( @JvmSynthetic internal fun from( - newFloatingPackageWithAllocationPrice: NewFloatingPackageWithAllocationPrice + newFloatingTieredPackageWithMinimumPrice: + NewFloatingTieredPackageWithMinimumPrice ) = apply { - cadence = newFloatingPackageWithAllocationPrice.cadence - currency = newFloatingPackageWithAllocationPrice.currency - itemId = newFloatingPackageWithAllocationPrice.itemId - modelType = newFloatingPackageWithAllocationPrice.modelType - name = newFloatingPackageWithAllocationPrice.name - packageWithAllocationConfig = - newFloatingPackageWithAllocationPrice.packageWithAllocationConfig - billableMetricId = newFloatingPackageWithAllocationPrice.billableMetricId - billedInAdvance = newFloatingPackageWithAllocationPrice.billedInAdvance + cadence = newFloatingTieredPackageWithMinimumPrice.cadence + currency = newFloatingTieredPackageWithMinimumPrice.currency + itemId = newFloatingTieredPackageWithMinimumPrice.itemId + modelType = newFloatingTieredPackageWithMinimumPrice.modelType + name = newFloatingTieredPackageWithMinimumPrice.name + tieredPackageWithMinimumConfig = + newFloatingTieredPackageWithMinimumPrice.tieredPackageWithMinimumConfig + billableMetricId = newFloatingTieredPackageWithMinimumPrice.billableMetricId + billedInAdvance = newFloatingTieredPackageWithMinimumPrice.billedInAdvance billingCycleConfiguration = - newFloatingPackageWithAllocationPrice.billingCycleConfiguration - conversionRate = newFloatingPackageWithAllocationPrice.conversionRate - externalPriceId = newFloatingPackageWithAllocationPrice.externalPriceId + newFloatingTieredPackageWithMinimumPrice.billingCycleConfiguration + conversionRate = newFloatingTieredPackageWithMinimumPrice.conversionRate + externalPriceId = newFloatingTieredPackageWithMinimumPrice.externalPriceId fixedPriceQuantity = - newFloatingPackageWithAllocationPrice.fixedPriceQuantity + newFloatingTieredPackageWithMinimumPrice.fixedPriceQuantity invoiceGroupingKey = - newFloatingPackageWithAllocationPrice.invoiceGroupingKey + newFloatingTieredPackageWithMinimumPrice.invoiceGroupingKey invoicingCycleConfiguration = - newFloatingPackageWithAllocationPrice.invoicingCycleConfiguration - metadata = newFloatingPackageWithAllocationPrice.metadata + newFloatingTieredPackageWithMinimumPrice.invoicingCycleConfiguration + metadata = newFloatingTieredPackageWithMinimumPrice.metadata additionalProperties = - newFloatingPackageWithAllocationPrice.additionalProperties + newFloatingTieredPackageWithMinimumPrice.additionalProperties .toMutableMap() } @@ -24077,13 +24093,15 @@ constructor( /** The name of the price. */ fun name(name: JsonField) = apply { this.name = name } - fun packageWithAllocationConfig( - packageWithAllocationConfig: PackageWithAllocationConfig - ) = packageWithAllocationConfig(JsonField.of(packageWithAllocationConfig)) + fun tieredPackageWithMinimumConfig( + tieredPackageWithMinimumConfig: TieredPackageWithMinimumConfig + ) = tieredPackageWithMinimumConfig(JsonField.of(tieredPackageWithMinimumConfig)) - fun packageWithAllocationConfig( - packageWithAllocationConfig: JsonField - ) = apply { this.packageWithAllocationConfig = packageWithAllocationConfig } + fun tieredPackageWithMinimumConfig( + tieredPackageWithMinimumConfig: JsonField + ) = apply { + this.tieredPackageWithMinimumConfig = tieredPackageWithMinimumConfig + } /** * The id of the billable metric for the price. Only needed if the price is @@ -24313,16 +24331,16 @@ constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): NewFloatingPackageWithAllocationPrice = - NewFloatingPackageWithAllocationPrice( + fun build(): NewFloatingTieredPackageWithMinimumPrice = + NewFloatingTieredPackageWithMinimumPrice( checkRequired("cadence", cadence), checkRequired("currency", currency), checkRequired("itemId", itemId), checkRequired("modelType", modelType), checkRequired("name", name), checkRequired( - "packageWithAllocationConfig", - packageWithAllocationConfig + "tieredPackageWithMinimumConfig", + tieredPackageWithMinimumConfig ), billableMetricId, billedInAdvance, @@ -24337,6 +24355,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -24430,29 +24449,30 @@ constructor( companion object { - @JvmField val PACKAGE_WITH_ALLOCATION = of("package_with_allocation") + @JvmField + val TIERED_PACKAGE_WITH_MINIMUM = of("tiered_package_with_minimum") @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } enum class Known { - PACKAGE_WITH_ALLOCATION, + TIERED_PACKAGE_WITH_MINIMUM, } enum class Value { - PACKAGE_WITH_ALLOCATION, + TIERED_PACKAGE_WITH_MINIMUM, _UNKNOWN, } fun value(): Value = when (this) { - PACKAGE_WITH_ALLOCATION -> Value.PACKAGE_WITH_ALLOCATION + TIERED_PACKAGE_WITH_MINIMUM -> Value.TIERED_PACKAGE_WITH_MINIMUM else -> Value._UNKNOWN } fun known(): Known = when (this) { - PACKAGE_WITH_ALLOCATION -> Known.PACKAGE_WITH_ALLOCATION + TIERED_PACKAGE_WITH_MINIMUM -> Known.TIERED_PACKAGE_WITH_MINIMUM else -> throw OrbInvalidDataException("Unknown ModelType: $value") } @@ -24472,7 +24492,7 @@ constructor( } @NoAutoDetect - class PackageWithAllocationConfig + class TieredPackageWithMinimumConfig @JsonCreator private constructor( @JsonAnySetter @@ -24485,7 +24505,7 @@ constructor( private var validated: Boolean = false - fun validate(): PackageWithAllocationConfig = apply { + fun validate(): TieredPackageWithMinimumConfig = apply { if (validated) { return@apply } @@ -24507,10 +24527,10 @@ constructor( @JvmSynthetic internal fun from( - packageWithAllocationConfig: PackageWithAllocationConfig + tieredPackageWithMinimumConfig: TieredPackageWithMinimumConfig ) = apply { additionalProperties = - packageWithAllocationConfig.additionalProperties.toMutableMap() + tieredPackageWithMinimumConfig.additionalProperties.toMutableMap() } fun additionalProperties(additionalProperties: Map) = @@ -24535,8 +24555,8 @@ constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): PackageWithAllocationConfig = - PackageWithAllocationConfig(additionalProperties.toImmutable()) + fun build(): TieredPackageWithMinimumConfig = + TieredPackageWithMinimumConfig(additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { @@ -24544,7 +24564,7 @@ constructor( return true } - return /* spotless:off */ other is PackageWithAllocationConfig && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is TieredPackageWithMinimumConfig && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ @@ -24554,7 +24574,7 @@ constructor( override fun hashCode(): Int = hashCode override fun toString() = - "PackageWithAllocationConfig{additionalProperties=$additionalProperties}" + "TieredPackageWithMinimumConfig{additionalProperties=$additionalProperties}" } /** @@ -24675,6 +24695,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -24871,6 +24892,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -25039,21 +25061,21 @@ constructor( return true } - return /* spotless:off */ other is NewFloatingPackageWithAllocationPrice && cadence == other.cadence && currency == other.currency && itemId == other.itemId && modelType == other.modelType && name == other.name && packageWithAllocationConfig == other.packageWithAllocationConfig && billableMetricId == other.billableMetricId && billedInAdvance == other.billedInAdvance && billingCycleConfiguration == other.billingCycleConfiguration && conversionRate == other.conversionRate && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && metadata == other.metadata && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is NewFloatingTieredPackageWithMinimumPrice && cadence == other.cadence && currency == other.currency && itemId == other.itemId && modelType == other.modelType && name == other.name && tieredPackageWithMinimumConfig == other.tieredPackageWithMinimumConfig && billableMetricId == other.billableMetricId && billedInAdvance == other.billedInAdvance && billingCycleConfiguration == other.billingCycleConfiguration && conversionRate == other.conversionRate && 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, currency, itemId, modelType, name, packageWithAllocationConfig, billableMetricId, billedInAdvance, billingCycleConfiguration, conversionRate, externalPriceId, fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, metadata, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(cadence, currency, itemId, modelType, name, tieredPackageWithMinimumConfig, billableMetricId, billedInAdvance, billingCycleConfiguration, conversionRate, externalPriceId, fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, metadata, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "NewFloatingPackageWithAllocationPrice{cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, packageWithAllocationConfig=$packageWithAllocationConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" + "NewFloatingTieredPackageWithMinimumPrice{cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, tieredPackageWithMinimumConfig=$tieredPackageWithMinimumConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" } @NoAutoDetect - class NewFloatingTieredPackageWithMinimumPrice + class NewFloatingUnitWithPercentPrice @JsonCreator private constructor( @JsonProperty("cadence") @@ -25071,10 +25093,9 @@ constructor( @JsonProperty("name") @ExcludeMissing private val name: JsonField = JsonMissing.of(), - @JsonProperty("tiered_package_with_minimum_config") + @JsonProperty("unit_with_percent_config") @ExcludeMissing - private val tieredPackageWithMinimumConfig: - JsonField = + private val unitWithPercentConfig: JsonField = JsonMissing.of(), @JsonProperty("billable_metric_id") @ExcludeMissing @@ -25123,8 +25144,8 @@ constructor( /** The name of the price. */ fun name(): String = name.getRequired("name") - fun tieredPackageWithMinimumConfig(): TieredPackageWithMinimumConfig = - tieredPackageWithMinimumConfig.getRequired("tiered_package_with_minimum_config") + fun unitWithPercentConfig(): UnitWithPercentConfig = + unitWithPercentConfig.getRequired("unit_with_percent_config") /** * The id of the billable metric for the price. Only needed if the price is @@ -25205,10 +25226,10 @@ constructor( /** The name of the price. */ @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name - @JsonProperty("tiered_package_with_minimum_config") + @JsonProperty("unit_with_percent_config") @ExcludeMissing - fun _tieredPackageWithMinimumConfig(): JsonField = - tieredPackageWithMinimumConfig + fun _unitWithPercentConfig(): JsonField = + unitWithPercentConfig /** * The id of the billable metric for the price. Only needed if the price is @@ -25282,7 +25303,7 @@ constructor( private var validated: Boolean = false - fun validate(): NewFloatingTieredPackageWithMinimumPrice = apply { + fun validate(): NewFloatingUnitWithPercentPrice = apply { if (validated) { return@apply } @@ -25292,7 +25313,7 @@ constructor( itemId() modelType() name() - tieredPackageWithMinimumConfig().validate() + unitWithPercentConfig().validate() billableMetricId() billedInAdvance() billingCycleConfiguration().ifPresent { it.validate() } @@ -25319,9 +25340,7 @@ constructor( private var itemId: JsonField? = null private var modelType: JsonField? = null private var name: JsonField? = null - private var tieredPackageWithMinimumConfig: - JsonField? = - null + private var unitWithPercentConfig: JsonField? = null private var billableMetricId: JsonField = JsonMissing.of() private var billedInAdvance: JsonField = JsonMissing.of() private var billingCycleConfiguration: JsonField = @@ -25338,32 +25357,28 @@ constructor( @JvmSynthetic internal fun from( - newFloatingTieredPackageWithMinimumPrice: - NewFloatingTieredPackageWithMinimumPrice + newFloatingUnitWithPercentPrice: NewFloatingUnitWithPercentPrice ) = apply { - cadence = newFloatingTieredPackageWithMinimumPrice.cadence - currency = newFloatingTieredPackageWithMinimumPrice.currency - itemId = newFloatingTieredPackageWithMinimumPrice.itemId - modelType = newFloatingTieredPackageWithMinimumPrice.modelType - name = newFloatingTieredPackageWithMinimumPrice.name - tieredPackageWithMinimumConfig = - newFloatingTieredPackageWithMinimumPrice.tieredPackageWithMinimumConfig - billableMetricId = newFloatingTieredPackageWithMinimumPrice.billableMetricId - billedInAdvance = newFloatingTieredPackageWithMinimumPrice.billedInAdvance + cadence = newFloatingUnitWithPercentPrice.cadence + currency = newFloatingUnitWithPercentPrice.currency + itemId = newFloatingUnitWithPercentPrice.itemId + modelType = newFloatingUnitWithPercentPrice.modelType + name = newFloatingUnitWithPercentPrice.name + unitWithPercentConfig = + newFloatingUnitWithPercentPrice.unitWithPercentConfig + billableMetricId = newFloatingUnitWithPercentPrice.billableMetricId + billedInAdvance = newFloatingUnitWithPercentPrice.billedInAdvance billingCycleConfiguration = - newFloatingTieredPackageWithMinimumPrice.billingCycleConfiguration - conversionRate = newFloatingTieredPackageWithMinimumPrice.conversionRate - externalPriceId = newFloatingTieredPackageWithMinimumPrice.externalPriceId - fixedPriceQuantity = - newFloatingTieredPackageWithMinimumPrice.fixedPriceQuantity - invoiceGroupingKey = - newFloatingTieredPackageWithMinimumPrice.invoiceGroupingKey + newFloatingUnitWithPercentPrice.billingCycleConfiguration + conversionRate = newFloatingUnitWithPercentPrice.conversionRate + externalPriceId = newFloatingUnitWithPercentPrice.externalPriceId + fixedPriceQuantity = newFloatingUnitWithPercentPrice.fixedPriceQuantity + invoiceGroupingKey = newFloatingUnitWithPercentPrice.invoiceGroupingKey invoicingCycleConfiguration = - newFloatingTieredPackageWithMinimumPrice.invoicingCycleConfiguration - metadata = newFloatingTieredPackageWithMinimumPrice.metadata + newFloatingUnitWithPercentPrice.invoicingCycleConfiguration + metadata = newFloatingUnitWithPercentPrice.metadata additionalProperties = - newFloatingTieredPackageWithMinimumPrice.additionalProperties - .toMutableMap() + newFloatingUnitWithPercentPrice.additionalProperties.toMutableMap() } /** The cadence to bill for this price on. */ @@ -25396,15 +25411,12 @@ constructor( /** The name of the price. */ fun name(name: JsonField) = apply { this.name = name } - fun tieredPackageWithMinimumConfig( - tieredPackageWithMinimumConfig: TieredPackageWithMinimumConfig - ) = tieredPackageWithMinimumConfig(JsonField.of(tieredPackageWithMinimumConfig)) + fun unitWithPercentConfig(unitWithPercentConfig: UnitWithPercentConfig) = + unitWithPercentConfig(JsonField.of(unitWithPercentConfig)) - fun tieredPackageWithMinimumConfig( - tieredPackageWithMinimumConfig: JsonField - ) = apply { - this.tieredPackageWithMinimumConfig = tieredPackageWithMinimumConfig - } + fun unitWithPercentConfig( + unitWithPercentConfig: JsonField + ) = apply { this.unitWithPercentConfig = unitWithPercentConfig } /** * The id of the billable metric for the price. Only needed if the price is @@ -25634,17 +25646,14 @@ constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): NewFloatingTieredPackageWithMinimumPrice = - NewFloatingTieredPackageWithMinimumPrice( + fun build(): NewFloatingUnitWithPercentPrice = + NewFloatingUnitWithPercentPrice( checkRequired("cadence", cadence), checkRequired("currency", currency), checkRequired("itemId", itemId), checkRequired("modelType", modelType), checkRequired("name", name), - checkRequired( - "tieredPackageWithMinimumConfig", - tieredPackageWithMinimumConfig - ), + checkRequired("unitWithPercentConfig", unitWithPercentConfig), billableMetricId, billedInAdvance, billingCycleConfiguration, @@ -25658,6 +25667,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -25751,30 +25761,29 @@ constructor( companion object { - @JvmField - val TIERED_PACKAGE_WITH_MINIMUM = of("tiered_package_with_minimum") + @JvmField val UNIT_WITH_PERCENT = of("unit_with_percent") @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } enum class Known { - TIERED_PACKAGE_WITH_MINIMUM, + UNIT_WITH_PERCENT, } enum class Value { - TIERED_PACKAGE_WITH_MINIMUM, + UNIT_WITH_PERCENT, _UNKNOWN, } fun value(): Value = when (this) { - TIERED_PACKAGE_WITH_MINIMUM -> Value.TIERED_PACKAGE_WITH_MINIMUM + UNIT_WITH_PERCENT -> Value.UNIT_WITH_PERCENT else -> Value._UNKNOWN } fun known(): Known = when (this) { - TIERED_PACKAGE_WITH_MINIMUM -> Known.TIERED_PACKAGE_WITH_MINIMUM + UNIT_WITH_PERCENT -> Known.UNIT_WITH_PERCENT else -> throw OrbInvalidDataException("Unknown ModelType: $value") } @@ -25794,7 +25803,7 @@ constructor( } @NoAutoDetect - class TieredPackageWithMinimumConfig + class UnitWithPercentConfig @JsonCreator private constructor( @JsonAnySetter @@ -25807,7 +25816,7 @@ constructor( private var validated: Boolean = false - fun validate(): TieredPackageWithMinimumConfig = apply { + fun validate(): UnitWithPercentConfig = apply { if (validated) { return@apply } @@ -25828,11 +25837,9 @@ constructor( mutableMapOf() @JvmSynthetic - internal fun from( - tieredPackageWithMinimumConfig: TieredPackageWithMinimumConfig - ) = apply { + internal fun from(unitWithPercentConfig: UnitWithPercentConfig) = apply { additionalProperties = - tieredPackageWithMinimumConfig.additionalProperties.toMutableMap() + unitWithPercentConfig.additionalProperties.toMutableMap() } fun additionalProperties(additionalProperties: Map) = @@ -25857,8 +25864,8 @@ constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): TieredPackageWithMinimumConfig = - TieredPackageWithMinimumConfig(additionalProperties.toImmutable()) + fun build(): UnitWithPercentConfig = + UnitWithPercentConfig(additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { @@ -25866,7 +25873,7 @@ constructor( return true } - return /* spotless:off */ other is TieredPackageWithMinimumConfig && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is UnitWithPercentConfig && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ @@ -25876,7 +25883,7 @@ constructor( override fun hashCode(): Int = hashCode override fun toString() = - "TieredPackageWithMinimumConfig{additionalProperties=$additionalProperties}" + "UnitWithPercentConfig{additionalProperties=$additionalProperties}" } /** @@ -25997,6 +26004,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -26193,6 +26201,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -26361,21 +26370,21 @@ constructor( return true } - return /* spotless:off */ other is NewFloatingTieredPackageWithMinimumPrice && cadence == other.cadence && currency == other.currency && itemId == other.itemId && modelType == other.modelType && name == other.name && tieredPackageWithMinimumConfig == other.tieredPackageWithMinimumConfig && billableMetricId == other.billableMetricId && billedInAdvance == other.billedInAdvance && billingCycleConfiguration == other.billingCycleConfiguration && conversionRate == other.conversionRate && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && metadata == other.metadata && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is NewFloatingUnitWithPercentPrice && cadence == other.cadence && currency == other.currency && itemId == other.itemId && modelType == other.modelType && name == other.name && unitWithPercentConfig == other.unitWithPercentConfig && billableMetricId == other.billableMetricId && billedInAdvance == other.billedInAdvance && billingCycleConfiguration == other.billingCycleConfiguration && conversionRate == other.conversionRate && 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, currency, itemId, modelType, name, tieredPackageWithMinimumConfig, billableMetricId, billedInAdvance, billingCycleConfiguration, conversionRate, externalPriceId, fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, metadata, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(cadence, currency, itemId, modelType, name, unitWithPercentConfig, billableMetricId, billedInAdvance, billingCycleConfiguration, conversionRate, externalPriceId, fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, metadata, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "NewFloatingTieredPackageWithMinimumPrice{cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, tieredPackageWithMinimumConfig=$tieredPackageWithMinimumConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" + "NewFloatingUnitWithPercentPrice{cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, unitWithPercentConfig=$unitWithPercentConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" } @NoAutoDetect - class NewFloatingUnitWithPercentPrice + class NewFloatingTieredWithProrationPrice @JsonCreator private constructor( @JsonProperty("cadence") @@ -26393,9 +26402,9 @@ constructor( @JsonProperty("name") @ExcludeMissing private val name: JsonField = JsonMissing.of(), - @JsonProperty("unit_with_percent_config") + @JsonProperty("tiered_with_proration_config") @ExcludeMissing - private val unitWithPercentConfig: JsonField = + private val tieredWithProrationConfig: JsonField = JsonMissing.of(), @JsonProperty("billable_metric_id") @ExcludeMissing @@ -26444,8 +26453,8 @@ constructor( /** The name of the price. */ fun name(): String = name.getRequired("name") - fun unitWithPercentConfig(): UnitWithPercentConfig = - unitWithPercentConfig.getRequired("unit_with_percent_config") + fun tieredWithProrationConfig(): TieredWithProrationConfig = + tieredWithProrationConfig.getRequired("tiered_with_proration_config") /** * The id of the billable metric for the price. Only needed if the price is @@ -26526,10 +26535,10 @@ constructor( /** The name of the price. */ @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name - @JsonProperty("unit_with_percent_config") + @JsonProperty("tiered_with_proration_config") @ExcludeMissing - fun _unitWithPercentConfig(): JsonField = - unitWithPercentConfig + fun _tieredWithProrationConfig(): JsonField = + tieredWithProrationConfig /** * The id of the billable metric for the price. Only needed if the price is @@ -26603,7 +26612,7 @@ constructor( private var validated: Boolean = false - fun validate(): NewFloatingUnitWithPercentPrice = apply { + fun validate(): NewFloatingTieredWithProrationPrice = apply { if (validated) { return@apply } @@ -26613,7 +26622,7 @@ constructor( itemId() modelType() name() - unitWithPercentConfig().validate() + tieredWithProrationConfig().validate() billableMetricId() billedInAdvance() billingCycleConfiguration().ifPresent { it.validate() } @@ -26640,7 +26649,8 @@ constructor( private var itemId: JsonField? = null private var modelType: JsonField? = null private var name: JsonField? = null - private var unitWithPercentConfig: JsonField? = null + private var tieredWithProrationConfig: JsonField? = + null private var billableMetricId: JsonField = JsonMissing.of() private var billedInAdvance: JsonField = JsonMissing.of() private var billingCycleConfiguration: JsonField = @@ -26657,28 +26667,28 @@ constructor( @JvmSynthetic internal fun from( - newFloatingUnitWithPercentPrice: NewFloatingUnitWithPercentPrice + newFloatingTieredWithProrationPrice: NewFloatingTieredWithProrationPrice ) = apply { - cadence = newFloatingUnitWithPercentPrice.cadence - currency = newFloatingUnitWithPercentPrice.currency - itemId = newFloatingUnitWithPercentPrice.itemId - modelType = newFloatingUnitWithPercentPrice.modelType - name = newFloatingUnitWithPercentPrice.name - unitWithPercentConfig = - newFloatingUnitWithPercentPrice.unitWithPercentConfig - billableMetricId = newFloatingUnitWithPercentPrice.billableMetricId - billedInAdvance = newFloatingUnitWithPercentPrice.billedInAdvance + cadence = newFloatingTieredWithProrationPrice.cadence + currency = newFloatingTieredWithProrationPrice.currency + itemId = newFloatingTieredWithProrationPrice.itemId + modelType = newFloatingTieredWithProrationPrice.modelType + name = newFloatingTieredWithProrationPrice.name + tieredWithProrationConfig = + newFloatingTieredWithProrationPrice.tieredWithProrationConfig + billableMetricId = newFloatingTieredWithProrationPrice.billableMetricId + billedInAdvance = newFloatingTieredWithProrationPrice.billedInAdvance billingCycleConfiguration = - newFloatingUnitWithPercentPrice.billingCycleConfiguration - conversionRate = newFloatingUnitWithPercentPrice.conversionRate - externalPriceId = newFloatingUnitWithPercentPrice.externalPriceId - fixedPriceQuantity = newFloatingUnitWithPercentPrice.fixedPriceQuantity - invoiceGroupingKey = newFloatingUnitWithPercentPrice.invoiceGroupingKey + newFloatingTieredWithProrationPrice.billingCycleConfiguration + conversionRate = newFloatingTieredWithProrationPrice.conversionRate + externalPriceId = newFloatingTieredWithProrationPrice.externalPriceId + fixedPriceQuantity = newFloatingTieredWithProrationPrice.fixedPriceQuantity + invoiceGroupingKey = newFloatingTieredWithProrationPrice.invoiceGroupingKey invoicingCycleConfiguration = - newFloatingUnitWithPercentPrice.invoicingCycleConfiguration - metadata = newFloatingUnitWithPercentPrice.metadata + newFloatingTieredWithProrationPrice.invoicingCycleConfiguration + metadata = newFloatingTieredWithProrationPrice.metadata additionalProperties = - newFloatingUnitWithPercentPrice.additionalProperties.toMutableMap() + newFloatingTieredWithProrationPrice.additionalProperties.toMutableMap() } /** The cadence to bill for this price on. */ @@ -26711,12 +26721,13 @@ constructor( /** The name of the price. */ fun name(name: JsonField) = apply { this.name = name } - fun unitWithPercentConfig(unitWithPercentConfig: UnitWithPercentConfig) = - unitWithPercentConfig(JsonField.of(unitWithPercentConfig)) + fun tieredWithProrationConfig( + tieredWithProrationConfig: TieredWithProrationConfig + ) = tieredWithProrationConfig(JsonField.of(tieredWithProrationConfig)) - fun unitWithPercentConfig( - unitWithPercentConfig: JsonField - ) = apply { this.unitWithPercentConfig = unitWithPercentConfig } + fun tieredWithProrationConfig( + tieredWithProrationConfig: JsonField + ) = apply { this.tieredWithProrationConfig = tieredWithProrationConfig } /** * The id of the billable metric for the price. Only needed if the price is @@ -26946,14 +26957,14 @@ constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): NewFloatingUnitWithPercentPrice = - NewFloatingUnitWithPercentPrice( + fun build(): NewFloatingTieredWithProrationPrice = + NewFloatingTieredWithProrationPrice( checkRequired("cadence", cadence), checkRequired("currency", currency), checkRequired("itemId", itemId), checkRequired("modelType", modelType), checkRequired("name", name), - checkRequired("unitWithPercentConfig", unitWithPercentConfig), + checkRequired("tieredWithProrationConfig", tieredWithProrationConfig), billableMetricId, billedInAdvance, billingCycleConfiguration, @@ -26967,6 +26978,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -27060,29 +27072,29 @@ constructor( companion object { - @JvmField val UNIT_WITH_PERCENT = of("unit_with_percent") + @JvmField val TIERED_WITH_PRORATION = of("tiered_with_proration") @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } enum class Known { - UNIT_WITH_PERCENT, + TIERED_WITH_PRORATION, } enum class Value { - UNIT_WITH_PERCENT, + TIERED_WITH_PRORATION, _UNKNOWN, } fun value(): Value = when (this) { - UNIT_WITH_PERCENT -> Value.UNIT_WITH_PERCENT + TIERED_WITH_PRORATION -> Value.TIERED_WITH_PRORATION else -> Value._UNKNOWN } fun known(): Known = when (this) { - UNIT_WITH_PERCENT -> Known.UNIT_WITH_PERCENT + TIERED_WITH_PRORATION -> Known.TIERED_WITH_PRORATION else -> throw OrbInvalidDataException("Unknown ModelType: $value") } @@ -27102,7 +27114,7 @@ constructor( } @NoAutoDetect - class UnitWithPercentConfig + class TieredWithProrationConfig @JsonCreator private constructor( @JsonAnySetter @@ -27115,7 +27127,7 @@ constructor( private var validated: Boolean = false - fun validate(): UnitWithPercentConfig = apply { + fun validate(): TieredWithProrationConfig = apply { if (validated) { return@apply } @@ -27136,10 +27148,11 @@ constructor( mutableMapOf() @JvmSynthetic - internal fun from(unitWithPercentConfig: UnitWithPercentConfig) = apply { - additionalProperties = - unitWithPercentConfig.additionalProperties.toMutableMap() - } + internal fun from(tieredWithProrationConfig: TieredWithProrationConfig) = + apply { + additionalProperties = + tieredWithProrationConfig.additionalProperties.toMutableMap() + } fun additionalProperties(additionalProperties: Map) = apply { @@ -27163,8 +27176,8 @@ constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): UnitWithPercentConfig = - UnitWithPercentConfig(additionalProperties.toImmutable()) + fun build(): TieredWithProrationConfig = + TieredWithProrationConfig(additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { @@ -27172,7 +27185,7 @@ constructor( return true } - return /* spotless:off */ other is UnitWithPercentConfig && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is TieredWithProrationConfig && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ @@ -27182,7 +27195,7 @@ constructor( override fun hashCode(): Int = hashCode override fun toString() = - "UnitWithPercentConfig{additionalProperties=$additionalProperties}" + "TieredWithProrationConfig{additionalProperties=$additionalProperties}" } /** @@ -27303,6 +27316,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -27499,6 +27513,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -27667,21 +27682,21 @@ constructor( return true } - return /* spotless:off */ other is NewFloatingUnitWithPercentPrice && cadence == other.cadence && currency == other.currency && itemId == other.itemId && modelType == other.modelType && name == other.name && unitWithPercentConfig == other.unitWithPercentConfig && billableMetricId == other.billableMetricId && billedInAdvance == other.billedInAdvance && billingCycleConfiguration == other.billingCycleConfiguration && conversionRate == other.conversionRate && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && metadata == other.metadata && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is NewFloatingTieredWithProrationPrice && cadence == other.cadence && currency == other.currency && itemId == other.itemId && modelType == other.modelType && name == other.name && tieredWithProrationConfig == other.tieredWithProrationConfig && billableMetricId == other.billableMetricId && billedInAdvance == other.billedInAdvance && billingCycleConfiguration == other.billingCycleConfiguration && conversionRate == other.conversionRate && 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, currency, itemId, modelType, name, unitWithPercentConfig, billableMetricId, billedInAdvance, billingCycleConfiguration, conversionRate, externalPriceId, fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, metadata, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(cadence, currency, itemId, modelType, name, tieredWithProrationConfig, billableMetricId, billedInAdvance, billingCycleConfiguration, conversionRate, externalPriceId, fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, metadata, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "NewFloatingUnitWithPercentPrice{cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, unitWithPercentConfig=$unitWithPercentConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" + "NewFloatingTieredWithProrationPrice{cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, tieredWithProrationConfig=$tieredWithProrationConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" } @NoAutoDetect - class NewFloatingTieredWithProrationPrice + class NewFloatingUnitWithProrationPrice @JsonCreator private constructor( @JsonProperty("cadence") @@ -27699,9 +27714,9 @@ constructor( @JsonProperty("name") @ExcludeMissing private val name: JsonField = JsonMissing.of(), - @JsonProperty("tiered_with_proration_config") + @JsonProperty("unit_with_proration_config") @ExcludeMissing - private val tieredWithProrationConfig: JsonField = + private val unitWithProrationConfig: JsonField = JsonMissing.of(), @JsonProperty("billable_metric_id") @ExcludeMissing @@ -27750,8 +27765,8 @@ constructor( /** The name of the price. */ fun name(): String = name.getRequired("name") - fun tieredWithProrationConfig(): TieredWithProrationConfig = - tieredWithProrationConfig.getRequired("tiered_with_proration_config") + fun unitWithProrationConfig(): UnitWithProrationConfig = + unitWithProrationConfig.getRequired("unit_with_proration_config") /** * The id of the billable metric for the price. Only needed if the price is @@ -27832,10 +27847,10 @@ constructor( /** The name of the price. */ @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name - @JsonProperty("tiered_with_proration_config") + @JsonProperty("unit_with_proration_config") @ExcludeMissing - fun _tieredWithProrationConfig(): JsonField = - tieredWithProrationConfig + fun _unitWithProrationConfig(): JsonField = + unitWithProrationConfig /** * The id of the billable metric for the price. Only needed if the price is @@ -27909,7 +27924,7 @@ constructor( private var validated: Boolean = false - fun validate(): NewFloatingTieredWithProrationPrice = apply { + fun validate(): NewFloatingUnitWithProrationPrice = apply { if (validated) { return@apply } @@ -27919,7 +27934,7 @@ constructor( itemId() modelType() name() - tieredWithProrationConfig().validate() + unitWithProrationConfig().validate() billableMetricId() billedInAdvance() billingCycleConfiguration().ifPresent { it.validate() } @@ -27946,8 +27961,7 @@ constructor( private var itemId: JsonField? = null private var modelType: JsonField? = null private var name: JsonField? = null - private var tieredWithProrationConfig: JsonField? = - null + private var unitWithProrationConfig: JsonField? = null private var billableMetricId: JsonField = JsonMissing.of() private var billedInAdvance: JsonField = JsonMissing.of() private var billingCycleConfiguration: JsonField = @@ -27964,28 +27978,28 @@ constructor( @JvmSynthetic internal fun from( - newFloatingTieredWithProrationPrice: NewFloatingTieredWithProrationPrice + newFloatingUnitWithProrationPrice: NewFloatingUnitWithProrationPrice ) = apply { - cadence = newFloatingTieredWithProrationPrice.cadence - currency = newFloatingTieredWithProrationPrice.currency - itemId = newFloatingTieredWithProrationPrice.itemId - modelType = newFloatingTieredWithProrationPrice.modelType - name = newFloatingTieredWithProrationPrice.name - tieredWithProrationConfig = - newFloatingTieredWithProrationPrice.tieredWithProrationConfig - billableMetricId = newFloatingTieredWithProrationPrice.billableMetricId - billedInAdvance = newFloatingTieredWithProrationPrice.billedInAdvance + cadence = newFloatingUnitWithProrationPrice.cadence + currency = newFloatingUnitWithProrationPrice.currency + itemId = newFloatingUnitWithProrationPrice.itemId + modelType = newFloatingUnitWithProrationPrice.modelType + name = newFloatingUnitWithProrationPrice.name + unitWithProrationConfig = + newFloatingUnitWithProrationPrice.unitWithProrationConfig + billableMetricId = newFloatingUnitWithProrationPrice.billableMetricId + billedInAdvance = newFloatingUnitWithProrationPrice.billedInAdvance billingCycleConfiguration = - newFloatingTieredWithProrationPrice.billingCycleConfiguration - conversionRate = newFloatingTieredWithProrationPrice.conversionRate - externalPriceId = newFloatingTieredWithProrationPrice.externalPriceId - fixedPriceQuantity = newFloatingTieredWithProrationPrice.fixedPriceQuantity - invoiceGroupingKey = newFloatingTieredWithProrationPrice.invoiceGroupingKey + newFloatingUnitWithProrationPrice.billingCycleConfiguration + conversionRate = newFloatingUnitWithProrationPrice.conversionRate + externalPriceId = newFloatingUnitWithProrationPrice.externalPriceId + fixedPriceQuantity = newFloatingUnitWithProrationPrice.fixedPriceQuantity + invoiceGroupingKey = newFloatingUnitWithProrationPrice.invoiceGroupingKey invoicingCycleConfiguration = - newFloatingTieredWithProrationPrice.invoicingCycleConfiguration - metadata = newFloatingTieredWithProrationPrice.metadata + newFloatingUnitWithProrationPrice.invoicingCycleConfiguration + metadata = newFloatingUnitWithProrationPrice.metadata additionalProperties = - newFloatingTieredWithProrationPrice.additionalProperties.toMutableMap() + newFloatingUnitWithProrationPrice.additionalProperties.toMutableMap() } /** The cadence to bill for this price on. */ @@ -28018,13 +28032,12 @@ constructor( /** The name of the price. */ fun name(name: JsonField) = apply { this.name = name } - fun tieredWithProrationConfig( - tieredWithProrationConfig: TieredWithProrationConfig - ) = tieredWithProrationConfig(JsonField.of(tieredWithProrationConfig)) + fun unitWithProrationConfig(unitWithProrationConfig: UnitWithProrationConfig) = + unitWithProrationConfig(JsonField.of(unitWithProrationConfig)) - fun tieredWithProrationConfig( - tieredWithProrationConfig: JsonField - ) = apply { this.tieredWithProrationConfig = tieredWithProrationConfig } + fun unitWithProrationConfig( + unitWithProrationConfig: JsonField + ) = apply { this.unitWithProrationConfig = unitWithProrationConfig } /** * The id of the billable metric for the price. Only needed if the price is @@ -28254,14 +28267,14 @@ constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): NewFloatingTieredWithProrationPrice = - NewFloatingTieredWithProrationPrice( + fun build(): NewFloatingUnitWithProrationPrice = + NewFloatingUnitWithProrationPrice( checkRequired("cadence", cadence), checkRequired("currency", currency), checkRequired("itemId", itemId), checkRequired("modelType", modelType), checkRequired("name", name), - checkRequired("tieredWithProrationConfig", tieredWithProrationConfig), + checkRequired("unitWithProrationConfig", unitWithProrationConfig), billableMetricId, billedInAdvance, billingCycleConfiguration, @@ -28275,6 +28288,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -28368,29 +28382,29 @@ constructor( companion object { - @JvmField val TIERED_WITH_PRORATION = of("tiered_with_proration") + @JvmField val UNIT_WITH_PRORATION = of("unit_with_proration") @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } enum class Known { - TIERED_WITH_PRORATION, + UNIT_WITH_PRORATION, } enum class Value { - TIERED_WITH_PRORATION, + UNIT_WITH_PRORATION, _UNKNOWN, } fun value(): Value = when (this) { - TIERED_WITH_PRORATION -> Value.TIERED_WITH_PRORATION + UNIT_WITH_PRORATION -> Value.UNIT_WITH_PRORATION else -> Value._UNKNOWN } fun known(): Known = when (this) { - TIERED_WITH_PRORATION -> Known.TIERED_WITH_PRORATION + UNIT_WITH_PRORATION -> Known.UNIT_WITH_PRORATION else -> throw OrbInvalidDataException("Unknown ModelType: $value") } @@ -28410,7 +28424,7 @@ constructor( } @NoAutoDetect - class TieredWithProrationConfig + class UnitWithProrationConfig @JsonCreator private constructor( @JsonAnySetter @@ -28423,7 +28437,7 @@ constructor( private var validated: Boolean = false - fun validate(): TieredWithProrationConfig = apply { + fun validate(): UnitWithProrationConfig = apply { if (validated) { return@apply } @@ -28444,10 +28458,10 @@ constructor( mutableMapOf() @JvmSynthetic - internal fun from(tieredWithProrationConfig: TieredWithProrationConfig) = + internal fun from(unitWithProrationConfig: UnitWithProrationConfig) = apply { additionalProperties = - tieredWithProrationConfig.additionalProperties.toMutableMap() + unitWithProrationConfig.additionalProperties.toMutableMap() } fun additionalProperties(additionalProperties: Map) = @@ -28472,8 +28486,8 @@ constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): TieredWithProrationConfig = - TieredWithProrationConfig(additionalProperties.toImmutable()) + fun build(): UnitWithProrationConfig = + UnitWithProrationConfig(additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { @@ -28481,7 +28495,7 @@ constructor( return true } - return /* spotless:off */ other is TieredWithProrationConfig && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is UnitWithProrationConfig && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ @@ -28491,7 +28505,7 @@ constructor( override fun hashCode(): Int = hashCode override fun toString() = - "TieredWithProrationConfig{additionalProperties=$additionalProperties}" + "UnitWithProrationConfig{additionalProperties=$additionalProperties}" } /** @@ -28612,6 +28626,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -28808,6 +28823,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -28976,21 +28992,21 @@ constructor( return true } - return /* spotless:off */ other is NewFloatingTieredWithProrationPrice && cadence == other.cadence && currency == other.currency && itemId == other.itemId && modelType == other.modelType && name == other.name && tieredWithProrationConfig == other.tieredWithProrationConfig && billableMetricId == other.billableMetricId && billedInAdvance == other.billedInAdvance && billingCycleConfiguration == other.billingCycleConfiguration && conversionRate == other.conversionRate && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && metadata == other.metadata && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is NewFloatingUnitWithProrationPrice && cadence == other.cadence && currency == other.currency && itemId == other.itemId && modelType == other.modelType && name == other.name && unitWithProrationConfig == other.unitWithProrationConfig && billableMetricId == other.billableMetricId && billedInAdvance == other.billedInAdvance && billingCycleConfiguration == other.billingCycleConfiguration && conversionRate == other.conversionRate && 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, currency, itemId, modelType, name, tieredWithProrationConfig, billableMetricId, billedInAdvance, billingCycleConfiguration, conversionRate, externalPriceId, fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, metadata, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(cadence, currency, itemId, modelType, name, unitWithProrationConfig, billableMetricId, billedInAdvance, billingCycleConfiguration, conversionRate, externalPriceId, fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, metadata, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "NewFloatingTieredWithProrationPrice{cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, tieredWithProrationConfig=$tieredWithProrationConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" + "NewFloatingUnitWithProrationPrice{cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, unitWithProrationConfig=$unitWithProrationConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" } @NoAutoDetect - class NewFloatingUnitWithProrationPrice + class NewFloatingGroupedAllocationPrice @JsonCreator private constructor( @JsonProperty("cadence") @@ -28999,6 +29015,10 @@ constructor( @JsonProperty("currency") @ExcludeMissing private val currency: JsonField = JsonMissing.of(), + @JsonProperty("grouped_allocation_config") + @ExcludeMissing + private val groupedAllocationConfig: JsonField = + JsonMissing.of(), @JsonProperty("item_id") @ExcludeMissing private val itemId: JsonField = JsonMissing.of(), @@ -29008,10 +29028,6 @@ constructor( @JsonProperty("name") @ExcludeMissing private val name: JsonField = JsonMissing.of(), - @JsonProperty("unit_with_proration_config") - @ExcludeMissing - private val unitWithProrationConfig: JsonField = - JsonMissing.of(), @JsonProperty("billable_metric_id") @ExcludeMissing private val billableMetricId: JsonField = JsonMissing.of(), @@ -29051,6 +29067,9 @@ constructor( /** An ISO 4217 currency string for which this price is billed in. */ fun currency(): String = currency.getRequired("currency") + fun groupedAllocationConfig(): GroupedAllocationConfig = + groupedAllocationConfig.getRequired("grouped_allocation_config") + /** The id of the item the plan will be associated with. */ fun itemId(): String = itemId.getRequired("item_id") @@ -29059,9 +29078,6 @@ constructor( /** The name of the price. */ fun name(): String = name.getRequired("name") - fun unitWithProrationConfig(): UnitWithProrationConfig = - unitWithProrationConfig.getRequired("unit_with_proration_config") - /** * The id of the billable metric for the price. Only needed if the price is * usage-based. @@ -29131,6 +29147,11 @@ constructor( @ExcludeMissing fun _currency(): JsonField = currency + @JsonProperty("grouped_allocation_config") + @ExcludeMissing + fun _groupedAllocationConfig(): JsonField = + groupedAllocationConfig + /** The id of the item the plan will be associated with. */ @JsonProperty("item_id") @ExcludeMissing fun _itemId(): JsonField = itemId @@ -29141,11 +29162,6 @@ constructor( /** The name of the price. */ @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name - @JsonProperty("unit_with_proration_config") - @ExcludeMissing - fun _unitWithProrationConfig(): JsonField = - unitWithProrationConfig - /** * The id of the billable metric for the price. Only needed if the price is * usage-based. @@ -29218,17 +29234,17 @@ constructor( private var validated: Boolean = false - fun validate(): NewFloatingUnitWithProrationPrice = apply { + fun validate(): NewFloatingGroupedAllocationPrice = apply { if (validated) { return@apply } cadence() currency() + groupedAllocationConfig().validate() itemId() modelType() name() - unitWithProrationConfig().validate() billableMetricId() billedInAdvance() billingCycleConfiguration().ifPresent { it.validate() } @@ -29252,10 +29268,10 @@ constructor( private var cadence: JsonField? = null private var currency: JsonField? = null + private var groupedAllocationConfig: JsonField? = null private var itemId: JsonField? = null private var modelType: JsonField? = null private var name: JsonField? = null - private var unitWithProrationConfig: JsonField? = null private var billableMetricId: JsonField = JsonMissing.of() private var billedInAdvance: JsonField = JsonMissing.of() private var billingCycleConfiguration: JsonField = @@ -29272,28 +29288,28 @@ constructor( @JvmSynthetic internal fun from( - newFloatingUnitWithProrationPrice: NewFloatingUnitWithProrationPrice + newFloatingGroupedAllocationPrice: NewFloatingGroupedAllocationPrice ) = apply { - cadence = newFloatingUnitWithProrationPrice.cadence - currency = newFloatingUnitWithProrationPrice.currency - itemId = newFloatingUnitWithProrationPrice.itemId - modelType = newFloatingUnitWithProrationPrice.modelType - name = newFloatingUnitWithProrationPrice.name - unitWithProrationConfig = - newFloatingUnitWithProrationPrice.unitWithProrationConfig - billableMetricId = newFloatingUnitWithProrationPrice.billableMetricId - billedInAdvance = newFloatingUnitWithProrationPrice.billedInAdvance + cadence = newFloatingGroupedAllocationPrice.cadence + currency = newFloatingGroupedAllocationPrice.currency + groupedAllocationConfig = + newFloatingGroupedAllocationPrice.groupedAllocationConfig + itemId = newFloatingGroupedAllocationPrice.itemId + modelType = newFloatingGroupedAllocationPrice.modelType + name = newFloatingGroupedAllocationPrice.name + billableMetricId = newFloatingGroupedAllocationPrice.billableMetricId + billedInAdvance = newFloatingGroupedAllocationPrice.billedInAdvance billingCycleConfiguration = - newFloatingUnitWithProrationPrice.billingCycleConfiguration - conversionRate = newFloatingUnitWithProrationPrice.conversionRate - externalPriceId = newFloatingUnitWithProrationPrice.externalPriceId - fixedPriceQuantity = newFloatingUnitWithProrationPrice.fixedPriceQuantity - invoiceGroupingKey = newFloatingUnitWithProrationPrice.invoiceGroupingKey + newFloatingGroupedAllocationPrice.billingCycleConfiguration + conversionRate = newFloatingGroupedAllocationPrice.conversionRate + externalPriceId = newFloatingGroupedAllocationPrice.externalPriceId + fixedPriceQuantity = newFloatingGroupedAllocationPrice.fixedPriceQuantity + invoiceGroupingKey = newFloatingGroupedAllocationPrice.invoiceGroupingKey invoicingCycleConfiguration = - newFloatingUnitWithProrationPrice.invoicingCycleConfiguration - metadata = newFloatingUnitWithProrationPrice.metadata + newFloatingGroupedAllocationPrice.invoicingCycleConfiguration + metadata = newFloatingGroupedAllocationPrice.metadata additionalProperties = - newFloatingUnitWithProrationPrice.additionalProperties.toMutableMap() + newFloatingGroupedAllocationPrice.additionalProperties.toMutableMap() } /** The cadence to bill for this price on. */ @@ -29308,6 +29324,13 @@ constructor( /** An ISO 4217 currency string for which this price is billed in. */ fun currency(currency: JsonField) = apply { this.currency = currency } + fun groupedAllocationConfig(groupedAllocationConfig: GroupedAllocationConfig) = + groupedAllocationConfig(JsonField.of(groupedAllocationConfig)) + + fun groupedAllocationConfig( + groupedAllocationConfig: JsonField + ) = apply { this.groupedAllocationConfig = groupedAllocationConfig } + /** The id of the item the plan will be associated with. */ fun itemId(itemId: String) = itemId(JsonField.of(itemId)) @@ -29326,13 +29349,6 @@ constructor( /** The name of the price. */ fun name(name: JsonField) = apply { this.name = name } - fun unitWithProrationConfig(unitWithProrationConfig: UnitWithProrationConfig) = - unitWithProrationConfig(JsonField.of(unitWithProrationConfig)) - - fun unitWithProrationConfig( - unitWithProrationConfig: JsonField - ) = apply { this.unitWithProrationConfig = unitWithProrationConfig } - /** * The id of the billable metric for the price. Only needed if the price is * usage-based. @@ -29561,14 +29577,14 @@ constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): NewFloatingUnitWithProrationPrice = - NewFloatingUnitWithProrationPrice( + fun build(): NewFloatingGroupedAllocationPrice = + NewFloatingGroupedAllocationPrice( checkRequired("cadence", cadence), checkRequired("currency", currency), + checkRequired("groupedAllocationConfig", groupedAllocationConfig), checkRequired("itemId", itemId), checkRequired("modelType", modelType), checkRequired("name", name), - checkRequired("unitWithProrationConfig", unitWithProrationConfig), billableMetricId, billedInAdvance, billingCycleConfiguration, @@ -29582,6 +29598,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -29664,60 +29681,8 @@ constructor( override fun toString() = value.toString() } - class ModelType - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { - - @com.fasterxml.jackson.annotation.JsonValue - fun _value(): JsonField = value - - companion object { - - @JvmField val UNIT_WITH_PRORATION = of("unit_with_proration") - - @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) - } - - enum class Known { - UNIT_WITH_PRORATION, - } - - enum class Value { - UNIT_WITH_PRORATION, - _UNKNOWN, - } - - fun value(): Value = - when (this) { - UNIT_WITH_PRORATION -> Value.UNIT_WITH_PRORATION - else -> Value._UNKNOWN - } - - fun known(): Known = - when (this) { - UNIT_WITH_PRORATION -> Known.UNIT_WITH_PRORATION - 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() - } - @NoAutoDetect - class UnitWithProrationConfig + class GroupedAllocationConfig @JsonCreator private constructor( @JsonAnySetter @@ -29730,7 +29695,7 @@ constructor( private var validated: Boolean = false - fun validate(): UnitWithProrationConfig = apply { + fun validate(): GroupedAllocationConfig = apply { if (validated) { return@apply } @@ -29751,10 +29716,10 @@ constructor( mutableMapOf() @JvmSynthetic - internal fun from(unitWithProrationConfig: UnitWithProrationConfig) = + internal fun from(groupedAllocationConfig: GroupedAllocationConfig) = apply { additionalProperties = - unitWithProrationConfig.additionalProperties.toMutableMap() + groupedAllocationConfig.additionalProperties.toMutableMap() } fun additionalProperties(additionalProperties: Map) = @@ -29779,8 +29744,8 @@ constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): UnitWithProrationConfig = - UnitWithProrationConfig(additionalProperties.toImmutable()) + fun build(): GroupedAllocationConfig = + GroupedAllocationConfig(additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { @@ -29788,7 +29753,7 @@ constructor( return true } - return /* spotless:off */ other is UnitWithProrationConfig && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is GroupedAllocationConfig && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ @@ -29798,7 +29763,59 @@ constructor( override fun hashCode(): Int = hashCode override fun toString() = - "UnitWithProrationConfig{additionalProperties=$additionalProperties}" + "GroupedAllocationConfig{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 GROUPED_ALLOCATION = of("grouped_allocation") + + @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) + } + + enum class Known { + GROUPED_ALLOCATION, + } + + enum class Value { + GROUPED_ALLOCATION, + _UNKNOWN, + } + + fun value(): Value = + when (this) { + GROUPED_ALLOCATION -> Value.GROUPED_ALLOCATION + else -> Value._UNKNOWN + } + + fun known(): Known = + when (this) { + GROUPED_ALLOCATION -> Known.GROUPED_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() } /** @@ -29919,6 +29936,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -30115,6 +30133,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -30283,21 +30302,21 @@ constructor( return true } - return /* spotless:off */ other is NewFloatingUnitWithProrationPrice && cadence == other.cadence && currency == other.currency && itemId == other.itemId && modelType == other.modelType && name == other.name && unitWithProrationConfig == other.unitWithProrationConfig && billableMetricId == other.billableMetricId && billedInAdvance == other.billedInAdvance && billingCycleConfiguration == other.billingCycleConfiguration && conversionRate == other.conversionRate && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && metadata == other.metadata && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is NewFloatingGroupedAllocationPrice && cadence == other.cadence && currency == other.currency && groupedAllocationConfig == other.groupedAllocationConfig && itemId == other.itemId && modelType == other.modelType && name == other.name && billableMetricId == other.billableMetricId && billedInAdvance == other.billedInAdvance && billingCycleConfiguration == other.billingCycleConfiguration && conversionRate == other.conversionRate && 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, currency, itemId, modelType, name, unitWithProrationConfig, billableMetricId, billedInAdvance, billingCycleConfiguration, conversionRate, externalPriceId, fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, metadata, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(cadence, currency, groupedAllocationConfig, itemId, modelType, name, billableMetricId, billedInAdvance, billingCycleConfiguration, conversionRate, externalPriceId, fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, metadata, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "NewFloatingUnitWithProrationPrice{cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, unitWithProrationConfig=$unitWithProrationConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" + "NewFloatingGroupedAllocationPrice{cadence=$cadence, currency=$currency, groupedAllocationConfig=$groupedAllocationConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" } @NoAutoDetect - class NewFloatingGroupedAllocationPrice + class NewFloatingGroupedWithProratedMinimumPrice @JsonCreator private constructor( @JsonProperty("cadence") @@ -30306,9 +30325,10 @@ constructor( @JsonProperty("currency") @ExcludeMissing private val currency: JsonField = JsonMissing.of(), - @JsonProperty("grouped_allocation_config") + @JsonProperty("grouped_with_prorated_minimum_config") @ExcludeMissing - private val groupedAllocationConfig: JsonField = + private val groupedWithProratedMinimumConfig: + JsonField = JsonMissing.of(), @JsonProperty("item_id") @ExcludeMissing @@ -30358,8 +30378,10 @@ constructor( /** An ISO 4217 currency string for which this price is billed in. */ fun currency(): String = currency.getRequired("currency") - fun groupedAllocationConfig(): GroupedAllocationConfig = - groupedAllocationConfig.getRequired("grouped_allocation_config") + fun groupedWithProratedMinimumConfig(): GroupedWithProratedMinimumConfig = + groupedWithProratedMinimumConfig.getRequired( + "grouped_with_prorated_minimum_config" + ) /** The id of the item the plan will be associated with. */ fun itemId(): String = itemId.getRequired("item_id") @@ -30438,10 +30460,10 @@ constructor( @ExcludeMissing fun _currency(): JsonField = currency - @JsonProperty("grouped_allocation_config") + @JsonProperty("grouped_with_prorated_minimum_config") @ExcludeMissing - fun _groupedAllocationConfig(): JsonField = - groupedAllocationConfig + fun _groupedWithProratedMinimumConfig(): + JsonField = groupedWithProratedMinimumConfig /** The id of the item the plan will be associated with. */ @JsonProperty("item_id") @ExcludeMissing fun _itemId(): JsonField = itemId @@ -30525,14 +30547,14 @@ constructor( private var validated: Boolean = false - fun validate(): NewFloatingGroupedAllocationPrice = apply { + fun validate(): NewFloatingGroupedWithProratedMinimumPrice = apply { if (validated) { return@apply } cadence() currency() - groupedAllocationConfig().validate() + groupedWithProratedMinimumConfig().validate() itemId() modelType() name() @@ -30559,7 +30581,9 @@ constructor( private var cadence: JsonField? = null private var currency: JsonField? = null - private var groupedAllocationConfig: JsonField? = null + private var groupedWithProratedMinimumConfig: + JsonField? = + null private var itemId: JsonField? = null private var modelType: JsonField? = null private var name: JsonField? = null @@ -30579,28 +30603,34 @@ constructor( @JvmSynthetic internal fun from( - newFloatingGroupedAllocationPrice: NewFloatingGroupedAllocationPrice + newFloatingGroupedWithProratedMinimumPrice: + NewFloatingGroupedWithProratedMinimumPrice ) = apply { - cadence = newFloatingGroupedAllocationPrice.cadence - currency = newFloatingGroupedAllocationPrice.currency - groupedAllocationConfig = - newFloatingGroupedAllocationPrice.groupedAllocationConfig - itemId = newFloatingGroupedAllocationPrice.itemId - modelType = newFloatingGroupedAllocationPrice.modelType - name = newFloatingGroupedAllocationPrice.name - billableMetricId = newFloatingGroupedAllocationPrice.billableMetricId - billedInAdvance = newFloatingGroupedAllocationPrice.billedInAdvance + cadence = newFloatingGroupedWithProratedMinimumPrice.cadence + currency = newFloatingGroupedWithProratedMinimumPrice.currency + groupedWithProratedMinimumConfig = + newFloatingGroupedWithProratedMinimumPrice + .groupedWithProratedMinimumConfig + itemId = newFloatingGroupedWithProratedMinimumPrice.itemId + modelType = newFloatingGroupedWithProratedMinimumPrice.modelType + name = newFloatingGroupedWithProratedMinimumPrice.name + billableMetricId = + newFloatingGroupedWithProratedMinimumPrice.billableMetricId + billedInAdvance = newFloatingGroupedWithProratedMinimumPrice.billedInAdvance billingCycleConfiguration = - newFloatingGroupedAllocationPrice.billingCycleConfiguration - conversionRate = newFloatingGroupedAllocationPrice.conversionRate - externalPriceId = newFloatingGroupedAllocationPrice.externalPriceId - fixedPriceQuantity = newFloatingGroupedAllocationPrice.fixedPriceQuantity - invoiceGroupingKey = newFloatingGroupedAllocationPrice.invoiceGroupingKey + newFloatingGroupedWithProratedMinimumPrice.billingCycleConfiguration + conversionRate = newFloatingGroupedWithProratedMinimumPrice.conversionRate + externalPriceId = newFloatingGroupedWithProratedMinimumPrice.externalPriceId + fixedPriceQuantity = + newFloatingGroupedWithProratedMinimumPrice.fixedPriceQuantity + invoiceGroupingKey = + newFloatingGroupedWithProratedMinimumPrice.invoiceGroupingKey invoicingCycleConfiguration = - newFloatingGroupedAllocationPrice.invoicingCycleConfiguration - metadata = newFloatingGroupedAllocationPrice.metadata + newFloatingGroupedWithProratedMinimumPrice.invoicingCycleConfiguration + metadata = newFloatingGroupedWithProratedMinimumPrice.metadata additionalProperties = - newFloatingGroupedAllocationPrice.additionalProperties.toMutableMap() + newFloatingGroupedWithProratedMinimumPrice.additionalProperties + .toMutableMap() } /** The cadence to bill for this price on. */ @@ -30615,12 +30645,19 @@ constructor( /** An ISO 4217 currency string for which this price is billed in. */ fun currency(currency: JsonField) = apply { this.currency = currency } - fun groupedAllocationConfig(groupedAllocationConfig: GroupedAllocationConfig) = - groupedAllocationConfig(JsonField.of(groupedAllocationConfig)) + fun groupedWithProratedMinimumConfig( + groupedWithProratedMinimumConfig: GroupedWithProratedMinimumConfig + ) = + groupedWithProratedMinimumConfig( + JsonField.of(groupedWithProratedMinimumConfig) + ) - fun groupedAllocationConfig( - groupedAllocationConfig: JsonField - ) = apply { this.groupedAllocationConfig = groupedAllocationConfig } + fun groupedWithProratedMinimumConfig( + groupedWithProratedMinimumConfig: + JsonField + ) = apply { + this.groupedWithProratedMinimumConfig = groupedWithProratedMinimumConfig + } /** The id of the item the plan will be associated with. */ fun itemId(itemId: String) = itemId(JsonField.of(itemId)) @@ -30868,11 +30905,14 @@ constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): NewFloatingGroupedAllocationPrice = - NewFloatingGroupedAllocationPrice( + fun build(): NewFloatingGroupedWithProratedMinimumPrice = + NewFloatingGroupedWithProratedMinimumPrice( checkRequired("cadence", cadence), checkRequired("currency", currency), - checkRequired("groupedAllocationConfig", groupedAllocationConfig), + checkRequired( + "groupedWithProratedMinimumConfig", + groupedWithProratedMinimumConfig + ), checkRequired("itemId", itemId), checkRequired("modelType", modelType), checkRequired("name", name), @@ -30889,6 +30929,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -30972,7 +31013,7 @@ constructor( } @NoAutoDetect - class GroupedAllocationConfig + class GroupedWithProratedMinimumConfig @JsonCreator private constructor( @JsonAnySetter @@ -30985,7 +31026,7 @@ constructor( private var validated: Boolean = false - fun validate(): GroupedAllocationConfig = apply { + fun validate(): GroupedWithProratedMinimumConfig = apply { if (validated) { return@apply } @@ -31006,11 +31047,12 @@ constructor( mutableMapOf() @JvmSynthetic - internal fun from(groupedAllocationConfig: GroupedAllocationConfig) = - apply { - additionalProperties = - groupedAllocationConfig.additionalProperties.toMutableMap() - } + internal fun from( + groupedWithProratedMinimumConfig: GroupedWithProratedMinimumConfig + ) = apply { + additionalProperties = + groupedWithProratedMinimumConfig.additionalProperties.toMutableMap() + } fun additionalProperties(additionalProperties: Map) = apply { @@ -31034,8 +31076,8 @@ constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): GroupedAllocationConfig = - GroupedAllocationConfig(additionalProperties.toImmutable()) + fun build(): GroupedWithProratedMinimumConfig = + GroupedWithProratedMinimumConfig(additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { @@ -31043,7 +31085,7 @@ constructor( return true } - return /* spotless:off */ other is GroupedAllocationConfig && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is GroupedWithProratedMinimumConfig && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ @@ -31053,7 +31095,7 @@ constructor( override fun hashCode(): Int = hashCode override fun toString() = - "GroupedAllocationConfig{additionalProperties=$additionalProperties}" + "GroupedWithProratedMinimumConfig{additionalProperties=$additionalProperties}" } class ModelType @@ -31067,29 +31109,30 @@ constructor( companion object { - @JvmField val GROUPED_ALLOCATION = of("grouped_allocation") + @JvmField + val GROUPED_WITH_PRORATED_MINIMUM = of("grouped_with_prorated_minimum") @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } enum class Known { - GROUPED_ALLOCATION, + GROUPED_WITH_PRORATED_MINIMUM, } enum class Value { - GROUPED_ALLOCATION, + GROUPED_WITH_PRORATED_MINIMUM, _UNKNOWN, } fun value(): Value = when (this) { - GROUPED_ALLOCATION -> Value.GROUPED_ALLOCATION + GROUPED_WITH_PRORATED_MINIMUM -> Value.GROUPED_WITH_PRORATED_MINIMUM else -> Value._UNKNOWN } fun known(): Known = when (this) { - GROUPED_ALLOCATION -> Known.GROUPED_ALLOCATION + GROUPED_WITH_PRORATED_MINIMUM -> Known.GROUPED_WITH_PRORATED_MINIMUM else -> throw OrbInvalidDataException("Unknown ModelType: $value") } @@ -31226,6 +31269,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -31422,6 +31466,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -31590,21 +31635,21 @@ constructor( return true } - return /* spotless:off */ other is NewFloatingGroupedAllocationPrice && cadence == other.cadence && currency == other.currency && groupedAllocationConfig == other.groupedAllocationConfig && itemId == other.itemId && modelType == other.modelType && name == other.name && billableMetricId == other.billableMetricId && billedInAdvance == other.billedInAdvance && billingCycleConfiguration == other.billingCycleConfiguration && conversionRate == other.conversionRate && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && metadata == other.metadata && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is NewFloatingGroupedWithProratedMinimumPrice && cadence == other.cadence && currency == other.currency && groupedWithProratedMinimumConfig == other.groupedWithProratedMinimumConfig && itemId == other.itemId && modelType == other.modelType && name == other.name && billableMetricId == other.billableMetricId && billedInAdvance == other.billedInAdvance && billingCycleConfiguration == other.billingCycleConfiguration && conversionRate == other.conversionRate && 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, currency, groupedAllocationConfig, itemId, modelType, name, billableMetricId, billedInAdvance, billingCycleConfiguration, conversionRate, externalPriceId, fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, metadata, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(cadence, currency, groupedWithProratedMinimumConfig, itemId, modelType, name, billableMetricId, billedInAdvance, billingCycleConfiguration, conversionRate, externalPriceId, fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, metadata, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "NewFloatingGroupedAllocationPrice{cadence=$cadence, currency=$currency, groupedAllocationConfig=$groupedAllocationConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" + "NewFloatingGroupedWithProratedMinimumPrice{cadence=$cadence, currency=$currency, groupedWithProratedMinimumConfig=$groupedWithProratedMinimumConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" } @NoAutoDetect - class NewFloatingGroupedWithProratedMinimumPrice + class NewFloatingGroupedWithMeteredMinimumPrice @JsonCreator private constructor( @JsonProperty("cadence") @@ -31613,10 +31658,10 @@ constructor( @JsonProperty("currency") @ExcludeMissing private val currency: JsonField = JsonMissing.of(), - @JsonProperty("grouped_with_prorated_minimum_config") + @JsonProperty("grouped_with_metered_minimum_config") @ExcludeMissing - private val groupedWithProratedMinimumConfig: - JsonField = + private val groupedWithMeteredMinimumConfig: + JsonField = JsonMissing.of(), @JsonProperty("item_id") @ExcludeMissing @@ -31666,9 +31711,9 @@ constructor( /** An ISO 4217 currency string for which this price is billed in. */ fun currency(): String = currency.getRequired("currency") - fun groupedWithProratedMinimumConfig(): GroupedWithProratedMinimumConfig = - groupedWithProratedMinimumConfig.getRequired( - "grouped_with_prorated_minimum_config" + fun groupedWithMeteredMinimumConfig(): GroupedWithMeteredMinimumConfig = + groupedWithMeteredMinimumConfig.getRequired( + "grouped_with_metered_minimum_config" ) /** The id of the item the plan will be associated with. */ @@ -31748,10 +31793,10 @@ constructor( @ExcludeMissing fun _currency(): JsonField = currency - @JsonProperty("grouped_with_prorated_minimum_config") + @JsonProperty("grouped_with_metered_minimum_config") @ExcludeMissing - fun _groupedWithProratedMinimumConfig(): - JsonField = groupedWithProratedMinimumConfig + fun _groupedWithMeteredMinimumConfig(): JsonField = + groupedWithMeteredMinimumConfig /** The id of the item the plan will be associated with. */ @JsonProperty("item_id") @ExcludeMissing fun _itemId(): JsonField = itemId @@ -31835,14 +31880,14 @@ constructor( private var validated: Boolean = false - fun validate(): NewFloatingGroupedWithProratedMinimumPrice = apply { + fun validate(): NewFloatingGroupedWithMeteredMinimumPrice = apply { if (validated) { return@apply } cadence() currency() - groupedWithProratedMinimumConfig().validate() + groupedWithMeteredMinimumConfig().validate() itemId() modelType() name() @@ -31869,8 +31914,8 @@ constructor( private var cadence: JsonField? = null private var currency: JsonField? = null - private var groupedWithProratedMinimumConfig: - JsonField? = + private var groupedWithMeteredMinimumConfig: + JsonField? = null private var itemId: JsonField? = null private var modelType: JsonField? = null @@ -31891,33 +31936,33 @@ constructor( @JvmSynthetic internal fun from( - newFloatingGroupedWithProratedMinimumPrice: - NewFloatingGroupedWithProratedMinimumPrice + newFloatingGroupedWithMeteredMinimumPrice: + NewFloatingGroupedWithMeteredMinimumPrice ) = apply { - cadence = newFloatingGroupedWithProratedMinimumPrice.cadence - currency = newFloatingGroupedWithProratedMinimumPrice.currency - groupedWithProratedMinimumConfig = - newFloatingGroupedWithProratedMinimumPrice - .groupedWithProratedMinimumConfig - itemId = newFloatingGroupedWithProratedMinimumPrice.itemId - modelType = newFloatingGroupedWithProratedMinimumPrice.modelType - name = newFloatingGroupedWithProratedMinimumPrice.name + cadence = newFloatingGroupedWithMeteredMinimumPrice.cadence + currency = newFloatingGroupedWithMeteredMinimumPrice.currency + groupedWithMeteredMinimumConfig = + newFloatingGroupedWithMeteredMinimumPrice + .groupedWithMeteredMinimumConfig + itemId = newFloatingGroupedWithMeteredMinimumPrice.itemId + modelType = newFloatingGroupedWithMeteredMinimumPrice.modelType + name = newFloatingGroupedWithMeteredMinimumPrice.name billableMetricId = - newFloatingGroupedWithProratedMinimumPrice.billableMetricId - billedInAdvance = newFloatingGroupedWithProratedMinimumPrice.billedInAdvance + newFloatingGroupedWithMeteredMinimumPrice.billableMetricId + billedInAdvance = newFloatingGroupedWithMeteredMinimumPrice.billedInAdvance billingCycleConfiguration = - newFloatingGroupedWithProratedMinimumPrice.billingCycleConfiguration - conversionRate = newFloatingGroupedWithProratedMinimumPrice.conversionRate - externalPriceId = newFloatingGroupedWithProratedMinimumPrice.externalPriceId + newFloatingGroupedWithMeteredMinimumPrice.billingCycleConfiguration + conversionRate = newFloatingGroupedWithMeteredMinimumPrice.conversionRate + externalPriceId = newFloatingGroupedWithMeteredMinimumPrice.externalPriceId fixedPriceQuantity = - newFloatingGroupedWithProratedMinimumPrice.fixedPriceQuantity + newFloatingGroupedWithMeteredMinimumPrice.fixedPriceQuantity invoiceGroupingKey = - newFloatingGroupedWithProratedMinimumPrice.invoiceGroupingKey + newFloatingGroupedWithMeteredMinimumPrice.invoiceGroupingKey invoicingCycleConfiguration = - newFloatingGroupedWithProratedMinimumPrice.invoicingCycleConfiguration - metadata = newFloatingGroupedWithProratedMinimumPrice.metadata + newFloatingGroupedWithMeteredMinimumPrice.invoicingCycleConfiguration + metadata = newFloatingGroupedWithMeteredMinimumPrice.metadata additionalProperties = - newFloatingGroupedWithProratedMinimumPrice.additionalProperties + newFloatingGroupedWithMeteredMinimumPrice.additionalProperties .toMutableMap() } @@ -31933,18 +31978,17 @@ constructor( /** An ISO 4217 currency string for which this price is billed in. */ fun currency(currency: JsonField) = apply { this.currency = currency } - fun groupedWithProratedMinimumConfig( - groupedWithProratedMinimumConfig: GroupedWithProratedMinimumConfig + fun groupedWithMeteredMinimumConfig( + groupedWithMeteredMinimumConfig: GroupedWithMeteredMinimumConfig ) = - groupedWithProratedMinimumConfig( - JsonField.of(groupedWithProratedMinimumConfig) + groupedWithMeteredMinimumConfig( + JsonField.of(groupedWithMeteredMinimumConfig) ) - fun groupedWithProratedMinimumConfig( - groupedWithProratedMinimumConfig: - JsonField + fun groupedWithMeteredMinimumConfig( + groupedWithMeteredMinimumConfig: JsonField ) = apply { - this.groupedWithProratedMinimumConfig = groupedWithProratedMinimumConfig + this.groupedWithMeteredMinimumConfig = groupedWithMeteredMinimumConfig } /** The id of the item the plan will be associated with. */ @@ -32193,13 +32237,13 @@ constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): NewFloatingGroupedWithProratedMinimumPrice = - NewFloatingGroupedWithProratedMinimumPrice( + fun build(): NewFloatingGroupedWithMeteredMinimumPrice = + NewFloatingGroupedWithMeteredMinimumPrice( checkRequired("cadence", cadence), checkRequired("currency", currency), checkRequired( - "groupedWithProratedMinimumConfig", - groupedWithProratedMinimumConfig + "groupedWithMeteredMinimumConfig", + groupedWithMeteredMinimumConfig ), checkRequired("itemId", itemId), checkRequired("modelType", modelType), @@ -32217,6 +32261,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -32300,7 +32345,7 @@ constructor( } @NoAutoDetect - class GroupedWithProratedMinimumConfig + class GroupedWithMeteredMinimumConfig @JsonCreator private constructor( @JsonAnySetter @@ -32313,7 +32358,7 @@ constructor( private var validated: Boolean = false - fun validate(): GroupedWithProratedMinimumConfig = apply { + fun validate(): GroupedWithMeteredMinimumConfig = apply { if (validated) { return@apply } @@ -32335,10 +32380,10 @@ constructor( @JvmSynthetic internal fun from( - groupedWithProratedMinimumConfig: GroupedWithProratedMinimumConfig + groupedWithMeteredMinimumConfig: GroupedWithMeteredMinimumConfig ) = apply { additionalProperties = - groupedWithProratedMinimumConfig.additionalProperties.toMutableMap() + groupedWithMeteredMinimumConfig.additionalProperties.toMutableMap() } fun additionalProperties(additionalProperties: Map) = @@ -32363,8 +32408,8 @@ constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): GroupedWithProratedMinimumConfig = - GroupedWithProratedMinimumConfig(additionalProperties.toImmutable()) + fun build(): GroupedWithMeteredMinimumConfig = + GroupedWithMeteredMinimumConfig(additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { @@ -32372,7 +32417,7 @@ constructor( return true } - return /* spotless:off */ other is GroupedWithProratedMinimumConfig && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is GroupedWithMeteredMinimumConfig && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ @@ -32382,7 +32427,7 @@ constructor( override fun hashCode(): Int = hashCode override fun toString() = - "GroupedWithProratedMinimumConfig{additionalProperties=$additionalProperties}" + "GroupedWithMeteredMinimumConfig{additionalProperties=$additionalProperties}" } class ModelType @@ -32397,29 +32442,29 @@ constructor( companion object { @JvmField - val GROUPED_WITH_PRORATED_MINIMUM = of("grouped_with_prorated_minimum") + val GROUPED_WITH_METERED_MINIMUM = of("grouped_with_metered_minimum") @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } enum class Known { - GROUPED_WITH_PRORATED_MINIMUM, + GROUPED_WITH_METERED_MINIMUM, } enum class Value { - GROUPED_WITH_PRORATED_MINIMUM, + GROUPED_WITH_METERED_MINIMUM, _UNKNOWN, } fun value(): Value = when (this) { - GROUPED_WITH_PRORATED_MINIMUM -> Value.GROUPED_WITH_PRORATED_MINIMUM + GROUPED_WITH_METERED_MINIMUM -> Value.GROUPED_WITH_METERED_MINIMUM else -> Value._UNKNOWN } fun known(): Known = when (this) { - GROUPED_WITH_PRORATED_MINIMUM -> Known.GROUPED_WITH_PRORATED_MINIMUM + GROUPED_WITH_METERED_MINIMUM -> Known.GROUPED_WITH_METERED_MINIMUM else -> throw OrbInvalidDataException("Unknown ModelType: $value") } @@ -32556,6 +32601,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -32752,6 +32798,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -32920,21 +32967,21 @@ constructor( return true } - return /* spotless:off */ other is NewFloatingGroupedWithProratedMinimumPrice && cadence == other.cadence && currency == other.currency && groupedWithProratedMinimumConfig == other.groupedWithProratedMinimumConfig && itemId == other.itemId && modelType == other.modelType && name == other.name && billableMetricId == other.billableMetricId && billedInAdvance == other.billedInAdvance && billingCycleConfiguration == other.billingCycleConfiguration && conversionRate == other.conversionRate && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && metadata == other.metadata && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is NewFloatingGroupedWithMeteredMinimumPrice && cadence == other.cadence && currency == other.currency && groupedWithMeteredMinimumConfig == other.groupedWithMeteredMinimumConfig && itemId == other.itemId && modelType == other.modelType && name == other.name && billableMetricId == other.billableMetricId && billedInAdvance == other.billedInAdvance && billingCycleConfiguration == other.billingCycleConfiguration && conversionRate == other.conversionRate && 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, currency, groupedWithProratedMinimumConfig, itemId, modelType, name, billableMetricId, billedInAdvance, billingCycleConfiguration, conversionRate, externalPriceId, fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, metadata, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(cadence, currency, groupedWithMeteredMinimumConfig, itemId, modelType, name, billableMetricId, billedInAdvance, billingCycleConfiguration, conversionRate, externalPriceId, fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, metadata, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "NewFloatingGroupedWithProratedMinimumPrice{cadence=$cadence, currency=$currency, groupedWithProratedMinimumConfig=$groupedWithProratedMinimumConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" + "NewFloatingGroupedWithMeteredMinimumPrice{cadence=$cadence, currency=$currency, groupedWithMeteredMinimumConfig=$groupedWithMeteredMinimumConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" } @NoAutoDetect - class NewFloatingGroupedWithMeteredMinimumPrice + class NewFloatingMatrixWithDisplayNamePrice @JsonCreator private constructor( @JsonProperty("cadence") @@ -32943,14 +32990,13 @@ constructor( @JsonProperty("currency") @ExcludeMissing private val currency: JsonField = JsonMissing.of(), - @JsonProperty("grouped_with_metered_minimum_config") - @ExcludeMissing - private val groupedWithMeteredMinimumConfig: - JsonField = - JsonMissing.of(), @JsonProperty("item_id") @ExcludeMissing private val itemId: JsonField = JsonMissing.of(), + @JsonProperty("matrix_with_display_name_config") + @ExcludeMissing + private val matrixWithDisplayNameConfig: JsonField = + JsonMissing.of(), @JsonProperty("model_type") @ExcludeMissing private val modelType: JsonField = JsonMissing.of(), @@ -32996,14 +33042,12 @@ constructor( /** An ISO 4217 currency string for which this price is billed in. */ fun currency(): String = currency.getRequired("currency") - fun groupedWithMeteredMinimumConfig(): GroupedWithMeteredMinimumConfig = - groupedWithMeteredMinimumConfig.getRequired( - "grouped_with_metered_minimum_config" - ) - /** The id of the item the plan will be associated with. */ fun itemId(): String = itemId.getRequired("item_id") + fun matrixWithDisplayNameConfig(): MatrixWithDisplayNameConfig = + matrixWithDisplayNameConfig.getRequired("matrix_with_display_name_config") + fun modelType(): ModelType = modelType.getRequired("model_type") /** The name of the price. */ @@ -33078,14 +33122,14 @@ constructor( @ExcludeMissing fun _currency(): JsonField = currency - @JsonProperty("grouped_with_metered_minimum_config") - @ExcludeMissing - fun _groupedWithMeteredMinimumConfig(): JsonField = - groupedWithMeteredMinimumConfig - /** The id of the item the plan will be associated with. */ @JsonProperty("item_id") @ExcludeMissing fun _itemId(): JsonField = itemId + @JsonProperty("matrix_with_display_name_config") + @ExcludeMissing + fun _matrixWithDisplayNameConfig(): JsonField = + matrixWithDisplayNameConfig + @JsonProperty("model_type") @ExcludeMissing fun _modelType(): JsonField = modelType @@ -33165,15 +33209,15 @@ constructor( private var validated: Boolean = false - fun validate(): NewFloatingGroupedWithMeteredMinimumPrice = apply { + fun validate(): NewFloatingMatrixWithDisplayNamePrice = apply { if (validated) { return@apply } cadence() currency() - groupedWithMeteredMinimumConfig().validate() itemId() + matrixWithDisplayNameConfig().validate() modelType() name() billableMetricId() @@ -33199,10 +33243,10 @@ constructor( private var cadence: JsonField? = null private var currency: JsonField? = null - private var groupedWithMeteredMinimumConfig: - JsonField? = - null private var itemId: JsonField? = null + private var matrixWithDisplayNameConfig: + JsonField? = + null private var modelType: JsonField? = null private var name: JsonField? = null private var billableMetricId: JsonField = JsonMissing.of() @@ -33221,33 +33265,30 @@ constructor( @JvmSynthetic internal fun from( - newFloatingGroupedWithMeteredMinimumPrice: - NewFloatingGroupedWithMeteredMinimumPrice + newFloatingMatrixWithDisplayNamePrice: NewFloatingMatrixWithDisplayNamePrice ) = apply { - cadence = newFloatingGroupedWithMeteredMinimumPrice.cadence - currency = newFloatingGroupedWithMeteredMinimumPrice.currency - groupedWithMeteredMinimumConfig = - newFloatingGroupedWithMeteredMinimumPrice - .groupedWithMeteredMinimumConfig - itemId = newFloatingGroupedWithMeteredMinimumPrice.itemId - modelType = newFloatingGroupedWithMeteredMinimumPrice.modelType - name = newFloatingGroupedWithMeteredMinimumPrice.name - billableMetricId = - newFloatingGroupedWithMeteredMinimumPrice.billableMetricId - billedInAdvance = newFloatingGroupedWithMeteredMinimumPrice.billedInAdvance + cadence = newFloatingMatrixWithDisplayNamePrice.cadence + currency = newFloatingMatrixWithDisplayNamePrice.currency + itemId = newFloatingMatrixWithDisplayNamePrice.itemId + matrixWithDisplayNameConfig = + newFloatingMatrixWithDisplayNamePrice.matrixWithDisplayNameConfig + modelType = newFloatingMatrixWithDisplayNamePrice.modelType + name = newFloatingMatrixWithDisplayNamePrice.name + billableMetricId = newFloatingMatrixWithDisplayNamePrice.billableMetricId + billedInAdvance = newFloatingMatrixWithDisplayNamePrice.billedInAdvance billingCycleConfiguration = - newFloatingGroupedWithMeteredMinimumPrice.billingCycleConfiguration - conversionRate = newFloatingGroupedWithMeteredMinimumPrice.conversionRate - externalPriceId = newFloatingGroupedWithMeteredMinimumPrice.externalPriceId + newFloatingMatrixWithDisplayNamePrice.billingCycleConfiguration + conversionRate = newFloatingMatrixWithDisplayNamePrice.conversionRate + externalPriceId = newFloatingMatrixWithDisplayNamePrice.externalPriceId fixedPriceQuantity = - newFloatingGroupedWithMeteredMinimumPrice.fixedPriceQuantity + newFloatingMatrixWithDisplayNamePrice.fixedPriceQuantity invoiceGroupingKey = - newFloatingGroupedWithMeteredMinimumPrice.invoiceGroupingKey + newFloatingMatrixWithDisplayNamePrice.invoiceGroupingKey invoicingCycleConfiguration = - newFloatingGroupedWithMeteredMinimumPrice.invoicingCycleConfiguration - metadata = newFloatingGroupedWithMeteredMinimumPrice.metadata + newFloatingMatrixWithDisplayNamePrice.invoicingCycleConfiguration + metadata = newFloatingMatrixWithDisplayNamePrice.metadata additionalProperties = - newFloatingGroupedWithMeteredMinimumPrice.additionalProperties + newFloatingMatrixWithDisplayNamePrice.additionalProperties .toMutableMap() } @@ -33263,25 +33304,20 @@ constructor( /** An ISO 4217 currency string for which this price is billed in. */ fun currency(currency: JsonField) = apply { this.currency = currency } - fun groupedWithMeteredMinimumConfig( - groupedWithMeteredMinimumConfig: GroupedWithMeteredMinimumConfig - ) = - groupedWithMeteredMinimumConfig( - JsonField.of(groupedWithMeteredMinimumConfig) - ) - - fun groupedWithMeteredMinimumConfig( - groupedWithMeteredMinimumConfig: JsonField - ) = apply { - this.groupedWithMeteredMinimumConfig = groupedWithMeteredMinimumConfig - } - /** 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 matrixWithDisplayNameConfig( + matrixWithDisplayNameConfig: MatrixWithDisplayNameConfig + ) = matrixWithDisplayNameConfig(JsonField.of(matrixWithDisplayNameConfig)) + + fun matrixWithDisplayNameConfig( + matrixWithDisplayNameConfig: JsonField + ) = apply { this.matrixWithDisplayNameConfig = matrixWithDisplayNameConfig } + fun modelType(modelType: ModelType) = modelType(JsonField.of(modelType)) fun modelType(modelType: JsonField) = apply { @@ -33522,15 +33558,15 @@ constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): NewFloatingGroupedWithMeteredMinimumPrice = - NewFloatingGroupedWithMeteredMinimumPrice( + fun build(): NewFloatingMatrixWithDisplayNamePrice = + NewFloatingMatrixWithDisplayNamePrice( checkRequired("cadence", cadence), checkRequired("currency", currency), + checkRequired("itemId", itemId), checkRequired( - "groupedWithMeteredMinimumConfig", - groupedWithMeteredMinimumConfig + "matrixWithDisplayNameConfig", + matrixWithDisplayNameConfig ), - checkRequired("itemId", itemId), checkRequired("modelType", modelType), checkRequired("name", name), billableMetricId, @@ -33546,6 +33582,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -33629,7 +33666,7 @@ constructor( } @NoAutoDetect - class GroupedWithMeteredMinimumConfig + class MatrixWithDisplayNameConfig @JsonCreator private constructor( @JsonAnySetter @@ -33642,7 +33679,7 @@ constructor( private var validated: Boolean = false - fun validate(): GroupedWithMeteredMinimumConfig = apply { + fun validate(): MatrixWithDisplayNameConfig = apply { if (validated) { return@apply } @@ -33664,10 +33701,10 @@ constructor( @JvmSynthetic internal fun from( - groupedWithMeteredMinimumConfig: GroupedWithMeteredMinimumConfig + matrixWithDisplayNameConfig: MatrixWithDisplayNameConfig ) = apply { additionalProperties = - groupedWithMeteredMinimumConfig.additionalProperties.toMutableMap() + matrixWithDisplayNameConfig.additionalProperties.toMutableMap() } fun additionalProperties(additionalProperties: Map) = @@ -33692,8 +33729,8 @@ constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): GroupedWithMeteredMinimumConfig = - GroupedWithMeteredMinimumConfig(additionalProperties.toImmutable()) + fun build(): MatrixWithDisplayNameConfig = + MatrixWithDisplayNameConfig(additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { @@ -33701,7 +33738,7 @@ constructor( return true } - return /* spotless:off */ other is GroupedWithMeteredMinimumConfig && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is MatrixWithDisplayNameConfig && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ @@ -33711,7 +33748,7 @@ constructor( override fun hashCode(): Int = hashCode override fun toString() = - "GroupedWithMeteredMinimumConfig{additionalProperties=$additionalProperties}" + "MatrixWithDisplayNameConfig{additionalProperties=$additionalProperties}" } class ModelType @@ -33725,30 +33762,29 @@ constructor( companion object { - @JvmField - val GROUPED_WITH_METERED_MINIMUM = of("grouped_with_metered_minimum") + @JvmField val MATRIX_WITH_DISPLAY_NAME = of("matrix_with_display_name") @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } enum class Known { - GROUPED_WITH_METERED_MINIMUM, + MATRIX_WITH_DISPLAY_NAME, } enum class Value { - GROUPED_WITH_METERED_MINIMUM, + MATRIX_WITH_DISPLAY_NAME, _UNKNOWN, } fun value(): Value = when (this) { - GROUPED_WITH_METERED_MINIMUM -> Value.GROUPED_WITH_METERED_MINIMUM + MATRIX_WITH_DISPLAY_NAME -> Value.MATRIX_WITH_DISPLAY_NAME else -> Value._UNKNOWN } fun known(): Known = when (this) { - GROUPED_WITH_METERED_MINIMUM -> Known.GROUPED_WITH_METERED_MINIMUM + MATRIX_WITH_DISPLAY_NAME -> Known.MATRIX_WITH_DISPLAY_NAME else -> throw OrbInvalidDataException("Unknown ModelType: $value") } @@ -33885,6 +33921,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -34081,6 +34118,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -34249,23 +34287,27 @@ constructor( return true } - return /* spotless:off */ other is NewFloatingGroupedWithMeteredMinimumPrice && cadence == other.cadence && currency == other.currency && groupedWithMeteredMinimumConfig == other.groupedWithMeteredMinimumConfig && itemId == other.itemId && modelType == other.modelType && name == other.name && billableMetricId == other.billableMetricId && billedInAdvance == other.billedInAdvance && billingCycleConfiguration == other.billingCycleConfiguration && conversionRate == other.conversionRate && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && metadata == other.metadata && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is NewFloatingMatrixWithDisplayNamePrice && cadence == other.cadence && currency == other.currency && itemId == other.itemId && matrixWithDisplayNameConfig == other.matrixWithDisplayNameConfig && modelType == other.modelType && name == other.name && billableMetricId == other.billableMetricId && billedInAdvance == other.billedInAdvance && billingCycleConfiguration == other.billingCycleConfiguration && conversionRate == other.conversionRate && 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, currency, groupedWithMeteredMinimumConfig, itemId, modelType, name, billableMetricId, billedInAdvance, billingCycleConfiguration, conversionRate, externalPriceId, fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, metadata, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(cadence, currency, itemId, matrixWithDisplayNameConfig, modelType, name, billableMetricId, billedInAdvance, billingCycleConfiguration, conversionRate, externalPriceId, fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, metadata, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "NewFloatingGroupedWithMeteredMinimumPrice{cadence=$cadence, currency=$currency, groupedWithMeteredMinimumConfig=$groupedWithMeteredMinimumConfig, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" + "NewFloatingMatrixWithDisplayNamePrice{cadence=$cadence, currency=$currency, itemId=$itemId, matrixWithDisplayNameConfig=$matrixWithDisplayNameConfig, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" } @NoAutoDetect - class NewFloatingMatrixWithDisplayNamePrice + class NewFloatingBulkWithProrationPrice @JsonCreator private constructor( + @JsonProperty("bulk_with_proration_config") + @ExcludeMissing + private val bulkWithProrationConfig: JsonField = + JsonMissing.of(), @JsonProperty("cadence") @ExcludeMissing private val cadence: JsonField = JsonMissing.of(), @@ -34275,10 +34317,6 @@ constructor( @JsonProperty("item_id") @ExcludeMissing private val itemId: JsonField = JsonMissing.of(), - @JsonProperty("matrix_with_display_name_config") - @ExcludeMissing - private val matrixWithDisplayNameConfig: JsonField = - JsonMissing.of(), @JsonProperty("model_type") @ExcludeMissing private val modelType: JsonField = JsonMissing.of(), @@ -34318,6 +34356,9 @@ constructor( private val additionalProperties: Map = immutableEmptyMap(), ) { + fun bulkWithProrationConfig(): BulkWithProrationConfig = + bulkWithProrationConfig.getRequired("bulk_with_proration_config") + /** The cadence to bill for this price on. */ fun cadence(): Cadence = cadence.getRequired("cadence") @@ -34327,9 +34368,6 @@ constructor( /** The id of the item the plan will be associated with. */ fun itemId(): String = itemId.getRequired("item_id") - fun matrixWithDisplayNameConfig(): MatrixWithDisplayNameConfig = - matrixWithDisplayNameConfig.getRequired("matrix_with_display_name_config") - fun modelType(): ModelType = modelType.getRequired("model_type") /** The name of the price. */ @@ -34394,6 +34432,11 @@ constructor( fun metadata(): Optional = Optional.ofNullable(metadata.getNullable("metadata")) + @JsonProperty("bulk_with_proration_config") + @ExcludeMissing + fun _bulkWithProrationConfig(): JsonField = + bulkWithProrationConfig + /** The cadence to bill for this price on. */ @JsonProperty("cadence") @ExcludeMissing @@ -34407,11 +34450,6 @@ constructor( /** The id of the item the plan will be associated with. */ @JsonProperty("item_id") @ExcludeMissing fun _itemId(): JsonField = itemId - @JsonProperty("matrix_with_display_name_config") - @ExcludeMissing - fun _matrixWithDisplayNameConfig(): JsonField = - matrixWithDisplayNameConfig - @JsonProperty("model_type") @ExcludeMissing fun _modelType(): JsonField = modelType @@ -34491,15 +34529,15 @@ constructor( private var validated: Boolean = false - fun validate(): NewFloatingMatrixWithDisplayNamePrice = apply { + fun validate(): NewFloatingBulkWithProrationPrice = apply { if (validated) { return@apply } + bulkWithProrationConfig().validate() cadence() currency() itemId() - matrixWithDisplayNameConfig().validate() modelType() name() billableMetricId() @@ -34523,12 +34561,10 @@ constructor( class Builder { + private var bulkWithProrationConfig: JsonField? = null private var cadence: JsonField? = null private var currency: JsonField? = null private var itemId: JsonField? = null - private var matrixWithDisplayNameConfig: - JsonField? = - null private var modelType: JsonField? = null private var name: JsonField? = null private var billableMetricId: JsonField = JsonMissing.of() @@ -34547,33 +34583,37 @@ constructor( @JvmSynthetic internal fun from( - newFloatingMatrixWithDisplayNamePrice: NewFloatingMatrixWithDisplayNamePrice + newFloatingBulkWithProrationPrice: NewFloatingBulkWithProrationPrice ) = apply { - cadence = newFloatingMatrixWithDisplayNamePrice.cadence - currency = newFloatingMatrixWithDisplayNamePrice.currency - itemId = newFloatingMatrixWithDisplayNamePrice.itemId - matrixWithDisplayNameConfig = - newFloatingMatrixWithDisplayNamePrice.matrixWithDisplayNameConfig - modelType = newFloatingMatrixWithDisplayNamePrice.modelType - name = newFloatingMatrixWithDisplayNamePrice.name - billableMetricId = newFloatingMatrixWithDisplayNamePrice.billableMetricId - billedInAdvance = newFloatingMatrixWithDisplayNamePrice.billedInAdvance + bulkWithProrationConfig = + newFloatingBulkWithProrationPrice.bulkWithProrationConfig + cadence = newFloatingBulkWithProrationPrice.cadence + currency = newFloatingBulkWithProrationPrice.currency + itemId = newFloatingBulkWithProrationPrice.itemId + modelType = newFloatingBulkWithProrationPrice.modelType + name = newFloatingBulkWithProrationPrice.name + billableMetricId = newFloatingBulkWithProrationPrice.billableMetricId + billedInAdvance = newFloatingBulkWithProrationPrice.billedInAdvance billingCycleConfiguration = - newFloatingMatrixWithDisplayNamePrice.billingCycleConfiguration - conversionRate = newFloatingMatrixWithDisplayNamePrice.conversionRate - externalPriceId = newFloatingMatrixWithDisplayNamePrice.externalPriceId - fixedPriceQuantity = - newFloatingMatrixWithDisplayNamePrice.fixedPriceQuantity - invoiceGroupingKey = - newFloatingMatrixWithDisplayNamePrice.invoiceGroupingKey + newFloatingBulkWithProrationPrice.billingCycleConfiguration + conversionRate = newFloatingBulkWithProrationPrice.conversionRate + externalPriceId = newFloatingBulkWithProrationPrice.externalPriceId + fixedPriceQuantity = newFloatingBulkWithProrationPrice.fixedPriceQuantity + invoiceGroupingKey = newFloatingBulkWithProrationPrice.invoiceGroupingKey invoicingCycleConfiguration = - newFloatingMatrixWithDisplayNamePrice.invoicingCycleConfiguration - metadata = newFloatingMatrixWithDisplayNamePrice.metadata + newFloatingBulkWithProrationPrice.invoicingCycleConfiguration + metadata = newFloatingBulkWithProrationPrice.metadata additionalProperties = - newFloatingMatrixWithDisplayNamePrice.additionalProperties - .toMutableMap() + newFloatingBulkWithProrationPrice.additionalProperties.toMutableMap() } + fun bulkWithProrationConfig(bulkWithProrationConfig: BulkWithProrationConfig) = + bulkWithProrationConfig(JsonField.of(bulkWithProrationConfig)) + + fun bulkWithProrationConfig( + bulkWithProrationConfig: JsonField + ) = apply { this.bulkWithProrationConfig = bulkWithProrationConfig } + /** The cadence to bill for this price on. */ fun cadence(cadence: Cadence) = cadence(JsonField.of(cadence)) @@ -34592,14 +34632,6 @@ constructor( /** The id of the item the plan will be associated with. */ fun itemId(itemId: JsonField) = apply { this.itemId = itemId } - fun matrixWithDisplayNameConfig( - matrixWithDisplayNameConfig: MatrixWithDisplayNameConfig - ) = matrixWithDisplayNameConfig(JsonField.of(matrixWithDisplayNameConfig)) - - fun matrixWithDisplayNameConfig( - matrixWithDisplayNameConfig: JsonField - ) = apply { this.matrixWithDisplayNameConfig = matrixWithDisplayNameConfig } - fun modelType(modelType: ModelType) = modelType(JsonField.of(modelType)) fun modelType(modelType: JsonField) = apply { @@ -34840,15 +34872,12 @@ constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): NewFloatingMatrixWithDisplayNamePrice = - NewFloatingMatrixWithDisplayNamePrice( + fun build(): NewFloatingBulkWithProrationPrice = + NewFloatingBulkWithProrationPrice( + checkRequired("bulkWithProrationConfig", bulkWithProrationConfig), checkRequired("cadence", cadence), checkRequired("currency", currency), checkRequired("itemId", itemId), - checkRequired( - "matrixWithDisplayNameConfig", - matrixWithDisplayNameConfig - ), checkRequired("modelType", modelType), checkRequired("name", name), billableMetricId, @@ -34864,6 +34893,92 @@ constructor( ) } + @NoAutoDetect + class BulkWithProrationConfig + @JsonCreator + private constructor( + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): BulkWithProrationConfig = 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(bulkWithProrationConfig: BulkWithProrationConfig) = + apply { + additionalProperties = + bulkWithProrationConfig.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(): BulkWithProrationConfig = + BulkWithProrationConfig(additionalProperties.toImmutable()) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is BulkWithProrationConfig && 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() = + "BulkWithProrationConfig{additionalProperties=$additionalProperties}" + } + + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -34946,92 +35061,6 @@ constructor( override fun toString() = value.toString() } - @NoAutoDetect - class MatrixWithDisplayNameConfig - @JsonCreator - private constructor( - @JsonAnySetter - private val additionalProperties: Map = immutableEmptyMap(), - ) { - - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = additionalProperties - - private var validated: Boolean = false - - fun validate(): MatrixWithDisplayNameConfig = 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( - matrixWithDisplayNameConfig: MatrixWithDisplayNameConfig - ) = apply { - additionalProperties = - matrixWithDisplayNameConfig.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(): MatrixWithDisplayNameConfig = - MatrixWithDisplayNameConfig(additionalProperties.toImmutable()) - } - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is MatrixWithDisplayNameConfig && 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() = - "MatrixWithDisplayNameConfig{additionalProperties=$additionalProperties}" - } - class ModelType @JsonCreator private constructor( @@ -35043,29 +35072,29 @@ constructor( companion object { - @JvmField val MATRIX_WITH_DISPLAY_NAME = of("matrix_with_display_name") + @JvmField val BULK_WITH_PRORATION = of("bulk_with_proration") @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } enum class Known { - MATRIX_WITH_DISPLAY_NAME, + BULK_WITH_PRORATION, } enum class Value { - MATRIX_WITH_DISPLAY_NAME, + BULK_WITH_PRORATION, _UNKNOWN, } fun value(): Value = when (this) { - MATRIX_WITH_DISPLAY_NAME -> Value.MATRIX_WITH_DISPLAY_NAME + BULK_WITH_PRORATION -> Value.BULK_WITH_PRORATION else -> Value._UNKNOWN } fun known(): Known = when (this) { - MATRIX_WITH_DISPLAY_NAME -> Known.MATRIX_WITH_DISPLAY_NAME + BULK_WITH_PRORATION -> Known.BULK_WITH_PRORATION else -> throw OrbInvalidDataException("Unknown ModelType: $value") } @@ -35202,6 +35231,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -35398,6 +35428,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -35566,33 +35597,33 @@ constructor( return true } - return /* spotless:off */ other is NewFloatingMatrixWithDisplayNamePrice && cadence == other.cadence && currency == other.currency && itemId == other.itemId && matrixWithDisplayNameConfig == other.matrixWithDisplayNameConfig && modelType == other.modelType && name == other.name && billableMetricId == other.billableMetricId && billedInAdvance == other.billedInAdvance && billingCycleConfiguration == other.billingCycleConfiguration && conversionRate == other.conversionRate && externalPriceId == other.externalPriceId && fixedPriceQuantity == other.fixedPriceQuantity && invoiceGroupingKey == other.invoiceGroupingKey && invoicingCycleConfiguration == other.invoicingCycleConfiguration && metadata == other.metadata && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is NewFloatingBulkWithProrationPrice && bulkWithProrationConfig == other.bulkWithProrationConfig && cadence == other.cadence && currency == other.currency && itemId == other.itemId && modelType == other.modelType && name == other.name && billableMetricId == other.billableMetricId && billedInAdvance == other.billedInAdvance && billingCycleConfiguration == other.billingCycleConfiguration && conversionRate == other.conversionRate && 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, currency, itemId, matrixWithDisplayNameConfig, modelType, name, billableMetricId, billedInAdvance, billingCycleConfiguration, conversionRate, externalPriceId, fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, metadata, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(bulkWithProrationConfig, cadence, currency, itemId, modelType, name, billableMetricId, billedInAdvance, billingCycleConfiguration, conversionRate, externalPriceId, fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, metadata, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "NewFloatingMatrixWithDisplayNamePrice{cadence=$cadence, currency=$currency, itemId=$itemId, matrixWithDisplayNameConfig=$matrixWithDisplayNameConfig, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" + "NewFloatingBulkWithProrationPrice{bulkWithProrationConfig=$bulkWithProrationConfig, cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" } @NoAutoDetect - class NewFloatingBulkWithProrationPrice + class NewFloatingGroupedTieredPackagePrice @JsonCreator private constructor( - @JsonProperty("bulk_with_proration_config") - @ExcludeMissing - private val bulkWithProrationConfig: JsonField = - JsonMissing.of(), @JsonProperty("cadence") @ExcludeMissing private val cadence: JsonField = JsonMissing.of(), @JsonProperty("currency") @ExcludeMissing private val currency: JsonField = JsonMissing.of(), + @JsonProperty("grouped_tiered_package_config") + @ExcludeMissing + private val groupedTieredPackageConfig: JsonField = + JsonMissing.of(), @JsonProperty("item_id") @ExcludeMissing private val itemId: JsonField = JsonMissing.of(), @@ -35635,15 +35666,15 @@ constructor( private val additionalProperties: Map = immutableEmptyMap(), ) { - fun bulkWithProrationConfig(): BulkWithProrationConfig = - bulkWithProrationConfig.getRequired("bulk_with_proration_config") - /** The cadence to bill for this price on. */ fun cadence(): Cadence = cadence.getRequired("cadence") /** An ISO 4217 currency string for which this price is billed in. */ fun currency(): String = currency.getRequired("currency") + fun groupedTieredPackageConfig(): GroupedTieredPackageConfig = + groupedTieredPackageConfig.getRequired("grouped_tiered_package_config") + /** The id of the item the plan will be associated with. */ fun itemId(): String = itemId.getRequired("item_id") @@ -35711,11 +35742,6 @@ constructor( fun metadata(): Optional = Optional.ofNullable(metadata.getNullable("metadata")) - @JsonProperty("bulk_with_proration_config") - @ExcludeMissing - fun _bulkWithProrationConfig(): JsonField = - bulkWithProrationConfig - /** The cadence to bill for this price on. */ @JsonProperty("cadence") @ExcludeMissing @@ -35726,6 +35752,11 @@ constructor( @ExcludeMissing fun _currency(): JsonField = currency + @JsonProperty("grouped_tiered_package_config") + @ExcludeMissing + fun _groupedTieredPackageConfig(): JsonField = + groupedTieredPackageConfig + /** The id of the item the plan will be associated with. */ @JsonProperty("item_id") @ExcludeMissing fun _itemId(): JsonField = itemId @@ -35808,14 +35839,14 @@ constructor( private var validated: Boolean = false - fun validate(): NewFloatingBulkWithProrationPrice = apply { + fun validate(): NewFloatingGroupedTieredPackagePrice = apply { if (validated) { return@apply } - bulkWithProrationConfig().validate() cadence() currency() + groupedTieredPackageConfig().validate() itemId() modelType() name() @@ -35840,9 +35871,10 @@ constructor( class Builder { - private var bulkWithProrationConfig: JsonField? = null private var cadence: JsonField? = null private var currency: JsonField? = null + private var groupedTieredPackageConfig: JsonField? = + null private var itemId: JsonField? = null private var modelType: JsonField? = null private var name: JsonField? = null @@ -35862,37 +35894,30 @@ constructor( @JvmSynthetic internal fun from( - newFloatingBulkWithProrationPrice: NewFloatingBulkWithProrationPrice + newFloatingGroupedTieredPackagePrice: NewFloatingGroupedTieredPackagePrice ) = apply { - bulkWithProrationConfig = - newFloatingBulkWithProrationPrice.bulkWithProrationConfig - cadence = newFloatingBulkWithProrationPrice.cadence - currency = newFloatingBulkWithProrationPrice.currency - itemId = newFloatingBulkWithProrationPrice.itemId - modelType = newFloatingBulkWithProrationPrice.modelType - name = newFloatingBulkWithProrationPrice.name - billableMetricId = newFloatingBulkWithProrationPrice.billableMetricId - billedInAdvance = newFloatingBulkWithProrationPrice.billedInAdvance + cadence = newFloatingGroupedTieredPackagePrice.cadence + currency = newFloatingGroupedTieredPackagePrice.currency + groupedTieredPackageConfig = + newFloatingGroupedTieredPackagePrice.groupedTieredPackageConfig + itemId = newFloatingGroupedTieredPackagePrice.itemId + modelType = newFloatingGroupedTieredPackagePrice.modelType + name = newFloatingGroupedTieredPackagePrice.name + billableMetricId = newFloatingGroupedTieredPackagePrice.billableMetricId + billedInAdvance = newFloatingGroupedTieredPackagePrice.billedInAdvance billingCycleConfiguration = - newFloatingBulkWithProrationPrice.billingCycleConfiguration - conversionRate = newFloatingBulkWithProrationPrice.conversionRate - externalPriceId = newFloatingBulkWithProrationPrice.externalPriceId - fixedPriceQuantity = newFloatingBulkWithProrationPrice.fixedPriceQuantity - invoiceGroupingKey = newFloatingBulkWithProrationPrice.invoiceGroupingKey + newFloatingGroupedTieredPackagePrice.billingCycleConfiguration + conversionRate = newFloatingGroupedTieredPackagePrice.conversionRate + externalPriceId = newFloatingGroupedTieredPackagePrice.externalPriceId + fixedPriceQuantity = newFloatingGroupedTieredPackagePrice.fixedPriceQuantity + invoiceGroupingKey = newFloatingGroupedTieredPackagePrice.invoiceGroupingKey invoicingCycleConfiguration = - newFloatingBulkWithProrationPrice.invoicingCycleConfiguration - metadata = newFloatingBulkWithProrationPrice.metadata + newFloatingGroupedTieredPackagePrice.invoicingCycleConfiguration + metadata = newFloatingGroupedTieredPackagePrice.metadata additionalProperties = - newFloatingBulkWithProrationPrice.additionalProperties.toMutableMap() + newFloatingGroupedTieredPackagePrice.additionalProperties.toMutableMap() } - fun bulkWithProrationConfig(bulkWithProrationConfig: BulkWithProrationConfig) = - bulkWithProrationConfig(JsonField.of(bulkWithProrationConfig)) - - fun bulkWithProrationConfig( - bulkWithProrationConfig: JsonField - ) = apply { this.bulkWithProrationConfig = bulkWithProrationConfig } - /** The cadence to bill for this price on. */ fun cadence(cadence: Cadence) = cadence(JsonField.of(cadence)) @@ -35905,6 +35930,14 @@ constructor( /** An ISO 4217 currency string for which this price is billed in. */ fun currency(currency: JsonField) = apply { this.currency = currency } + fun groupedTieredPackageConfig( + groupedTieredPackageConfig: GroupedTieredPackageConfig + ) = groupedTieredPackageConfig(JsonField.of(groupedTieredPackageConfig)) + + fun groupedTieredPackageConfig( + groupedTieredPackageConfig: JsonField + ) = apply { this.groupedTieredPackageConfig = groupedTieredPackageConfig } + /** The id of the item the plan will be associated with. */ fun itemId(itemId: String) = itemId(JsonField.of(itemId)) @@ -36151,11 +36184,11 @@ constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): NewFloatingBulkWithProrationPrice = - NewFloatingBulkWithProrationPrice( - checkRequired("bulkWithProrationConfig", bulkWithProrationConfig), + fun build(): NewFloatingGroupedTieredPackagePrice = + NewFloatingGroupedTieredPackagePrice( checkRequired("cadence", cadence), checkRequired("currency", currency), + checkRequired("groupedTieredPackageConfig", groupedTieredPackageConfig), checkRequired("itemId", itemId), checkRequired("modelType", modelType), checkRequired("name", name), @@ -36172,91 +36205,7 @@ constructor( ) } - @NoAutoDetect - class BulkWithProrationConfig - @JsonCreator - private constructor( - @JsonAnySetter - private val additionalProperties: Map = immutableEmptyMap(), - ) { - - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = additionalProperties - - private var validated: Boolean = false - - fun validate(): BulkWithProrationConfig = 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(bulkWithProrationConfig: BulkWithProrationConfig) = - apply { - additionalProperties = - bulkWithProrationConfig.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(): BulkWithProrationConfig = - BulkWithProrationConfig(additionalProperties.toImmutable()) - } - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is BulkWithProrationConfig && 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() = - "BulkWithProrationConfig{additionalProperties=$additionalProperties}" - } - + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -36339,6 +36288,91 @@ constructor( override fun toString() = value.toString() } + @NoAutoDetect + class GroupedTieredPackageConfig + @JsonCreator + private constructor( + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): GroupedTieredPackageConfig = 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(groupedTieredPackageConfig: GroupedTieredPackageConfig) = + apply { + additionalProperties = + groupedTieredPackageConfig.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(): GroupedTieredPackageConfig = + GroupedTieredPackageConfig(additionalProperties.toImmutable()) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is GroupedTieredPackageConfig && 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() = + "GroupedTieredPackageConfig{additionalProperties=$additionalProperties}" + } + class ModelType @JsonCreator private constructor( @@ -36350,29 +36384,29 @@ constructor( companion object { - @JvmField val BULK_WITH_PRORATION = of("bulk_with_proration") + @JvmField val GROUPED_TIERED_PACKAGE = of("grouped_tiered_package") @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } enum class Known { - BULK_WITH_PRORATION, + GROUPED_TIERED_PACKAGE, } enum class Value { - BULK_WITH_PRORATION, + GROUPED_TIERED_PACKAGE, _UNKNOWN, } fun value(): Value = when (this) { - BULK_WITH_PRORATION -> Value.BULK_WITH_PRORATION + GROUPED_TIERED_PACKAGE -> Value.GROUPED_TIERED_PACKAGE else -> Value._UNKNOWN } fun known(): Known = when (this) { - BULK_WITH_PRORATION -> Known.BULK_WITH_PRORATION + GROUPED_TIERED_PACKAGE -> Known.GROUPED_TIERED_PACKAGE else -> throw OrbInvalidDataException("Unknown ModelType: $value") } @@ -36509,1315 +36543,7 @@ constructor( ) } - 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 NewFloatingBulkWithProrationPrice && bulkWithProrationConfig == other.bulkWithProrationConfig && cadence == other.cadence && currency == other.currency && itemId == other.itemId && modelType == other.modelType && name == other.name && billableMetricId == other.billableMetricId && billedInAdvance == other.billedInAdvance && billingCycleConfiguration == other.billingCycleConfiguration && conversionRate == other.conversionRate && 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(bulkWithProrationConfig, cadence, currency, itemId, modelType, name, billableMetricId, billedInAdvance, billingCycleConfiguration, conversionRate, externalPriceId, fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, metadata, additionalProperties) } - /* spotless:on */ - - override fun hashCode(): Int = hashCode - - override fun toString() = - "NewFloatingBulkWithProrationPrice{bulkWithProrationConfig=$bulkWithProrationConfig, cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" - } - - @NoAutoDetect - class NewFloatingGroupedTieredPackagePrice - @JsonCreator - private constructor( - @JsonProperty("cadence") - @ExcludeMissing - private val cadence: JsonField = JsonMissing.of(), - @JsonProperty("currency") - @ExcludeMissing - private val currency: JsonField = JsonMissing.of(), - @JsonProperty("grouped_tiered_package_config") - @ExcludeMissing - private val groupedTieredPackageConfig: JsonField = - JsonMissing.of(), - @JsonProperty("item_id") - @ExcludeMissing - private val itemId: 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("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(), - ) { - - /** The cadence to bill for this price on. */ - fun cadence(): Cadence = cadence.getRequired("cadence") - - /** An ISO 4217 currency string for which this price is billed in. */ - fun currency(): String = currency.getRequired("currency") - - fun groupedTieredPackageConfig(): GroupedTieredPackageConfig = - groupedTieredPackageConfig.getRequired("grouped_tiered_package_config") - - /** The id of the item the plan will be associated with. */ - fun itemId(): String = itemId.getRequired("item_id") - - fun modelType(): ModelType = modelType.getRequired("model_type") - - /** The name of the price. */ - fun name(): String = name.getRequired("name") - - /** - * 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")) - - /** - * 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")) - - /** - * For custom cadence: specifies the duration of the billing period in days or - * months. - */ - fun billingCycleConfiguration(): Optional = - Optional.ofNullable( - billingCycleConfiguration.getNullable("billing_cycle_configuration") - ) - - /** The per unit conversion rate of the price currency to the invoicing currency. */ - fun conversionRate(): Optional = - Optional.ofNullable(conversionRate.getNullable("conversion_rate")) - - /** An alias for the price. */ - fun externalPriceId(): Optional = - Optional.ofNullable(externalPriceId.getNullable("external_price_id")) - - /** - * If the Price represents a fixed cost, this represents the quantity of units - * applied. - */ - fun fixedPriceQuantity(): Optional = - Optional.ofNullable(fixedPriceQuantity.getNullable("fixed_price_quantity")) - - /** The property used to group this price on an invoice */ - fun invoiceGroupingKey(): Optional = - Optional.ofNullable(invoiceGroupingKey.getNullable("invoice_grouping_key")) - - /** - * 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") - ) - - /** - * 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")) - - /** The cadence to bill for this price on. */ - @JsonProperty("cadence") - @ExcludeMissing - fun _cadence(): JsonField = cadence - - /** An ISO 4217 currency string for which this price is billed in. */ - @JsonProperty("currency") - @ExcludeMissing - fun _currency(): JsonField = currency - - @JsonProperty("grouped_tiered_package_config") - @ExcludeMissing - fun _groupedTieredPackageConfig(): JsonField = - groupedTieredPackageConfig - - /** The id of the item the plan will be associated with. */ - @JsonProperty("item_id") @ExcludeMissing fun _itemId(): JsonField = itemId - - @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 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(): NewFloatingGroupedTieredPackagePrice = apply { - if (validated) { - return@apply - } - - cadence() - currency() - groupedTieredPackageConfig().validate() - itemId() - modelType() - name() - billableMetricId() - billedInAdvance() - billingCycleConfiguration().ifPresent { it.validate() } - conversionRate() - 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 currency: JsonField? = null - private var groupedTieredPackageConfig: JsonField? = - null - private var itemId: 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 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( - newFloatingGroupedTieredPackagePrice: NewFloatingGroupedTieredPackagePrice - ) = apply { - cadence = newFloatingGroupedTieredPackagePrice.cadence - currency = newFloatingGroupedTieredPackagePrice.currency - groupedTieredPackageConfig = - newFloatingGroupedTieredPackagePrice.groupedTieredPackageConfig - itemId = newFloatingGroupedTieredPackagePrice.itemId - modelType = newFloatingGroupedTieredPackagePrice.modelType - name = newFloatingGroupedTieredPackagePrice.name - billableMetricId = newFloatingGroupedTieredPackagePrice.billableMetricId - billedInAdvance = newFloatingGroupedTieredPackagePrice.billedInAdvance - billingCycleConfiguration = - newFloatingGroupedTieredPackagePrice.billingCycleConfiguration - conversionRate = newFloatingGroupedTieredPackagePrice.conversionRate - externalPriceId = newFloatingGroupedTieredPackagePrice.externalPriceId - fixedPriceQuantity = newFloatingGroupedTieredPackagePrice.fixedPriceQuantity - invoiceGroupingKey = newFloatingGroupedTieredPackagePrice.invoiceGroupingKey - invoicingCycleConfiguration = - newFloatingGroupedTieredPackagePrice.invoicingCycleConfiguration - metadata = newFloatingGroupedTieredPackagePrice.metadata - additionalProperties = - newFloatingGroupedTieredPackagePrice.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 } - - /** An ISO 4217 currency string for which this price is billed in. */ - fun currency(currency: String) = currency(JsonField.of(currency)) - - /** An ISO 4217 currency string for which this price is billed in. */ - fun currency(currency: JsonField) = apply { this.currency = currency } - - fun groupedTieredPackageConfig( - groupedTieredPackageConfig: GroupedTieredPackageConfig - ) = groupedTieredPackageConfig(JsonField.of(groupedTieredPackageConfig)) - - fun groupedTieredPackageConfig( - groupedTieredPackageConfig: JsonField - ) = apply { this.groupedTieredPackageConfig = groupedTieredPackageConfig } - - /** 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 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 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(): NewFloatingGroupedTieredPackagePrice = - NewFloatingGroupedTieredPackagePrice( - checkRequired("cadence", cadence), - checkRequired("currency", currency), - checkRequired("groupedTieredPackageConfig", groupedTieredPackageConfig), - checkRequired("itemId", itemId), - checkRequired("modelType", modelType), - checkRequired("name", name), - billableMetricId, - billedInAdvance, - billingCycleConfiguration, - conversionRate, - 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 GroupedTieredPackageConfig - @JsonCreator - private constructor( - @JsonAnySetter - private val additionalProperties: Map = immutableEmptyMap(), - ) { - - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = additionalProperties - - private var validated: Boolean = false - - fun validate(): GroupedTieredPackageConfig = 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(groupedTieredPackageConfig: GroupedTieredPackageConfig) = - apply { - additionalProperties = - groupedTieredPackageConfig.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(): GroupedTieredPackageConfig = - GroupedTieredPackageConfig(additionalProperties.toImmutable()) - } - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is GroupedTieredPackageConfig && 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() = - "GroupedTieredPackageConfig{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 GROUPED_TIERED_PACKAGE = of("grouped_tiered_package") - - @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) - } - - enum class Known { - GROUPED_TIERED_PACKAGE, - } - - enum class Value { - GROUPED_TIERED_PACKAGE, - _UNKNOWN, - } - - fun value(): Value = - when (this) { - GROUPED_TIERED_PACKAGE -> Value.GROUPED_TIERED_PACKAGE - else -> Value._UNKNOWN - } - - fun known(): Known = - when (this) { - GROUPED_TIERED_PACKAGE -> Known.GROUPED_TIERED_PACKAGE - 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( @@ -38014,6 +36740,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionPriceIntervalsResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionPriceIntervalsResponse.kt index 1ab49bec..e0ddd949 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionPriceIntervalsResponse.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionPriceIntervalsResponse.kt @@ -167,8 +167,8 @@ private constructor( * 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. + * identifier. See [Customer ID Aliases](/events-and-metrics/customer-aliases) for further + * information about how these aliases work in Orb. * * In addition to having an identifier in your system, a customer may exist in a payment * provider solution like Stripe. Use the `payment_provider_id` and the `payment_provider` enum @@ -176,8 +176,8 @@ private constructor( * * 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. */ fun customer(): Customer = customer.getRequired("customer") @@ -224,9 +224,9 @@ private constructor( fun netTerms(): Long = netTerms.getRequired("net_terms") /** - * 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). */ fun plan(): Plan = plan.getRequired("plan") @@ -306,8 +306,8 @@ private constructor( * 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. + * identifier. See [Customer ID Aliases](/events-and-metrics/customer-aliases) for further + * information about how these aliases work in Orb. * * In addition to having an identifier in your system, a customer may exist in a payment * provider solution like Stripe. Use the `payment_provider_id` and the `payment_provider` enum @@ -315,8 +315,8 @@ private constructor( * * 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. */ @JsonProperty("customer") @ExcludeMissing fun _customer(): JsonField = customer @@ -370,9 +370,9 @@ private constructor( @JsonProperty("net_terms") @ExcludeMissing fun _netTerms(): JsonField = netTerms /** - * 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). */ @JsonProperty("plan") @ExcludeMissing fun _plan(): JsonField = plan @@ -681,8 +681,8 @@ private constructor( * 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. + * identifier. See [Customer ID Aliases](/events-and-metrics/customer-aliases) for further + * information about how these aliases work in Orb. * * In addition to having an identifier in your system, a customer may exist in a payment * provider solution like Stripe. Use the `payment_provider_id` and the `payment_provider` @@ -690,8 +690,8 @@ private constructor( * * 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. + * account's timezone. See [Timezone localization](/essentials/timezones) for information on + * what this timezone parameter influences within Orb. */ fun customer(customer: Customer) = customer(JsonField.of(customer)) @@ -701,8 +701,8 @@ private constructor( * 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. + * identifier. See [Customer ID Aliases](/events-and-metrics/customer-aliases) for further + * information about how these aliases work in Orb. * * In addition to having an identifier in your system, a customer may exist in a payment * provider solution like Stripe. Use the `payment_provider_id` and the `payment_provider` @@ -710,8 +710,8 @@ private constructor( * * 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. + * account's timezone. See [Timezone localization](/essentials/timezones) for information on + * what this timezone parameter influences within Orb. */ fun customer(customer: JsonField) = apply { this.customer = customer } @@ -893,18 +893,16 @@ private constructor( fun netTerms(netTerms: JsonField) = apply { this.netTerms = netTerms } /** - * 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). */ fun plan(plan: Plan) = plan(JsonField.of(plan)) /** - * 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). */ fun plan(plan: JsonField) = apply { this.plan = plan } @@ -5388,224 +5386,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") @@ -5667,224 +5449,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 @@ -6090,224 +5656,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.of(price)) @@ -6320,224 +5670,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 } @@ -6550,224 +5684,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)) @@ -6780,224 +5698,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)) @@ -7010,224 +5712,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)) @@ -7240,224 +5726,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)) @@ -7470,224 +5740,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(tieredBpsPrice: Price.TieredBpsPrice) = price(Price.ofTieredBpsPrice(tieredBpsPrice)) @@ -7701,684 +5755,36 @@ 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" - * } - * ... - * } - * ``` + * 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. + * 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. * - * ```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" - * } - * ] - * } - * ... - * ``` + * 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. * - * ## 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)) @@ -8391,224 +5797,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)) @@ -8622,224 +5812,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)) @@ -8853,224 +5827,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)) @@ -9084,224 +5842,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)) @@ -9315,224 +5857,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)) @@ -9546,224 +5872,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)) @@ -9777,455 +5887,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)) @@ -10239,224 +5917,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)) @@ -10470,224 +5932,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)) @@ -10701,224 +5947,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)) @@ -10932,224 +5962,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)) @@ -11163,224 +5977,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)) @@ -11394,224 +5992,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)) @@ -11625,224 +6007,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)) @@ -11856,459 +6022,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)) - /** * The start date of the price interval. This is the date that Orb starts billing for * this price. diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionSchedulePlanChangeParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionSchedulePlanChangeParams.kt index 6d22cd68..8ae3a2f2 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionSchedulePlanChangeParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionSchedulePlanChangeParams.kt @@ -71,26 +71,26 @@ import kotlin.jvm.optionals.getOrNull * schedule the plan change. This is useful when a customer has prices that differ from the default * prices for a specific plan. * - * :::info This feature is only available for accounts that have migrated to Subscription Overrides + * This feature is only available for accounts that have migrated to Subscription Overrides * Version 2. You can find your Subscription Overrides Version at the bottom of your - * [Plans page](https://app.withorb.com/plans) ::: + * [Plans page](https://app.withorb.com/plans) * * ### Adding Prices * * To add prices, provide a list of objects with the key `add_prices`. An object in the list must * specify an existing add-on price with a `price_id` or `external_price_id` field, or create a new * add-on price by including an object with the key `price`, identical to what would be used in the - * request body for the [create price endpoint](../reference/create-price). See the - * [Price resource](../reference/price) for the specification of different price model - * configurations possible in this object. + * request body for the [create price endpoint](/api-reference/price/create-price). See the + * [Price resource](/product-catalog/price-configuration) for the specification of different price + * model configurations possible in this object. * * If the plan has phases, each object in the list must include a number with `plan_phase_order` key * to indicate which phase the price should be added to. * * An object in the list can specify an optional `start_date` and optional `end_date`. This is * equivalent to creating a price interval with the - * [add/edit price intervals endpoint](../reference/add-edit-price-intervals). If unspecified, the - * start or end date of the phase or subscription will be used. + * [add/edit price intervals endpoint](/api-reference/price-interval/add-or-edit-price-intervals). + * If unspecified, the start or end date of the phase or subscription will be used. * * An object in the list can specify an optional `minimum_amount`, `maximum_amount`, or `discounts`. * This will create adjustments which apply only to this price. @@ -111,12 +111,14 @@ import kotlin.jvm.optionals.getOrNull * price to replace it with by either referencing an existing add-on price with a `price_id` or * `external_price_id` field, or by creating a new add-on price by including an object with the key * `price`, identical to what would be used in the request body for the - * [create price endpoint](../reference/create-price). See the [Price resource](../reference/price) - * for the specification of different price model configurations possible in this object. + * [create price endpoint](/api-reference/price/create-price). See the + * [Price resource](/product-catalog/price-configuration) for the specification of different price + * model configurations possible in this object. * * For fixed fees, an object in the list can supply a `fixed_price_quantity` instead of a `price`, * `price_id`, or `external_price_id` field. This will update only the quantity for the price, - * similar to the [Update price quantity](../reference/update-fixed-fee-quantity) endpoint. + * similar to the [Update price quantity](/api-reference/subscription/update-price-quantity) + * endpoint. * * The replacement price will have the same phase, if applicable, and the same start and end dates * as the price it replaces. @@ -133,7 +135,7 @@ import kotlin.jvm.optionals.getOrNull * * To add adjustments, provide a list of objects with the key `add_adjustments`. An object in the * list must include an object with the key `adjustment`, identical to the adjustment object in the - * [add/edit price intervals endpoint](../reference/add-edit-price-intervals). + * [add/edit price intervals endpoint](/api-reference/price-interval/add-or-edit-price-intervals). * * If the plan has phases, each object in the list must include a number with `plan_phase_order` key * to indicate which phase the adjustment should be added to. @@ -152,16 +154,16 @@ import kotlin.jvm.optionals.getOrNull * in the list must specify a plan adjustment to replace with the `replaces_adjustment_id` key, and * it must specify an adjustment to replace it with by including an object with the key * `adjustment`, identical to the adjustment object in the - * [add/edit price intervals endpoint](../reference/add-edit-price-intervals). + * [add/edit price intervals endpoint](/api-reference/price-interval/add-or-edit-price-intervals). * * The replacement adjustment will have the same phase, if applicable, and the same start and end * dates as the adjustment it replaces. * * ## Price overrides (DEPRECATED) * - * :::info Price overrides are being phased out in favor adding/removing/replacing prices. (See - * [Customize your customer's subscriptions](../reference/schedule-plan-change#customize-your-customers-subscriptions)) - * ::: + * Price overrides are being phased out in favor adding/removing/replacing prices. (See + * [Customize your customer's subscriptions](/api-reference/subscription/schedule-plan-change)) + * * * Price overrides are used to update some or all prices in a plan for the specific subscription * being created. This is useful when a new customer has negotiated a rate that is unique to the @@ -169,9 +171,9 @@ import kotlin.jvm.optionals.getOrNull * * To override prices, provide a list of objects with the key `price_overrides`. The price object in * the list of overrides is expected to contain the existing price id, the `model_type` and - * configuration. (See the [Price resource](../reference/price) for the specification of different - * price model configurations.) The numerical values can be updated, but the billable metric, - * cadence, type, and name of a price can not be overridden. + * configuration. (See the [Price resource](/product-catalog/price-configuration) for the + * specification of different price model configurations.) The numerical values can be updated, but + * the billable metric, cadence, type, and name of a price can not be overridden. * * ### Maximums, and minimums * @@ -189,7 +191,7 @@ import kotlin.jvm.optionals.getOrNull * * By default, Orb calculates the prorated difference in any fixed fees when making a plan change, * adjusting the customer balance as needed. For details on this behavior, see - * [Modifying subscriptions](../guides/product-catalog/modifying-subscriptions.md#prorations-for-in-advance-fees). + * [Modifying subscriptions](/product-catalog/modifying-subscriptions#prorations-for-in-advance-fees). */ class SubscriptionSchedulePlanChangeParams constructor( @@ -239,8 +241,7 @@ constructor( /** * The date that the plan change should take effect. This parameter can only be passed if the - * `change_option` is `requested_date`. If a date with no time is passed, the plan change will - * happen at midnight in the customer's timezone. + * `change_option` is `requested_date`. */ fun changeDate(): Optional = body.changeDate() @@ -251,7 +252,7 @@ constructor( */ fun couponRedemptionCode(): Optional = body.couponRedemptionCode() - fun creditsOverageRate(): Optional = body.creditsOverageRate() + @Deprecated("deprecated") fun creditsOverageRate(): Optional = body.creditsOverageRate() /** * Determines the default memo on this subscription's invoices. Note that if this is not @@ -267,8 +268,8 @@ constructor( /** * An additional filter to apply to usage queries. This filter must be expressed as a boolean - * [computed property](../guides/extensibility/advanced-metrics#computed-properties). If null, - * usage queries will not include any additional filter. + * [computed property](/extensibility/advanced-metrics#computed-properties). If null, usage + * queries will not include any additional filter. */ fun filter(): Optional = body.filter() @@ -289,6 +290,7 @@ constructor( */ fun netTerms(): Optional = body.netTerms() + @Deprecated("deprecated") fun perCreditOverageAmount(): Optional = body.perCreditOverageAmount() /** @@ -303,6 +305,7 @@ constructor( fun planVersionNumber(): Optional = body.planVersionNumber() /** Optionally provide a list of overrides for prices on the plan */ + @Deprecated("deprecated") fun priceOverrides(): Optional> = body.priceOverrides() /** @@ -374,8 +377,7 @@ constructor( /** * The date that the plan change should take effect. This parameter can only be passed if the - * `change_option` is `requested_date`. If a date with no time is passed, the plan change will - * happen at midnight in the customer's timezone. + * `change_option` is `requested_date`. */ fun _changeDate(): JsonField = body._changeDate() @@ -386,6 +388,7 @@ constructor( */ fun _couponRedemptionCode(): JsonField = body._couponRedemptionCode() + @Deprecated("deprecated") fun _creditsOverageRate(): JsonField = body._creditsOverageRate() /** @@ -402,8 +405,8 @@ constructor( /** * An additional filter to apply to usage queries. This filter must be expressed as a boolean - * [computed property](../guides/extensibility/advanced-metrics#computed-properties). If null, - * usage queries will not include any additional filter. + * [computed property](/extensibility/advanced-metrics#computed-properties). If null, usage + * queries will not include any additional filter. */ fun _filter(): JsonField = body._filter() @@ -424,6 +427,7 @@ constructor( */ fun _netTerms(): JsonField = body._netTerms() + @Deprecated("deprecated") fun _perCreditOverageAmount(): JsonField = body._perCreditOverageAmount() /** @@ -438,6 +442,7 @@ constructor( fun _planVersionNumber(): JsonField = body._planVersionNumber() /** Optionally provide a list of overrides for prices on the plan */ + @Deprecated("deprecated") fun _priceOverrides(): JsonField> = body._priceOverrides() /** @@ -621,8 +626,7 @@ constructor( /** * The date that the plan change should take effect. This parameter can only be passed if - * the `change_option` is `requested_date`. If a date with no time is passed, the plan - * change will happen at midnight in the customer's timezone. + * the `change_option` is `requested_date`. */ fun changeDate(): Optional = Optional.ofNullable(changeDate.getNullable("change_date")) @@ -635,6 +639,7 @@ constructor( fun couponRedemptionCode(): Optional = Optional.ofNullable(couponRedemptionCode.getNullable("coupon_redemption_code")) + @Deprecated("deprecated") fun creditsOverageRate(): Optional = Optional.ofNullable(creditsOverageRate.getNullable("credits_overage_rate")) @@ -654,8 +659,7 @@ constructor( /** * An additional filter to apply to usage queries. This filter must be expressed as a - * boolean - * [computed property](../guides/extensibility/advanced-metrics#computed-properties). If + * boolean [computed property](/extensibility/advanced-metrics#computed-properties). If * null, usage queries will not include any additional filter. */ fun filter(): Optional = Optional.ofNullable(filter.getNullable("filter")) @@ -679,6 +683,7 @@ constructor( */ fun netTerms(): Optional = Optional.ofNullable(netTerms.getNullable("net_terms")) + @Deprecated("deprecated") fun perCreditOverageAmount(): Optional = Optional.ofNullable(perCreditOverageAmount.getNullable("per_credit_overage_amount")) @@ -696,6 +701,7 @@ constructor( Optional.ofNullable(planVersionNumber.getNullable("plan_version_number")) /** Optionally provide a list of overrides for prices on the plan */ + @Deprecated("deprecated") fun priceOverrides(): Optional> = Optional.ofNullable(priceOverrides.getNullable("price_overrides")) @@ -787,8 +793,7 @@ constructor( /** * The date that the plan change should take effect. This parameter can only be passed if - * the `change_option` is `requested_date`. If a date with no time is passed, the plan - * change will happen at midnight in the customer's timezone. + * the `change_option` is `requested_date`. */ @JsonProperty("change_date") @ExcludeMissing @@ -803,6 +808,7 @@ constructor( @ExcludeMissing fun _couponRedemptionCode(): JsonField = couponRedemptionCode + @Deprecated("deprecated") @JsonProperty("credits_overage_rate") @ExcludeMissing fun _creditsOverageRate(): JsonField = creditsOverageRate @@ -825,8 +831,7 @@ constructor( /** * An additional filter to apply to usage queries. This filter must be expressed as a - * boolean - * [computed property](../guides/extensibility/advanced-metrics#computed-properties). If + * boolean [computed property](/extensibility/advanced-metrics#computed-properties). If * null, usage queries will not include any additional filter. */ @JsonProperty("filter") @ExcludeMissing fun _filter(): JsonField = filter @@ -852,6 +857,7 @@ constructor( */ @JsonProperty("net_terms") @ExcludeMissing fun _netTerms(): JsonField = netTerms + @Deprecated("deprecated") @JsonProperty("per_credit_overage_amount") @ExcludeMissing fun _perCreditOverageAmount(): JsonField = perCreditOverageAmount @@ -871,6 +877,7 @@ constructor( fun _planVersionNumber(): JsonField = planVersionNumber /** Optionally provide a list of overrides for prices on the plan */ + @Deprecated("deprecated") @JsonProperty("price_overrides") @ExcludeMissing fun _priceOverrides(): JsonField> = priceOverrides @@ -1224,24 +1231,21 @@ constructor( /** * The date that the plan change should take effect. This parameter can only be passed - * if the `change_option` is `requested_date`. If a date with no time is passed, the - * plan change will happen at midnight in the customer's timezone. + * if the `change_option` is `requested_date`. */ fun changeDate(changeDate: OffsetDateTime?) = changeDate(JsonField.ofNullable(changeDate)) /** * The date that the plan change should take effect. This parameter can only be passed - * if the `change_option` is `requested_date`. If a date with no time is passed, the - * plan change will happen at midnight in the customer's timezone. + * if the `change_option` is `requested_date`. */ fun changeDate(changeDate: Optional) = changeDate(changeDate.orElse(null)) /** * The date that the plan change should take effect. This parameter can only be passed - * if the `change_option` is `requested_date`. If a date with no time is passed, the - * plan change will happen at midnight in the customer's timezone. + * if the `change_option` is `requested_date`. */ fun changeDate(changeDate: JsonField) = apply { this.changeDate = changeDate @@ -1272,16 +1276,20 @@ constructor( this.couponRedemptionCode = couponRedemptionCode } + @Deprecated("deprecated") fun creditsOverageRate(creditsOverageRate: Double?) = creditsOverageRate(JsonField.ofNullable(creditsOverageRate)) + @Deprecated("deprecated") fun creditsOverageRate(creditsOverageRate: Double) = creditsOverageRate(creditsOverageRate as Double?) + @Deprecated("deprecated") @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun creditsOverageRate(creditsOverageRate: Optional) = creditsOverageRate(creditsOverageRate.orElse(null) as Double?) + @Deprecated("deprecated") fun creditsOverageRate(creditsOverageRate: JsonField) = apply { this.creditsOverageRate = creditsOverageRate } @@ -1332,24 +1340,21 @@ constructor( /** * An additional filter to apply to usage queries. This filter must be expressed as a - * boolean - * [computed property](../guides/extensibility/advanced-metrics#computed-properties). If + * boolean [computed property](/extensibility/advanced-metrics#computed-properties). If * null, usage queries will not include any additional filter. */ fun filter(filter: String?) = filter(JsonField.ofNullable(filter)) /** * An additional filter to apply to usage queries. This filter must be expressed as a - * boolean - * [computed property](../guides/extensibility/advanced-metrics#computed-properties). If + * boolean [computed property](/extensibility/advanced-metrics#computed-properties). If * null, usage queries will not include any additional filter. */ fun filter(filter: Optional) = filter(filter.orElse(null)) /** * An additional filter to apply to usage queries. This filter must be expressed as a - * boolean - * [computed property](../guides/extensibility/advanced-metrics#computed-properties). If + * boolean [computed property](/extensibility/advanced-metrics#computed-properties). If * null, usage queries will not include any additional filter. */ fun filter(filter: JsonField) = apply { this.filter = filter } @@ -1426,16 +1431,20 @@ constructor( */ fun netTerms(netTerms: JsonField) = apply { this.netTerms = netTerms } + @Deprecated("deprecated") fun perCreditOverageAmount(perCreditOverageAmount: Double?) = perCreditOverageAmount(JsonField.ofNullable(perCreditOverageAmount)) + @Deprecated("deprecated") fun perCreditOverageAmount(perCreditOverageAmount: Double) = perCreditOverageAmount(perCreditOverageAmount as Double?) + @Deprecated("deprecated") @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun perCreditOverageAmount(perCreditOverageAmount: Optional) = perCreditOverageAmount(perCreditOverageAmount.orElse(null) as Double?) + @Deprecated("deprecated") fun perCreditOverageAmount(perCreditOverageAmount: JsonField) = apply { this.perCreditOverageAmount = perCreditOverageAmount } @@ -1489,19 +1498,23 @@ constructor( } /** Optionally provide a list of overrides for prices on the plan */ + @Deprecated("deprecated") fun priceOverrides(priceOverrides: List?) = priceOverrides(JsonField.ofNullable(priceOverrides)) /** Optionally provide a list of overrides for prices on the plan */ + @Deprecated("deprecated") fun priceOverrides(priceOverrides: Optional>) = priceOverrides(priceOverrides.orElse(null)) /** Optionally provide a list of overrides for prices on the plan */ + @Deprecated("deprecated") fun priceOverrides(priceOverrides: JsonField>) = apply { this.priceOverrides = priceOverrides.map { it.toMutableList() } } /** Optionally provide a list of overrides for prices on the plan */ + @Deprecated("deprecated") fun addPriceOverride(priceOverride: JsonValue) = apply { priceOverrides = (priceOverrides ?: JsonField.of(mutableListOf())).apply { @@ -1963,22 +1976,19 @@ constructor( /** * The date that the plan change should take effect. This parameter can only be passed if - * the `change_option` is `requested_date`. If a date with no time is passed, the plan - * change will happen at midnight in the customer's timezone. + * the `change_option` is `requested_date`. */ fun changeDate(changeDate: OffsetDateTime?) = apply { body.changeDate(changeDate) } /** * The date that the plan change should take effect. This parameter can only be passed if - * the `change_option` is `requested_date`. If a date with no time is passed, the plan - * change will happen at midnight in the customer's timezone. + * the `change_option` is `requested_date`. */ fun changeDate(changeDate: Optional) = changeDate(changeDate.orElse(null)) /** * The date that the plan change should take effect. This parameter can only be passed if - * the `change_option` is `requested_date`. If a date with no time is passed, the plan - * change will happen at midnight in the customer's timezone. + * the `change_option` is `requested_date`. */ fun changeDate(changeDate: JsonField) = apply { body.changeDate(changeDate) @@ -2010,17 +2020,21 @@ constructor( body.couponRedemptionCode(couponRedemptionCode) } + @Deprecated("deprecated") fun creditsOverageRate(creditsOverageRate: Double?) = apply { body.creditsOverageRate(creditsOverageRate) } + @Deprecated("deprecated") fun creditsOverageRate(creditsOverageRate: Double) = creditsOverageRate(creditsOverageRate as Double?) + @Deprecated("deprecated") @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun creditsOverageRate(creditsOverageRate: Optional) = creditsOverageRate(creditsOverageRate.orElse(null) as Double?) + @Deprecated("deprecated") fun creditsOverageRate(creditsOverageRate: JsonField) = apply { body.creditsOverageRate(creditsOverageRate) } @@ -2071,24 +2085,21 @@ constructor( /** * An additional filter to apply to usage queries. This filter must be expressed as a - * boolean - * [computed property](../guides/extensibility/advanced-metrics#computed-properties). If + * boolean [computed property](/extensibility/advanced-metrics#computed-properties). If * null, usage queries will not include any additional filter. */ fun filter(filter: String?) = apply { body.filter(filter) } /** * An additional filter to apply to usage queries. This filter must be expressed as a - * boolean - * [computed property](../guides/extensibility/advanced-metrics#computed-properties). If + * boolean [computed property](/extensibility/advanced-metrics#computed-properties). If * null, usage queries will not include any additional filter. */ fun filter(filter: Optional) = filter(filter.orElse(null)) /** * An additional filter to apply to usage queries. This filter must be expressed as a - * boolean - * [computed property](../guides/extensibility/advanced-metrics#computed-properties). If + * boolean [computed property](/extensibility/advanced-metrics#computed-properties). If * null, usage queries will not include any additional filter. */ fun filter(filter: JsonField) = apply { body.filter(filter) } @@ -2167,17 +2178,21 @@ constructor( */ fun netTerms(netTerms: JsonField) = apply { body.netTerms(netTerms) } + @Deprecated("deprecated") fun perCreditOverageAmount(perCreditOverageAmount: Double?) = apply { body.perCreditOverageAmount(perCreditOverageAmount) } + @Deprecated("deprecated") fun perCreditOverageAmount(perCreditOverageAmount: Double) = perCreditOverageAmount(perCreditOverageAmount as Double?) + @Deprecated("deprecated") @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun perCreditOverageAmount(perCreditOverageAmount: Optional) = perCreditOverageAmount(perCreditOverageAmount.orElse(null) as Double?) + @Deprecated("deprecated") fun perCreditOverageAmount(perCreditOverageAmount: JsonField) = apply { body.perCreditOverageAmount(perCreditOverageAmount) } @@ -2232,20 +2247,24 @@ constructor( } /** Optionally provide a list of overrides for prices on the plan */ + @Deprecated("deprecated") fun priceOverrides(priceOverrides: List?) = apply { body.priceOverrides(priceOverrides) } /** Optionally provide a list of overrides for prices on the plan */ + @Deprecated("deprecated") fun priceOverrides(priceOverrides: Optional>) = priceOverrides(priceOverrides.orElse(null)) /** Optionally provide a list of overrides for prices on the plan */ + @Deprecated("deprecated") fun priceOverrides(priceOverrides: JsonField>) = apply { body.priceOverrides(priceOverrides) } /** Optionally provide a list of overrides for prices on the plan */ + @Deprecated("deprecated") fun addPriceOverride(priceOverride: JsonValue) = apply { body.addPriceOverride(priceOverride) } @@ -4404,6 +4423,7 @@ constructor( /** * [DEPRECATED] Use add_adjustments instead. The subscription's discounts for this price. */ + @Deprecated("deprecated") fun discounts(): Optional> = Optional.ofNullable(discounts.getNullable("discounts")) @@ -4422,6 +4442,7 @@ constructor( * [DEPRECATED] Use add_adjustments instead. The subscription's maximum amount for this * price. */ + @Deprecated("deprecated") fun maximumAmount(): Optional = Optional.ofNullable(maximumAmount.getNullable("maximum_amount")) @@ -4429,6 +4450,7 @@ constructor( * [DEPRECATED] Use add_adjustments instead. The subscription's minimum amount for this * price. */ + @Deprecated("deprecated") fun minimumAmount(): Optional = Optional.ofNullable(minimumAmount.getNullable("minimum_amount")) @@ -4452,6 +4474,7 @@ constructor( /** * [DEPRECATED] Use add_adjustments instead. The subscription's discounts for this price. */ + @Deprecated("deprecated") @JsonProperty("discounts") @ExcludeMissing fun _discounts(): JsonField> = discounts @@ -4473,6 +4496,7 @@ constructor( * [DEPRECATED] Use add_adjustments instead. The subscription's maximum amount for this * price. */ + @Deprecated("deprecated") @JsonProperty("maximum_amount") @ExcludeMissing fun _maximumAmount(): JsonField = maximumAmount @@ -4481,6 +4505,7 @@ constructor( * [DEPRECATED] Use add_adjustments instead. The subscription's minimum amount for this * price. */ + @Deprecated("deprecated") @JsonProperty("minimum_amount") @ExcludeMissing fun _minimumAmount(): JsonField = minimumAmount @@ -4565,18 +4590,21 @@ constructor( * [DEPRECATED] Use add_adjustments instead. The subscription's discounts for this * price. */ + @Deprecated("deprecated") fun discounts(discounts: List?) = discounts(JsonField.ofNullable(discounts)) /** * [DEPRECATED] Use add_adjustments instead. The subscription's discounts for this * price. */ + @Deprecated("deprecated") fun discounts(discounts: Optional>) = discounts(discounts.orElse(null)) /** * [DEPRECATED] Use add_adjustments instead. The subscription's discounts for this * price. */ + @Deprecated("deprecated") fun discounts(discounts: JsonField>) = apply { this.discounts = discounts.map { it.toMutableList() } } @@ -4585,6 +4613,7 @@ constructor( * [DEPRECATED] Use add_adjustments instead. The subscription's discounts for this * price. */ + @Deprecated("deprecated") fun addDiscount(discount: Discount) = apply { discounts = (discounts ?: JsonField.of(mutableListOf())).apply { @@ -4633,6 +4662,7 @@ constructor( * [DEPRECATED] Use add_adjustments instead. The subscription's maximum amount for this * price. */ + @Deprecated("deprecated") fun maximumAmount(maximumAmount: String?) = maximumAmount(JsonField.ofNullable(maximumAmount)) @@ -4640,6 +4670,7 @@ constructor( * [DEPRECATED] Use add_adjustments instead. The subscription's maximum amount for this * price. */ + @Deprecated("deprecated") fun maximumAmount(maximumAmount: Optional) = maximumAmount(maximumAmount.orElse(null)) @@ -4647,6 +4678,7 @@ constructor( * [DEPRECATED] Use add_adjustments instead. The subscription's maximum amount for this * price. */ + @Deprecated("deprecated") fun maximumAmount(maximumAmount: JsonField) = apply { this.maximumAmount = maximumAmount } @@ -4655,6 +4687,7 @@ constructor( * [DEPRECATED] Use add_adjustments instead. The subscription's minimum amount for this * price. */ + @Deprecated("deprecated") fun minimumAmount(minimumAmount: String?) = minimumAmount(JsonField.ofNullable(minimumAmount)) @@ -4662,6 +4695,7 @@ constructor( * [DEPRECATED] Use add_adjustments instead. The subscription's minimum amount for this * price. */ + @Deprecated("deprecated") fun minimumAmount(minimumAmount: Optional) = minimumAmount(minimumAmount.orElse(null)) @@ -4669,6 +4703,7 @@ constructor( * [DEPRECATED] Use add_adjustments instead. The subscription's minimum amount for this * price. */ + @Deprecated("deprecated") fun minimumAmount(minimumAmount: JsonField) = apply { this.minimumAmount = minimumAmount } @@ -6788,6 +6823,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -7148,6 +7184,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -7344,6 +7381,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -8176,6 +8214,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -8572,6 +8611,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -8768,6 +8808,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -9600,6 +9641,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -10226,6 +10268,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -10422,6 +10465,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -11254,6 +11298,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -11818,6 +11863,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -12014,6 +12060,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -12848,6 +12895,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -13425,6 +13473,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -13621,6 +13670,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -14584,6 +14634,7 @@ constructor( "BpsConfig{bps=$bps, perUnitMaximum=$perUnitMaximum, additionalProperties=$additionalProperties}" } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -14836,6 +14887,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -15032,6 +15084,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -16164,6 +16217,7 @@ constructor( "BulkBpsConfig{tiers=$tiers, additionalProperties=$additionalProperties}" } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -16416,6 +16470,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -16612,6 +16667,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -17710,6 +17766,7 @@ constructor( "BulkConfig{tiers=$tiers, additionalProperties=$additionalProperties}" } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -17962,6 +18019,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -18158,6 +18216,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -19001,6 +19060,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -19338,6 +19398,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -19534,6 +19595,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -20369,6 +20431,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -20705,6 +20768,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -20901,6 +20965,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -21741,6 +21806,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -22078,6 +22144,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -22274,6 +22341,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -23111,6 +23179,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -23447,6 +23516,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -23643,6 +23713,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -24491,6 +24562,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -24829,6 +24901,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -25025,6 +25098,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -25867,6 +25941,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -26204,6 +26279,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -26400,6 +26476,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -27240,6 +27317,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -27577,6 +27655,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -27773,6 +27852,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -28613,6 +28693,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -28950,6 +29031,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -29146,6 +29228,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -30008,6 +30091,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -30347,6 +30431,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -30543,6 +30628,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -31468,6 +31554,7 @@ constructor( "BulkWithProrationConfig{additionalProperties=$additionalProperties}" } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -31720,6 +31807,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -31916,6 +32004,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -32116,6 +32205,10 @@ constructor( "AddPrice{discounts=$discounts, endDate=$endDate, externalPriceId=$externalPriceId, maximumAmount=$maximumAmount, minimumAmount=$minimumAmount, planPhaseOrder=$planPhaseOrder, price=$price, priceId=$priceId, startDate=$startDate, additionalProperties=$additionalProperties}" } + /** + * Reset billing periods to be aligned with the plan change's effective date or start of the + * month. Defaults to `unchanged` which keeps subscription's existing billing cycle alignment. + */ class BillingCycleAlignment @JsonCreator private constructor( @@ -34334,6 +34427,7 @@ constructor( * [DEPRECATED] Use add_adjustments instead. The subscription's discounts for the * replacement price. */ + @Deprecated("deprecated") fun discounts(): Optional> = Optional.ofNullable(discounts.getNullable("discounts")) @@ -34349,6 +34443,7 @@ constructor( * [DEPRECATED] Use add_adjustments instead. The subscription's maximum amount for the * replacement price. */ + @Deprecated("deprecated") fun maximumAmount(): Optional = Optional.ofNullable(maximumAmount.getNullable("maximum_amount")) @@ -34356,6 +34451,7 @@ constructor( * [DEPRECATED] Use add_adjustments instead. The subscription's minimum amount for the * replacement price. */ + @Deprecated("deprecated") fun minimumAmount(): Optional = Optional.ofNullable(minimumAmount.getNullable("minimum_amount")) @@ -34374,6 +34470,7 @@ constructor( * [DEPRECATED] Use add_adjustments instead. The subscription's discounts for the * replacement price. */ + @Deprecated("deprecated") @JsonProperty("discounts") @ExcludeMissing fun _discounts(): JsonField> = discounts @@ -34392,6 +34489,7 @@ constructor( * [DEPRECATED] Use add_adjustments instead. The subscription's maximum amount for the * replacement price. */ + @Deprecated("deprecated") @JsonProperty("maximum_amount") @ExcludeMissing fun _maximumAmount(): JsonField = maximumAmount @@ -34400,6 +34498,7 @@ constructor( * [DEPRECATED] Use add_adjustments instead. The subscription's minimum amount for the * replacement price. */ + @Deprecated("deprecated") @JsonProperty("minimum_amount") @ExcludeMissing fun _minimumAmount(): JsonField = minimumAmount @@ -34477,18 +34576,21 @@ constructor( * [DEPRECATED] Use add_adjustments instead. The subscription's discounts for the * replacement price. */ + @Deprecated("deprecated") fun discounts(discounts: List?) = discounts(JsonField.ofNullable(discounts)) /** * [DEPRECATED] Use add_adjustments instead. The subscription's discounts for the * replacement price. */ + @Deprecated("deprecated") fun discounts(discounts: Optional>) = discounts(discounts.orElse(null)) /** * [DEPRECATED] Use add_adjustments instead. The subscription's discounts for the * replacement price. */ + @Deprecated("deprecated") fun discounts(discounts: JsonField>) = apply { this.discounts = discounts.map { it.toMutableList() } } @@ -34497,6 +34599,7 @@ constructor( * [DEPRECATED] Use add_adjustments instead. The subscription's discounts for the * replacement price. */ + @Deprecated("deprecated") fun addDiscount(discount: Discount) = apply { discounts = (discounts ?: JsonField.of(mutableListOf())).apply { @@ -34545,6 +34648,7 @@ constructor( * [DEPRECATED] Use add_adjustments instead. The subscription's maximum amount for the * replacement price. */ + @Deprecated("deprecated") fun maximumAmount(maximumAmount: String?) = maximumAmount(JsonField.ofNullable(maximumAmount)) @@ -34552,6 +34656,7 @@ constructor( * [DEPRECATED] Use add_adjustments instead. The subscription's maximum amount for the * replacement price. */ + @Deprecated("deprecated") fun maximumAmount(maximumAmount: Optional) = maximumAmount(maximumAmount.orElse(null)) @@ -34559,6 +34664,7 @@ constructor( * [DEPRECATED] Use add_adjustments instead. The subscription's maximum amount for the * replacement price. */ + @Deprecated("deprecated") fun maximumAmount(maximumAmount: JsonField) = apply { this.maximumAmount = maximumAmount } @@ -34567,6 +34673,7 @@ constructor( * [DEPRECATED] Use add_adjustments instead. The subscription's minimum amount for the * replacement price. */ + @Deprecated("deprecated") fun minimumAmount(minimumAmount: String?) = minimumAmount(JsonField.ofNullable(minimumAmount)) @@ -34574,6 +34681,7 @@ constructor( * [DEPRECATED] Use add_adjustments instead. The subscription's minimum amount for the * replacement price. */ + @Deprecated("deprecated") fun minimumAmount(minimumAmount: Optional) = minimumAmount(minimumAmount.orElse(null)) @@ -34581,6 +34689,7 @@ constructor( * [DEPRECATED] Use add_adjustments instead. The subscription's minimum amount for the * replacement price. */ + @Deprecated("deprecated") fun minimumAmount(minimumAmount: JsonField) = apply { this.minimumAmount = minimumAmount } @@ -36659,6 +36768,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -37019,6 +37129,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -37215,6 +37326,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -38047,6 +38159,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -38443,6 +38556,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -38639,6 +38753,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -39471,6 +39586,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -40097,6 +40213,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -40293,6 +40410,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -41125,6 +41243,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -41689,6 +41808,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -41885,6 +42005,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -42719,6 +42840,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -43296,6 +43418,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -43492,6 +43615,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -44455,6 +44579,7 @@ constructor( "BpsConfig{bps=$bps, perUnitMaximum=$perUnitMaximum, additionalProperties=$additionalProperties}" } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -44707,6 +44832,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -44903,6 +45029,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -46035,6 +46162,7 @@ constructor( "BulkBpsConfig{tiers=$tiers, additionalProperties=$additionalProperties}" } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -46287,6 +46415,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -46483,6 +46612,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -47581,6 +47711,7 @@ constructor( "BulkConfig{tiers=$tiers, additionalProperties=$additionalProperties}" } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -47833,6 +47964,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -48029,6 +48161,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -48872,6 +49005,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -49209,6 +49343,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -49405,6 +49540,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -50240,6 +50376,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -50576,6 +50713,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -50772,6 +50910,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -51612,6 +51751,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -51949,6 +52089,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -52145,6 +52286,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -52982,6 +53124,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -53318,6 +53461,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -53514,6 +53658,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -54362,6 +54507,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -54700,6 +54846,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -54896,6 +55043,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -55738,6 +55886,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -56075,6 +56224,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -56271,6 +56421,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -57111,6 +57262,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -57448,6 +57600,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -57644,6 +57797,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -58484,6 +58638,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -58821,6 +58976,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -59017,6 +59173,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -59879,6 +60036,7 @@ constructor( ) } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -60218,6 +60376,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -60414,6 +60573,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -61339,6 +61499,7 @@ constructor( "BulkWithProrationConfig{additionalProperties=$additionalProperties}" } + /** The cadence to bill for this price on. */ class Cadence @JsonCreator private constructor( @@ -61591,6 +61752,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( @@ -61787,6 +61949,7 @@ constructor( ) } + /** The unit of billing period duration. */ class DurationUnit @JsonCreator private constructor( diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionSchedulePlanChangeResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionSchedulePlanChangeResponse.kt index 0dbf0fda..da1c8681 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionSchedulePlanChangeResponse.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionSchedulePlanChangeResponse.kt @@ -167,8 +167,8 @@ private constructor( * 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. + * identifier. See [Customer ID Aliases](/events-and-metrics/customer-aliases) for further + * information about how these aliases work in Orb. * * In addition to having an identifier in your system, a customer may exist in a payment * provider solution like Stripe. Use the `payment_provider_id` and the `payment_provider` enum @@ -176,8 +176,8 @@ private constructor( * * 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. */ fun customer(): Customer = customer.getRequired("customer") @@ -224,9 +224,9 @@ private constructor( fun netTerms(): Long = netTerms.getRequired("net_terms") /** - * 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). */ fun plan(): Plan = plan.getRequired("plan") @@ -306,8 +306,8 @@ private constructor( * 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. + * identifier. See [Customer ID Aliases](/events-and-metrics/customer-aliases) for further + * information about how these aliases work in Orb. * * In addition to having an identifier in your system, a customer may exist in a payment * provider solution like Stripe. Use the `payment_provider_id` and the `payment_provider` enum @@ -315,8 +315,8 @@ private constructor( * * 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. */ @JsonProperty("customer") @ExcludeMissing fun _customer(): JsonField = customer @@ -370,9 +370,9 @@ private constructor( @JsonProperty("net_terms") @ExcludeMissing fun _netTerms(): JsonField = netTerms /** - * 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). */ @JsonProperty("plan") @ExcludeMissing fun _plan(): JsonField = plan @@ -682,8 +682,8 @@ private constructor( * 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. + * identifier. See [Customer ID Aliases](/events-and-metrics/customer-aliases) for further + * information about how these aliases work in Orb. * * In addition to having an identifier in your system, a customer may exist in a payment * provider solution like Stripe. Use the `payment_provider_id` and the `payment_provider` @@ -691,8 +691,8 @@ private constructor( * * 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. + * account's timezone. See [Timezone localization](/essentials/timezones) for information on + * what this timezone parameter influences within Orb. */ fun customer(customer: Customer) = customer(JsonField.of(customer)) @@ -702,8 +702,8 @@ private constructor( * 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. + * identifier. See [Customer ID Aliases](/events-and-metrics/customer-aliases) for further + * information about how these aliases work in Orb. * * In addition to having an identifier in your system, a customer may exist in a payment * provider solution like Stripe. Use the `payment_provider_id` and the `payment_provider` @@ -711,8 +711,8 @@ private constructor( * * 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. + * account's timezone. See [Timezone localization](/essentials/timezones) for information on + * what this timezone parameter influences within Orb. */ fun customer(customer: JsonField) = apply { this.customer = customer } @@ -894,18 +894,16 @@ private constructor( fun netTerms(netTerms: JsonField) = apply { this.netTerms = netTerms } /** - * 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). */ fun plan(plan: Plan) = plan(JsonField.of(plan)) /** - * 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). */ fun plan(plan: JsonField) = apply { this.plan = plan } @@ -5389,224 +5387,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") @@ -5668,224 +5450,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 @@ -6091,224 +5657,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.of(price)) @@ -6321,224 +5671,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 } @@ -6551,224 +5685,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)) @@ -6781,224 +5699,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)) @@ -7011,224 +5713,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)) @@ -7241,224 +5727,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)) @@ -7471,224 +5741,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(tieredBpsPrice: Price.TieredBpsPrice) = price(Price.ofTieredBpsPrice(tieredBpsPrice)) @@ -7702,684 +5756,36 @@ 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" - * } - * ... - * } - * ``` + * 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. + * 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. * - * ```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" - * } - * ] - * } - * ... - * ``` + * 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. * - * ## 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)) @@ -8392,224 +5798,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)) @@ -8623,224 +5813,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)) @@ -8854,224 +5828,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)) @@ -9085,224 +5843,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)) @@ -9316,224 +5858,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)) @@ -9547,224 +5873,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)) @@ -9778,455 +5888,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)) @@ -10240,224 +5918,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)) @@ -10471,224 +5933,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)) @@ -10702,224 +5948,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)) @@ -10933,224 +5963,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)) @@ -11164,224 +5978,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)) @@ -11395,224 +5993,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)) @@ -11626,224 +6008,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)) @@ -11857,459 +6023,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)) - /** * The start date of the price interval. This is the date that Orb starts billing for * this price. diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionTriggerPhaseResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionTriggerPhaseResponse.kt index b4628bcc..da003433 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionTriggerPhaseResponse.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionTriggerPhaseResponse.kt @@ -167,8 +167,8 @@ private constructor( * 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. + * identifier. See [Customer ID Aliases](/events-and-metrics/customer-aliases) for further + * information about how these aliases work in Orb. * * In addition to having an identifier in your system, a customer may exist in a payment * provider solution like Stripe. Use the `payment_provider_id` and the `payment_provider` enum @@ -176,8 +176,8 @@ private constructor( * * 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. */ fun customer(): Customer = customer.getRequired("customer") @@ -224,9 +224,9 @@ private constructor( fun netTerms(): Long = netTerms.getRequired("net_terms") /** - * 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). */ fun plan(): Plan = plan.getRequired("plan") @@ -306,8 +306,8 @@ private constructor( * 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. + * identifier. See [Customer ID Aliases](/events-and-metrics/customer-aliases) for further + * information about how these aliases work in Orb. * * In addition to having an identifier in your system, a customer may exist in a payment * provider solution like Stripe. Use the `payment_provider_id` and the `payment_provider` enum @@ -315,8 +315,8 @@ private constructor( * * 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. */ @JsonProperty("customer") @ExcludeMissing fun _customer(): JsonField = customer @@ -370,9 +370,9 @@ private constructor( @JsonProperty("net_terms") @ExcludeMissing fun _netTerms(): JsonField = netTerms /** - * 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). */ @JsonProperty("plan") @ExcludeMissing fun _plan(): JsonField = plan @@ -679,8 +679,8 @@ private constructor( * 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. + * identifier. See [Customer ID Aliases](/events-and-metrics/customer-aliases) for further + * information about how these aliases work in Orb. * * In addition to having an identifier in your system, a customer may exist in a payment * provider solution like Stripe. Use the `payment_provider_id` and the `payment_provider` @@ -688,8 +688,8 @@ private constructor( * * 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. + * account's timezone. See [Timezone localization](/essentials/timezones) for information on + * what this timezone parameter influences within Orb. */ fun customer(customer: Customer) = customer(JsonField.of(customer)) @@ -699,8 +699,8 @@ private constructor( * 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. + * identifier. See [Customer ID Aliases](/events-and-metrics/customer-aliases) for further + * information about how these aliases work in Orb. * * In addition to having an identifier in your system, a customer may exist in a payment * provider solution like Stripe. Use the `payment_provider_id` and the `payment_provider` @@ -708,8 +708,8 @@ private constructor( * * 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. + * account's timezone. See [Timezone localization](/essentials/timezones) for information on + * what this timezone parameter influences within Orb. */ fun customer(customer: JsonField) = apply { this.customer = customer } @@ -891,18 +891,16 @@ private constructor( fun netTerms(netTerms: JsonField) = apply { this.netTerms = netTerms } /** - * 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). */ fun plan(plan: Plan) = plan(JsonField.of(plan)) /** - * 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). */ fun plan(plan: JsonField) = apply { this.plan = plan } @@ -5386,224 +5384,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") @@ -5665,224 +5447,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 @@ -6088,224 +5654,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.of(price)) @@ -6318,224 +5668,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 } @@ -6548,224 +5682,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)) @@ -6778,224 +5696,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)) @@ -7008,224 +5710,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)) @@ -7238,224 +5724,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)) @@ -7468,224 +5738,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(tieredBpsPrice: Price.TieredBpsPrice) = price(Price.ofTieredBpsPrice(tieredBpsPrice)) @@ -7699,684 +5753,36 @@ 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" - * } - * ... - * } - * ``` + * 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. + * 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. * - * ```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" - * } - * ] - * } - * ... - * ``` + * 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. * - * ## 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)) @@ -8389,224 +5795,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)) @@ -8620,224 +5810,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)) @@ -8851,224 +5825,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)) @@ -9082,224 +5840,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)) @@ -9313,224 +5855,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)) @@ -9544,224 +5870,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)) @@ -9775,455 +5885,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)) @@ -10237,224 +5915,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)) @@ -10468,224 +5930,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)) @@ -10699,224 +5945,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)) @@ -10930,224 +5960,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)) @@ -11161,224 +5975,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)) @@ -11392,224 +5990,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)) @@ -11623,224 +6005,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)) @@ -11854,459 +6020,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)) - /** * The start date of the price interval. This is the date that Orb starts billing for * this price. diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUnscheduleCancellationResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUnscheduleCancellationResponse.kt index 1432b553..7cdc8140 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUnscheduleCancellationResponse.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUnscheduleCancellationResponse.kt @@ -167,8 +167,8 @@ private constructor( * 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. + * identifier. See [Customer ID Aliases](/events-and-metrics/customer-aliases) for further + * information about how these aliases work in Orb. * * In addition to having an identifier in your system, a customer may exist in a payment * provider solution like Stripe. Use the `payment_provider_id` and the `payment_provider` enum @@ -176,8 +176,8 @@ private constructor( * * 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. */ fun customer(): Customer = customer.getRequired("customer") @@ -224,9 +224,9 @@ private constructor( fun netTerms(): Long = netTerms.getRequired("net_terms") /** - * 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). */ fun plan(): Plan = plan.getRequired("plan") @@ -306,8 +306,8 @@ private constructor( * 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. + * identifier. See [Customer ID Aliases](/events-and-metrics/customer-aliases) for further + * information about how these aliases work in Orb. * * In addition to having an identifier in your system, a customer may exist in a payment * provider solution like Stripe. Use the `payment_provider_id` and the `payment_provider` enum @@ -315,8 +315,8 @@ private constructor( * * 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. */ @JsonProperty("customer") @ExcludeMissing fun _customer(): JsonField = customer @@ -370,9 +370,9 @@ private constructor( @JsonProperty("net_terms") @ExcludeMissing fun _netTerms(): JsonField = netTerms /** - * 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). */ @JsonProperty("plan") @ExcludeMissing fun _plan(): JsonField = plan @@ -688,8 +688,8 @@ private constructor( * 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. + * identifier. See [Customer ID Aliases](/events-and-metrics/customer-aliases) for further + * information about how these aliases work in Orb. * * In addition to having an identifier in your system, a customer may exist in a payment * provider solution like Stripe. Use the `payment_provider_id` and the `payment_provider` @@ -697,8 +697,8 @@ private constructor( * * 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. + * account's timezone. See [Timezone localization](/essentials/timezones) for information on + * what this timezone parameter influences within Orb. */ fun customer(customer: Customer) = customer(JsonField.of(customer)) @@ -708,8 +708,8 @@ private constructor( * 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. + * identifier. See [Customer ID Aliases](/events-and-metrics/customer-aliases) for further + * information about how these aliases work in Orb. * * In addition to having an identifier in your system, a customer may exist in a payment * provider solution like Stripe. Use the `payment_provider_id` and the `payment_provider` @@ -717,8 +717,8 @@ private constructor( * * 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. + * account's timezone. See [Timezone localization](/essentials/timezones) for information on + * what this timezone parameter influences within Orb. */ fun customer(customer: JsonField) = apply { this.customer = customer } @@ -900,18 +900,16 @@ private constructor( fun netTerms(netTerms: JsonField) = apply { this.netTerms = netTerms } /** - * 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). */ fun plan(plan: Plan) = plan(JsonField.of(plan)) /** - * 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). */ fun plan(plan: JsonField) = apply { this.plan = plan } @@ -5395,224 +5393,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") @@ -5674,224 +5456,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 @@ -6097,224 +5663,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.of(price)) @@ -6327,224 +5677,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 } @@ -6557,224 +5691,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)) @@ -6787,224 +5705,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)) @@ -7017,224 +5719,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)) @@ -7247,224 +5733,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)) @@ -7477,224 +5747,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(tieredBpsPrice: Price.TieredBpsPrice) = price(Price.ofTieredBpsPrice(tieredBpsPrice)) @@ -7708,684 +5762,36 @@ 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" - * } - * ... - * } - * ``` + * 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. + * 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. * - * ```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" - * } - * ] - * } - * ... - * ``` + * 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. * - * ## 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)) @@ -8398,224 +5804,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)) @@ -8629,224 +5819,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)) @@ -8860,224 +5834,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)) @@ -9091,224 +5849,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)) @@ -9322,224 +5864,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)) @@ -9553,224 +5879,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)) @@ -9784,455 +5894,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)) @@ -10246,224 +5924,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)) @@ -10477,224 +5939,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)) @@ -10708,224 +5954,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)) @@ -10939,224 +5969,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)) @@ -11170,224 +5984,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)) @@ -11401,224 +5999,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)) @@ -11632,224 +6014,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)) @@ -11863,459 +6029,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)) - /** * The start date of the price interval. This is the date that Orb starts billing for * this price. diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse.kt index e1d6f61c..48bfe11d 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse.kt @@ -167,8 +167,8 @@ private constructor( * 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. + * identifier. See [Customer ID Aliases](/events-and-metrics/customer-aliases) for further + * information about how these aliases work in Orb. * * In addition to having an identifier in your system, a customer may exist in a payment * provider solution like Stripe. Use the `payment_provider_id` and the `payment_provider` enum @@ -176,8 +176,8 @@ private constructor( * * 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. */ fun customer(): Customer = customer.getRequired("customer") @@ -224,9 +224,9 @@ private constructor( fun netTerms(): Long = netTerms.getRequired("net_terms") /** - * 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). */ fun plan(): Plan = plan.getRequired("plan") @@ -306,8 +306,8 @@ private constructor( * 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. + * identifier. See [Customer ID Aliases](/events-and-metrics/customer-aliases) for further + * information about how these aliases work in Orb. * * In addition to having an identifier in your system, a customer may exist in a payment * provider solution like Stripe. Use the `payment_provider_id` and the `payment_provider` enum @@ -315,8 +315,8 @@ private constructor( * * 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. */ @JsonProperty("customer") @ExcludeMissing fun _customer(): JsonField = customer @@ -370,9 +370,9 @@ private constructor( @JsonProperty("net_terms") @ExcludeMissing fun _netTerms(): JsonField = netTerms /** - * 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). */ @JsonProperty("plan") @ExcludeMissing fun _plan(): JsonField = plan @@ -696,8 +696,8 @@ private constructor( * 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. + * identifier. See [Customer ID Aliases](/events-and-metrics/customer-aliases) for further + * information about how these aliases work in Orb. * * In addition to having an identifier in your system, a customer may exist in a payment * provider solution like Stripe. Use the `payment_provider_id` and the `payment_provider` @@ -705,8 +705,8 @@ private constructor( * * 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. + * account's timezone. See [Timezone localization](/essentials/timezones) for information on + * what this timezone parameter influences within Orb. */ fun customer(customer: Customer) = customer(JsonField.of(customer)) @@ -716,8 +716,8 @@ private constructor( * 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. + * identifier. See [Customer ID Aliases](/events-and-metrics/customer-aliases) for further + * information about how these aliases work in Orb. * * In addition to having an identifier in your system, a customer may exist in a payment * provider solution like Stripe. Use the `payment_provider_id` and the `payment_provider` @@ -725,8 +725,8 @@ private constructor( * * 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. + * account's timezone. See [Timezone localization](/essentials/timezones) for information on + * what this timezone parameter influences within Orb. */ fun customer(customer: JsonField) = apply { this.customer = customer } @@ -908,18 +908,16 @@ private constructor( fun netTerms(netTerms: JsonField) = apply { this.netTerms = netTerms } /** - * 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). */ fun plan(plan: Plan) = plan(JsonField.of(plan)) /** - * 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). */ fun plan(plan: JsonField) = apply { this.plan = plan } @@ -5403,224 +5401,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") @@ -5682,224 +5464,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 @@ -6105,224 +5671,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.of(price)) @@ -6335,224 +5685,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 } @@ -6565,224 +5699,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)) @@ -6795,224 +5713,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)) @@ -7025,224 +5727,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)) @@ -7255,224 +5741,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)) @@ -7485,224 +5755,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(tieredBpsPrice: Price.TieredBpsPrice) = price(Price.ofTieredBpsPrice(tieredBpsPrice)) @@ -7716,684 +5770,36 @@ 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" - * } - * ... - * } - * ``` + * 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. + * 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. * - * ```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" - * } - * ] - * } - * ... - * ``` + * 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. * - * ## 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)) @@ -8406,224 +5812,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)) @@ -8637,224 +5827,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)) @@ -8868,224 +5842,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)) @@ -9099,224 +5857,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)) @@ -9330,224 +5872,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)) @@ -9561,224 +5887,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)) @@ -9792,455 +5902,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)) @@ -10254,224 +5932,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)) @@ -10485,224 +5947,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)) @@ -10716,224 +5962,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)) @@ -10947,224 +5977,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)) @@ -11178,224 +5992,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)) @@ -11409,224 +6007,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)) @@ -11640,224 +6022,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)) @@ -11871,459 +6037,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)) - /** * The start date of the price interval. This is the date that Orb starts billing for * this price. diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUnschedulePendingPlanChangesResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUnschedulePendingPlanChangesResponse.kt index 5fb2e6e3..e72702c0 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUnschedulePendingPlanChangesResponse.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUnschedulePendingPlanChangesResponse.kt @@ -167,8 +167,8 @@ private constructor( * 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. + * identifier. See [Customer ID Aliases](/events-and-metrics/customer-aliases) for further + * information about how these aliases work in Orb. * * In addition to having an identifier in your system, a customer may exist in a payment * provider solution like Stripe. Use the `payment_provider_id` and the `payment_provider` enum @@ -176,8 +176,8 @@ private constructor( * * 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. */ fun customer(): Customer = customer.getRequired("customer") @@ -224,9 +224,9 @@ private constructor( fun netTerms(): Long = netTerms.getRequired("net_terms") /** - * 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). */ fun plan(): Plan = plan.getRequired("plan") @@ -306,8 +306,8 @@ private constructor( * 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. + * identifier. See [Customer ID Aliases](/events-and-metrics/customer-aliases) for further + * information about how these aliases work in Orb. * * In addition to having an identifier in your system, a customer may exist in a payment * provider solution like Stripe. Use the `payment_provider_id` and the `payment_provider` enum @@ -315,8 +315,8 @@ private constructor( * * 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. */ @JsonProperty("customer") @ExcludeMissing fun _customer(): JsonField = customer @@ -370,9 +370,9 @@ private constructor( @JsonProperty("net_terms") @ExcludeMissing fun _netTerms(): JsonField = netTerms /** - * 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). */ @JsonProperty("plan") @ExcludeMissing fun _plan(): JsonField = plan @@ -692,8 +692,8 @@ private constructor( * 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. + * identifier. See [Customer ID Aliases](/events-and-metrics/customer-aliases) for further + * information about how these aliases work in Orb. * * In addition to having an identifier in your system, a customer may exist in a payment * provider solution like Stripe. Use the `payment_provider_id` and the `payment_provider` @@ -701,8 +701,8 @@ private constructor( * * 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. + * account's timezone. See [Timezone localization](/essentials/timezones) for information on + * what this timezone parameter influences within Orb. */ fun customer(customer: Customer) = customer(JsonField.of(customer)) @@ -712,8 +712,8 @@ private constructor( * 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. + * identifier. See [Customer ID Aliases](/events-and-metrics/customer-aliases) for further + * information about how these aliases work in Orb. * * In addition to having an identifier in your system, a customer may exist in a payment * provider solution like Stripe. Use the `payment_provider_id` and the `payment_provider` @@ -721,8 +721,8 @@ private constructor( * * 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. + * account's timezone. See [Timezone localization](/essentials/timezones) for information on + * what this timezone parameter influences within Orb. */ fun customer(customer: JsonField) = apply { this.customer = customer } @@ -904,18 +904,16 @@ private constructor( fun netTerms(netTerms: JsonField) = apply { this.netTerms = netTerms } /** - * 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). */ fun plan(plan: Plan) = plan(JsonField.of(plan)) /** - * 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). */ fun plan(plan: JsonField) = apply { this.plan = plan } @@ -5399,224 +5397,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") @@ -5678,224 +5460,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 @@ -6101,224 +5667,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.of(price)) @@ -6331,224 +5681,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 } @@ -6561,224 +5695,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)) @@ -6791,224 +5709,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)) @@ -7021,224 +5723,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)) @@ -7251,224 +5737,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)) @@ -7481,224 +5751,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(tieredBpsPrice: Price.TieredBpsPrice) = price(Price.ofTieredBpsPrice(tieredBpsPrice)) @@ -7712,684 +5766,36 @@ 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" - * } - * ... - * } - * ``` + * 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. + * 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. * - * ```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" - * } - * ] - * } - * ... - * ``` + * 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. * - * ## 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)) @@ -8402,224 +5808,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)) @@ -8633,224 +5823,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)) @@ -8864,224 +5838,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)) @@ -9095,224 +5853,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)) @@ -9326,224 +5868,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)) @@ -9557,224 +5883,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)) @@ -9788,455 +5898,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)) @@ -10250,224 +5928,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)) @@ -10481,224 +5943,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)) @@ -10712,224 +5958,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)) @@ -10943,224 +5973,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)) @@ -11174,224 +5988,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)) @@ -11405,224 +6003,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)) @@ -11636,224 +6018,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)) @@ -11867,459 +6033,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)) - /** * The start date of the price interval. This is the date that Orb starts billing for * this price. diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUpdateFixedFeeQuantityParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUpdateFixedFeeQuantityParams.kt index 97f3f79e..40f48f33 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUpdateFixedFeeQuantityParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUpdateFixedFeeQuantityParams.kt @@ -516,6 +516,11 @@ constructor( ) } + /** + * Determines when the change takes effect. Note that if `effective_date` is specified, this + * defaults to `effective_date`. Otherwise, this defaults to `immediate` unless it's explicitly + * set to `upcoming_invoice. + */ class ChangeOption @JsonCreator private constructor( diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUpdateFixedFeeQuantityResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUpdateFixedFeeQuantityResponse.kt index 0f337ca7..45f7345b 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUpdateFixedFeeQuantityResponse.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUpdateFixedFeeQuantityResponse.kt @@ -167,8 +167,8 @@ private constructor( * 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. + * identifier. See [Customer ID Aliases](/events-and-metrics/customer-aliases) for further + * information about how these aliases work in Orb. * * In addition to having an identifier in your system, a customer may exist in a payment * provider solution like Stripe. Use the `payment_provider_id` and the `payment_provider` enum @@ -176,8 +176,8 @@ private constructor( * * 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. */ fun customer(): Customer = customer.getRequired("customer") @@ -224,9 +224,9 @@ private constructor( fun netTerms(): Long = netTerms.getRequired("net_terms") /** - * 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). */ fun plan(): Plan = plan.getRequired("plan") @@ -306,8 +306,8 @@ private constructor( * 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. + * identifier. See [Customer ID Aliases](/events-and-metrics/customer-aliases) for further + * information about how these aliases work in Orb. * * In addition to having an identifier in your system, a customer may exist in a payment * provider solution like Stripe. Use the `payment_provider_id` and the `payment_provider` enum @@ -315,8 +315,8 @@ private constructor( * * 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. */ @JsonProperty("customer") @ExcludeMissing fun _customer(): JsonField = customer @@ -370,9 +370,9 @@ private constructor( @JsonProperty("net_terms") @ExcludeMissing fun _netTerms(): JsonField = netTerms /** - * 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). */ @JsonProperty("plan") @ExcludeMissing fun _plan(): JsonField = plan @@ -688,8 +688,8 @@ private constructor( * 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. + * identifier. See [Customer ID Aliases](/events-and-metrics/customer-aliases) for further + * information about how these aliases work in Orb. * * In addition to having an identifier in your system, a customer may exist in a payment * provider solution like Stripe. Use the `payment_provider_id` and the `payment_provider` @@ -697,8 +697,8 @@ private constructor( * * 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. + * account's timezone. See [Timezone localization](/essentials/timezones) for information on + * what this timezone parameter influences within Orb. */ fun customer(customer: Customer) = customer(JsonField.of(customer)) @@ -708,8 +708,8 @@ private constructor( * 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. + * identifier. See [Customer ID Aliases](/events-and-metrics/customer-aliases) for further + * information about how these aliases work in Orb. * * In addition to having an identifier in your system, a customer may exist in a payment * provider solution like Stripe. Use the `payment_provider_id` and the `payment_provider` @@ -717,8 +717,8 @@ private constructor( * * 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. + * account's timezone. See [Timezone localization](/essentials/timezones) for information on + * what this timezone parameter influences within Orb. */ fun customer(customer: JsonField) = apply { this.customer = customer } @@ -900,18 +900,16 @@ private constructor( fun netTerms(netTerms: JsonField) = apply { this.netTerms = netTerms } /** - * 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). */ fun plan(plan: Plan) = plan(JsonField.of(plan)) /** - * 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). */ fun plan(plan: JsonField) = apply { this.plan = plan } @@ -5395,224 +5393,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") @@ -5674,224 +5456,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 @@ -6097,224 +5663,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.of(price)) @@ -6327,224 +5677,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 } @@ -6557,224 +5691,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)) @@ -6787,224 +5705,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)) @@ -7017,224 +5719,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)) @@ -7247,224 +5733,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)) @@ -7477,224 +5747,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(tieredBpsPrice: Price.TieredBpsPrice) = price(Price.ofTieredBpsPrice(tieredBpsPrice)) @@ -7708,684 +5762,36 @@ 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" - * } - * ... - * } - * ``` + * 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. + * 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. * - * ```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" - * } - * ] - * } - * ... - * ``` + * 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. * - * ## 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)) @@ -8398,224 +5804,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)) @@ -8629,224 +5819,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)) @@ -8860,224 +5834,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)) @@ -9091,224 +5849,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)) @@ -9322,224 +5864,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)) @@ -9553,224 +5879,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)) @@ -9784,455 +5894,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)) @@ -10246,224 +5924,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)) @@ -10477,224 +5939,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)) @@ -10708,224 +5954,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)) @@ -10939,224 +5969,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)) @@ -11170,224 +5984,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)) @@ -11401,224 +5999,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)) @@ -11632,224 +6014,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)) @@ -11863,459 +6029,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)) - /** * The start date of the price interval. This is the date that Orb starts billing for * this price. diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUpdateTrialResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUpdateTrialResponse.kt index c95bd080..444d9c25 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUpdateTrialResponse.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUpdateTrialResponse.kt @@ -167,8 +167,8 @@ private constructor( * 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. + * identifier. See [Customer ID Aliases](/events-and-metrics/customer-aliases) for further + * information about how these aliases work in Orb. * * In addition to having an identifier in your system, a customer may exist in a payment * provider solution like Stripe. Use the `payment_provider_id` and the `payment_provider` enum @@ -176,8 +176,8 @@ private constructor( * * 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. */ fun customer(): Customer = customer.getRequired("customer") @@ -224,9 +224,9 @@ private constructor( fun netTerms(): Long = netTerms.getRequired("net_terms") /** - * 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). */ fun plan(): Plan = plan.getRequired("plan") @@ -306,8 +306,8 @@ private constructor( * 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. + * identifier. See [Customer ID Aliases](/events-and-metrics/customer-aliases) for further + * information about how these aliases work in Orb. * * In addition to having an identifier in your system, a customer may exist in a payment * provider solution like Stripe. Use the `payment_provider_id` and the `payment_provider` enum @@ -315,8 +315,8 @@ private constructor( * * 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. */ @JsonProperty("customer") @ExcludeMissing fun _customer(): JsonField = customer @@ -370,9 +370,9 @@ private constructor( @JsonProperty("net_terms") @ExcludeMissing fun _netTerms(): JsonField = netTerms /** - * 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). */ @JsonProperty("plan") @ExcludeMissing fun _plan(): JsonField = plan @@ -679,8 +679,8 @@ private constructor( * 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. + * identifier. See [Customer ID Aliases](/events-and-metrics/customer-aliases) for further + * information about how these aliases work in Orb. * * In addition to having an identifier in your system, a customer may exist in a payment * provider solution like Stripe. Use the `payment_provider_id` and the `payment_provider` @@ -688,8 +688,8 @@ private constructor( * * 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. + * account's timezone. See [Timezone localization](/essentials/timezones) for information on + * what this timezone parameter influences within Orb. */ fun customer(customer: Customer) = customer(JsonField.of(customer)) @@ -699,8 +699,8 @@ private constructor( * 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. + * identifier. See [Customer ID Aliases](/events-and-metrics/customer-aliases) for further + * information about how these aliases work in Orb. * * In addition to having an identifier in your system, a customer may exist in a payment * provider solution like Stripe. Use the `payment_provider_id` and the `payment_provider` @@ -708,8 +708,8 @@ private constructor( * * 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. + * account's timezone. See [Timezone localization](/essentials/timezones) for information on + * what this timezone parameter influences within Orb. */ fun customer(customer: JsonField) = apply { this.customer = customer } @@ -891,18 +891,16 @@ private constructor( fun netTerms(netTerms: JsonField) = apply { this.netTerms = netTerms } /** - * 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). */ fun plan(plan: Plan) = plan(JsonField.of(plan)) /** - * 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). */ fun plan(plan: JsonField) = apply { this.plan = plan } @@ -5386,224 +5384,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") @@ -5665,224 +5447,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 @@ -6088,224 +5654,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.of(price)) @@ -6318,224 +5668,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 } @@ -6548,224 +5682,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)) @@ -6778,224 +5696,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)) @@ -7008,224 +5710,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)) @@ -7238,224 +5724,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)) @@ -7468,224 +5738,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(tieredBpsPrice: Price.TieredBpsPrice) = price(Price.ofTieredBpsPrice(tieredBpsPrice)) @@ -7699,684 +5753,36 @@ 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" - * } - * ... - * } - * ``` + * 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. + * 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. * - * ```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" - * } - * ] - * } - * ... - * ``` + * 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. * - * ## 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)) @@ -8389,224 +5795,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)) @@ -8620,224 +5810,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)) @@ -8851,224 +5825,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)) @@ -9082,224 +5840,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)) @@ -9313,224 +5855,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)) @@ -9544,224 +5870,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)) @@ -9775,455 +5885,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)) @@ -10237,224 +5915,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)) @@ -10468,224 +5930,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)) @@ -10699,224 +5945,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)) @@ -10930,224 +5960,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)) @@ -11161,224 +5975,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)) @@ -11392,224 +5990,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)) @@ -11623,224 +6005,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)) @@ -11854,459 +6020,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)) - /** * The start date of the price interval. This is the date that Orb starts billing for * this price. diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/AlertServiceAsync.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/AlertServiceAsync.kt index 3314cc15..74fb0e0b 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/AlertServiceAsync.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/AlertServiceAsync.kt @@ -42,7 +42,7 @@ interface AlertServiceAsync { * 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](../reference/pagination). + * follows Orb's [standardized pagination format](/api-reference/pagination). */ @JvmOverloads fun list( @@ -54,8 +54,7 @@ interface AlertServiceAsync { * 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). + * of each type of alert per [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. */ @@ -69,8 +68,7 @@ interface AlertServiceAsync { * 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). + * of each type of alert per [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. */ diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/AlertServiceAsyncImpl.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/AlertServiceAsyncImpl.kt index 107dd76c..d88d48b7 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/AlertServiceAsyncImpl.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/AlertServiceAsyncImpl.kt @@ -103,7 +103,7 @@ constructor( * 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](../reference/pagination). + * follows Orb's [standardized pagination format](/api-reference/pagination). */ override fun list( params: AlertListParams, @@ -138,8 +138,7 @@ constructor( * 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). + * of each type of alert per [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. */ @@ -176,8 +175,7 @@ constructor( * 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). + * of each type of alert per [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. */ diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/CreditNoteServiceAsync.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/CreditNoteServiceAsync.kt index de34a95d..0838fdaa 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/CreditNoteServiceAsync.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/CreditNoteServiceAsync.kt @@ -14,9 +14,7 @@ import java.util.concurrent.CompletableFuture interface CreditNoteServiceAsync { - /** - * 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). */ @JvmOverloads fun create( params: CreditNoteCreateParams, @@ -35,8 +33,8 @@ interface CreditNoteServiceAsync { ): CompletableFuture /** - * 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. */ @JvmOverloads fun fetch( diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/CreditNoteServiceAsyncImpl.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/CreditNoteServiceAsyncImpl.kt index 9c5c2eac..20839f49 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/CreditNoteServiceAsyncImpl.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/CreditNoteServiceAsyncImpl.kt @@ -29,9 +29,7 @@ constructor( private val createHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) - /** - * 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). */ override fun create( params: CreditNoteCreateParams, requestOptions: RequestOptions @@ -97,8 +95,8 @@ constructor( jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** - * 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. */ override fun fetch( params: CreditNoteFetchParams, diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/CustomerServiceAsync.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/CustomerServiceAsync.kt index 43a0036c..00f849c8 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/CustomerServiceAsync.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/CustomerServiceAsync.kt @@ -29,16 +29,16 @@ interface CustomerServiceAsync { /** * 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 + * relationship. 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 */ @JvmOverloads fun create( @@ -61,9 +61,9 @@ interface CustomerServiceAsync { /** * 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. */ @JvmOverloads fun list( @@ -95,8 +95,8 @@ interface CustomerServiceAsync { * 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. */ @JvmOverloads fun fetch( @@ -106,7 +106,7 @@ interface CustomerServiceAsync { /** * 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). @@ -119,8 +119,8 @@ interface CustomerServiceAsync { /** * 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 semantics of this endpoint exactly mirror [Update Customer](update-customer). + * [Customer ID Aliases](/events-and-metrics/customer-aliases)). Note that the resource and + * semantics of this endpoint exactly mirror [Update Customer](update-customer). */ @JvmOverloads fun updateByExternalId( diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/CustomerServiceAsyncImpl.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/CustomerServiceAsyncImpl.kt index 978bed5a..672670a8 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/CustomerServiceAsyncImpl.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/CustomerServiceAsyncImpl.kt @@ -56,16 +56,16 @@ constructor( /** * 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 + * relationship. 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 */ override fun create( params: CustomerCreateParams, @@ -135,9 +135,9 @@ constructor( /** * 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. */ override fun list( params: CustomerListParams, @@ -208,8 +208,8 @@ constructor( * 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. */ override fun fetch( params: CustomerFetchParams, @@ -241,7 +241,7 @@ constructor( /** * 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). @@ -276,8 +276,8 @@ constructor( /** * 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 semantics of this endpoint exactly mirror [Update Customer](update-customer). + * [Customer ID Aliases](/events-and-metrics/customer-aliases)). Note that the resource and + * semantics of this endpoint exactly mirror [Update Customer](update-customer). */ override fun updateByExternalId( params: CustomerUpdateByExternalIdParams, diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/EventServiceAsync.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/EventServiceAsync.kt index dbffb495..8375f25c 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/EventServiceAsync.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/EventServiceAsync.kt @@ -275,8 +275,7 @@ interface EventServiceAsync { * * 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 @@ -310,7 +309,7 @@ interface EventServiceAsync { /** * 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 diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/EventServiceAsyncImpl.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/EventServiceAsyncImpl.kt index 0acf9910..e5409050 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/EventServiceAsyncImpl.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/EventServiceAsyncImpl.kt @@ -342,8 +342,7 @@ constructor( * * 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 @@ -400,7 +399,7 @@ constructor( /** * 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 diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/InvoiceServiceAsync.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/InvoiceServiceAsync.kt index 632ce386..8982ce8a 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/InvoiceServiceAsync.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/InvoiceServiceAsync.kt @@ -41,11 +41,11 @@ interface InvoiceServiceAsync { ): CompletableFuture /** - * 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 + * 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`. @@ -61,8 +61,7 @@ interface InvoiceServiceAsync { ): CompletableFuture /** - * 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. */ @JvmOverloads fun fetch( @@ -71,7 +70,7 @@ interface InvoiceServiceAsync { ): CompletableFuture /** - * This endpoint can be used to fetch the upcoming [invoice](../guides/concepts#invoice) for the + * This endpoint can be used to fetch the upcoming [invoice](/core-concepts#invoice) for the * current billing period given a subscription. */ @JvmOverloads diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/InvoiceServiceAsyncImpl.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/InvoiceServiceAsyncImpl.kt index 109f5777..2e7915b6 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/InvoiceServiceAsyncImpl.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/InvoiceServiceAsyncImpl.kt @@ -103,11 +103,11 @@ constructor( .withErrorHandler(errorHandler) /** - * 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 + * 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`. @@ -146,8 +146,7 @@ constructor( jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** - * 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. */ override fun fetch( params: InvoiceFetchParams, @@ -179,7 +178,7 @@ constructor( .withErrorHandler(errorHandler) /** - * This endpoint can be used to fetch the upcoming [invoice](../guides/concepts#invoice) for the + * This endpoint can be used to fetch the upcoming [invoice](/core-concepts#invoice) for the * current billing period given a subscription. */ override fun fetchUpcoming( diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/ItemServiceAsync.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/ItemServiceAsync.kt index 44372e69..c2fd2e75 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/ItemServiceAsync.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/ItemServiceAsync.kt @@ -15,7 +15,7 @@ import java.util.concurrent.CompletableFuture interface ItemServiceAsync { - /** This endpoint is used to create an [Item](../guides/concepts#item). */ + /** This endpoint is used to create an [Item](/core-concepts#item). */ @JvmOverloads fun create( params: ItemCreateParams, diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/ItemServiceAsyncImpl.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/ItemServiceAsyncImpl.kt index 72538e20..3cde8f0c 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/ItemServiceAsyncImpl.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/ItemServiceAsyncImpl.kt @@ -30,7 +30,7 @@ constructor( private val createHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) - /** This endpoint is used to create an [Item](../guides/concepts#item). */ + /** This endpoint is used to create an [Item](/core-concepts#item). */ override fun create( params: ItemCreateParams, requestOptions: RequestOptions diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/MetricServiceAsync.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/MetricServiceAsync.kt index 1c218520..aa08c06b 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/MetricServiceAsync.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/MetricServiceAsync.kt @@ -16,9 +16,9 @@ import java.util.concurrent.CompletableFuture interface MetricServiceAsync { /** - * 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. */ @JvmOverloads fun create( @@ -37,7 +37,7 @@ interface MetricServiceAsync { ): CompletableFuture /** - * 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. */ @@ -48,8 +48,8 @@ interface MetricServiceAsync { ): CompletableFuture /** - * 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. */ @JvmOverloads fun fetch( diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/MetricServiceAsyncImpl.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/MetricServiceAsyncImpl.kt index ec67c663..5c5281fd 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/MetricServiceAsyncImpl.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/MetricServiceAsyncImpl.kt @@ -31,9 +31,9 @@ constructor( jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** - * 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. */ override fun create( params: MetricCreateParams, @@ -99,7 +99,7 @@ constructor( .withErrorHandler(errorHandler) /** - * 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. */ @@ -133,8 +133,8 @@ constructor( jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** - * 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. */ override fun fetch( params: MetricFetchParams, diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/PlanServiceAsync.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/PlanServiceAsync.kt index 8f5dd789..1ca77ec5 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/PlanServiceAsync.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/PlanServiceAsync.kt @@ -38,10 +38,10 @@ interface PlanServiceAsync { ): CompletableFuture /** - * 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 retrieve the next page of results if they exist. + * 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. */ @JvmOverloads fun list( @@ -50,17 +50,17 @@ interface PlanServiceAsync { ): CompletableFuture /** - * This endpoint is used to fetch [plan](../guides/concepts##plan-and-price) details given a - * plan identifier. It returns information about the prices included in the plan and their + * 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 + * serialized 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). + * [Price schema](/core-concepts#plan-and-price). * * ## Phases * diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/PlanServiceAsyncImpl.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/PlanServiceAsyncImpl.kt index 9f8a0620..5cfee12c 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/PlanServiceAsyncImpl.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/PlanServiceAsyncImpl.kt @@ -105,10 +105,10 @@ constructor( .withErrorHandler(errorHandler) /** - * 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 retrieve the next page of results if they exist. + * 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. */ override fun list( params: PlanListParams, @@ -140,17 +140,17 @@ constructor( jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** - * This endpoint is used to fetch [plan](../guides/concepts##plan-and-price) details given a - * plan identifier. It returns information about the prices included in the plan and their + * 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 + * serialized 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). + * [Price schema](/core-concepts#plan-and-price). * * ## Phases * diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/PriceServiceAsync.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/PriceServiceAsync.kt index d2b5412e..5eac22c8 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/PriceServiceAsync.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/PriceServiceAsync.kt @@ -21,15 +21,16 @@ interface PriceServiceAsync { fun externalPriceId(): ExternalPriceIdServiceAsync /** - * This endpoint is used to create a [price](../reference/price). A price created using this - * endpoint is always an add-on, meaning that it’s not associated with a specific plan and can - * instead be individually added to subscriptions, including subscriptions on different plans. + * This endpoint is used to create a [price](/product-catalog/price-configuration). A price + * created using this endpoint is always an add-on, meaning that it’s not associated with a + * specific plan and can instead be individually added to subscriptions, including subscriptions + * on different plans. * * An `external_price_id` can be optionally specified as an alias to allow ergonomic interaction * with prices in the Orb API. * - * See the [Price resource](../reference/price) for the specification of different price model - * configurations possible in this endpoint. + * See the [Price resource](/product-catalog/price-configuration) for the specification of + * different price model configurations possible in this endpoint. */ @JvmOverloads fun create( @@ -49,7 +50,7 @@ interface PriceServiceAsync { /** * This endpoint is used to list all add-on prices created using the - * [price creation endpoint](../reference/create-price). + * [price creation endpoint](/api-reference/price/create-price). */ @JvmOverloads fun list( @@ -60,8 +61,8 @@ interface PriceServiceAsync { /** * This endpoint is used to evaluate the output of a price for a given customer and time range. * It enables filtering and grouping the output using - * [computed properties](../guides/extensibility/advanced-metrics#computed-properties), - * supporting the following workflows: + * [computed properties](/extensibility/advanced-metrics#computed-properties), supporting the + * following workflows: * 1. Showing detailed usage and costs to the end customer. * 2. Auditing subtotals on invoice line items. * diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/PriceServiceAsyncImpl.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/PriceServiceAsyncImpl.kt index 576e1bce..513e7fa0 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/PriceServiceAsyncImpl.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/PriceServiceAsyncImpl.kt @@ -41,15 +41,16 @@ constructor( jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** - * This endpoint is used to create a [price](../reference/price). A price created using this - * endpoint is always an add-on, meaning that it’s not associated with a specific plan and can - * instead be individually added to subscriptions, including subscriptions on different plans. + * This endpoint is used to create a [price](/product-catalog/price-configuration). A price + * created using this endpoint is always an add-on, meaning that it’s not associated with a + * specific plan and can instead be individually added to subscriptions, including subscriptions + * on different plans. * * An `external_price_id` can be optionally specified as an alias to allow ergonomic interaction * with prices in the Orb API. * - * See the [Price resource](../reference/price) for the specification of different price model - * configurations possible in this endpoint. + * See the [Price resource](/product-catalog/price-configuration) for the specification of + * different price model configurations possible in this endpoint. */ override fun create( params: PriceCreateParams, @@ -116,7 +117,7 @@ constructor( /** * This endpoint is used to list all add-on prices created using the - * [price creation endpoint](../reference/create-price). + * [price creation endpoint](/api-reference/price/create-price). */ override fun list( params: PriceListParams, @@ -150,8 +151,8 @@ constructor( /** * This endpoint is used to evaluate the output of a price for a given customer and time range. * It enables filtering and grouping the output using - * [computed properties](../guides/extensibility/advanced-metrics#computed-properties), - * supporting the following workflows: + * [computed properties](/extensibility/advanced-metrics#computed-properties), supporting the + * following workflows: * 1. Showing detailed usage and costs to the end customer. * 2. Auditing subtotals on invoice line items. * diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/SubscriptionServiceAsync.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/SubscriptionServiceAsync.kt index 36a1f333..bb496cdb 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/SubscriptionServiceAsync.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/SubscriptionServiceAsync.kt @@ -49,7 +49,7 @@ interface SubscriptionServiceAsync { * each billing cycle at the cadence that's configured in the plan definition. * * The default configuration for subscriptions in Orb is **In-advance billing** and **Beginning - * of month alignment** (see [Subscription](../guides/concepts#subscription) for more details). + * of month alignment** (see [Subscription](/core-concepts##subscription) for more details). * * In order to change the alignment behavior, Orb also supports billing subscriptions on the day * of the month they are created. If `align_billing_with_subscription_start_date = true` is @@ -73,26 +73,27 @@ interface SubscriptionServiceAsync { * being created. This is useful when a customer has prices that differ from the default prices * for a specific plan. * - * :::info This feature is only available for accounts that have migrated to Subscription + * This feature is only available for accounts that have migrated to Subscription * Overrides Version 2. You can find your Subscription Overrides Version at the bottom of your - * [Plans page](https://app.withorb.com/plans) ::: + * [Plans page](https://app.withorb.com/plans) * * ### Adding Prices * * To add prices, provide a list of objects with the key `add_prices`. An object in the list * must specify an existing add-on price with a `price_id` or `external_price_id` field, or * create a new add-on price by including an object with the key `price`, identical to what - * would be used in the request body for the [create price endpoint](../reference/create-price). - * See the [Price resource](../reference/price) for the specification of different price model - * configurations possible in this object. + * would be used in the request body for the + * [create price endpoint](/api-reference/price/create-price). See the + * [Price resource](/product-catalog/price-configuration) for the specification of different + * price model configurations possible in this object. * * If the plan has phases, each object in the list must include a number with `plan_phase_order` * key to indicate which phase the price should be added to. * * An object in the list can specify an optional `start_date` and optional `end_date`. This is * equivalent to creating a price interval with the - * [add/edit price intervals endpoint](../reference/add-edit-price-intervals). If unspecified, - * the start or end date of the phase or subscription will be used. + * [add/edit price intervals endpoint](/api-reference/price-interval/add-or-edit-price-intervals). + * If unspecified, the start or end date of the phase or subscription will be used. * * An object in the list can specify an optional `minimum_amount`, `maximum_amount`, or * `discounts`. This will create adjustments which apply only to this price. @@ -114,14 +115,14 @@ interface SubscriptionServiceAsync { * specify a price to replace it with by either referencing an existing add-on price with a * `price_id` or `external_price_id` field, or by creating a new add-on price by including an * object with the key `price`, identical to what would be used in the request body for the - * [create price endpoint](../reference/create-price). See the - * [Price resource](../reference/price) for the specification of different price model - * configurations possible in this object. + * [create price endpoint](/api-reference/price/create-price). See the + * [Price resource](/product-catalog/price-configuration) for the specification of different + * price model configurations possible in this object. * * For fixed fees, an object in the list can supply a `fixed_price_quantity` instead of a * `price`, `price_id`, or `external_price_id` field. This will update only the quantity for the - * price, similar to the [Update price quantity](../reference/update-fixed-fee-quantity) - * endpoint. + * price, similar to the + * [Update price quantity](/api-reference/subscription/update-price-quantity) endpoint. * * The replacement price will have the same phase, if applicable, and the same start and end * dates as the price it replaces. @@ -138,7 +139,8 @@ interface SubscriptionServiceAsync { * * To add adjustments, provide a list of objects with the key `add_adjustments`. An object in * the list must include an object with the key `adjustment`, identical to the adjustment object - * in the [add/edit price intervals endpoint](../reference/add-edit-price-intervals). + * in the + * [add/edit price intervals endpoint](/api-reference/price-interval/add-or-edit-price-intervals). * * If the plan has phases, each object in the list must include a number with `plan_phase_order` * key to indicate which phase the adjustment should be added to. @@ -157,16 +159,16 @@ interface SubscriptionServiceAsync { * object in the list must specify a plan adjustment to replace with the * `replaces_adjustment_id` key, and it must specify an adjustment to replace it with by * including an object with the key `adjustment`, identical to the adjustment object in the - * [add/edit price intervals endpoint](../reference/add-edit-price-intervals). + * [add/edit price intervals endpoint](/api-reference/price-interval/add-or-edit-price-intervals). * * The replacement adjustment will have the same phase, if applicable, and the same start and * end dates as the adjustment it replaces. * * ## Price overrides (DEPRECATED) * - * :::info Price overrides are being phased out in favor adding/removing/replacing prices. (See - * [Customize your customer's subscriptions](../reference/create-subscription#customize-your-customers-subscriptions)) - * ::: + * Price overrides are being phased out in favor adding/removing/replacing prices. (See + * [Customize your customer's subscriptions](/api-reference/subscription/create-subscription)) + * * * Price overrides are used to update some or all prices in a plan for the specific subscription * being created. This is useful when a new customer has negotiated a rate that is unique to the @@ -174,9 +176,10 @@ interface SubscriptionServiceAsync { * * To override prices, provide a list of objects with the key `price_overrides`. The price * object in the list of overrides is expected to contain the existing price id, the - * `model_type` and configuration. (See the [Price resource](../reference/price) for the - * specification of different price model configurations.) The numerical values can be updated, - * but the billable metric, cadence, type, and name of a price can not be overridden. + * `model_type` and configuration. (See the + * [Price resource](/product-catalog/price-configuration) for the specification of different + * price model configurations.) The numerical values can be updated, but the billable metric, + * cadence, type, and name of a price can not be overridden. * * ### Maximums and Minimums * @@ -293,9 +296,9 @@ interface SubscriptionServiceAsync { /** * This endpoint returns a list of all subscriptions for an account 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). * * Subscriptions can be filtered for a specific customer by using either the customer_id or * external_customer_id query parameters. To filter subscriptions for multiple customers, use @@ -358,8 +361,7 @@ interface SubscriptionServiceAsync { * issued invoice, Orb will generate a balance refund for the current period. If the * cancellation is before the most recently issued invoice, Orb will void the intervening * invoice and generate a new one based on the new dates for the subscription. See the section - * on - * [cancellation behaviors](../guides/product-catalog/creating-subscriptions.md#cancellation-behaviors). + * on [cancellation behaviors](/product-catalog/creating-subscriptions#cancellation-behaviors). */ @JvmOverloads fun cancel( @@ -368,7 +370,7 @@ interface SubscriptionServiceAsync { ): CompletableFuture /** - * This endpoint is used to fetch a [Subscription](../guides/concepts#subscription) given an + * This endpoint is used to fetch a [Subscription](/core-concepts##subscription) given an * identifier. */ @JvmOverloads @@ -395,7 +397,7 @@ interface SubscriptionServiceAsync { ): CompletableFuture /** - * This endpoint returns a [paginated](../reference/pagination) list of all plans associated + * This endpoint returns a [paginated](/api-reference/pagination) list of all plans associated * with a subscription along with their start and end dates. This list contains the * subscription's initial plan along with past and future plan changes. */ @@ -590,9 +592,9 @@ interface SubscriptionServiceAsync { /** * This endpoint is used to add and edit subscription - * [price intervals](../reference/price-interval). By making modifications to a subscription’s - * price intervals, you can - * [flexibly and atomically control the billing behavior of a subscription](../guides/product-catalog/modifying-subscriptions). + * [price intervals](/api-reference/price-interval/add-or-edit-price-intervals). By making + * modifications to a subscription’s price intervals, you can + * [flexibly and atomically control the billing behavior of a subscription](/product-catalog/modifying-subscriptions). * * ## Adding price intervals * @@ -700,26 +702,27 @@ interface SubscriptionServiceAsync { * you schedule the plan change. This is useful when a customer has prices that differ from the * default prices for a specific plan. * - * :::info This feature is only available for accounts that have migrated to Subscription + * This feature is only available for accounts that have migrated to Subscription * Overrides Version 2. You can find your Subscription Overrides Version at the bottom of your - * [Plans page](https://app.withorb.com/plans) ::: + * [Plans page](https://app.withorb.com/plans) * * ### Adding Prices * * To add prices, provide a list of objects with the key `add_prices`. An object in the list * must specify an existing add-on price with a `price_id` or `external_price_id` field, or * create a new add-on price by including an object with the key `price`, identical to what - * would be used in the request body for the [create price endpoint](../reference/create-price). - * See the [Price resource](../reference/price) for the specification of different price model - * configurations possible in this object. + * would be used in the request body for the + * [create price endpoint](/api-reference/price/create-price). See the + * [Price resource](/product-catalog/price-configuration) for the specification of different + * price model configurations possible in this object. * * If the plan has phases, each object in the list must include a number with `plan_phase_order` * key to indicate which phase the price should be added to. * * An object in the list can specify an optional `start_date` and optional `end_date`. This is * equivalent to creating a price interval with the - * [add/edit price intervals endpoint](../reference/add-edit-price-intervals). If unspecified, - * the start or end date of the phase or subscription will be used. + * [add/edit price intervals endpoint](/api-reference/price-interval/add-or-edit-price-intervals). + * If unspecified, the start or end date of the phase or subscription will be used. * * An object in the list can specify an optional `minimum_amount`, `maximum_amount`, or * `discounts`. This will create adjustments which apply only to this price. @@ -741,14 +744,14 @@ interface SubscriptionServiceAsync { * specify a price to replace it with by either referencing an existing add-on price with a * `price_id` or `external_price_id` field, or by creating a new add-on price by including an * object with the key `price`, identical to what would be used in the request body for the - * [create price endpoint](../reference/create-price). See the - * [Price resource](../reference/price) for the specification of different price model - * configurations possible in this object. + * [create price endpoint](/api-reference/price/create-price). See the + * [Price resource](/product-catalog/price-configuration) for the specification of different + * price model configurations possible in this object. * * For fixed fees, an object in the list can supply a `fixed_price_quantity` instead of a * `price`, `price_id`, or `external_price_id` field. This will update only the quantity for the - * price, similar to the [Update price quantity](../reference/update-fixed-fee-quantity) - * endpoint. + * price, similar to the + * [Update price quantity](/api-reference/subscription/update-price-quantity) endpoint. * * The replacement price will have the same phase, if applicable, and the same start and end * dates as the price it replaces. @@ -765,7 +768,8 @@ interface SubscriptionServiceAsync { * * To add adjustments, provide a list of objects with the key `add_adjustments`. An object in * the list must include an object with the key `adjustment`, identical to the adjustment object - * in the [add/edit price intervals endpoint](../reference/add-edit-price-intervals). + * in the + * [add/edit price intervals endpoint](/api-reference/price-interval/add-or-edit-price-intervals). * * If the plan has phases, each object in the list must include a number with `plan_phase_order` * key to indicate which phase the adjustment should be added to. @@ -784,16 +788,16 @@ interface SubscriptionServiceAsync { * object in the list must specify a plan adjustment to replace with the * `replaces_adjustment_id` key, and it must specify an adjustment to replace it with by * including an object with the key `adjustment`, identical to the adjustment object in the - * [add/edit price intervals endpoint](../reference/add-edit-price-intervals). + * [add/edit price intervals endpoint](/api-reference/price-interval/add-or-edit-price-intervals). * * The replacement adjustment will have the same phase, if applicable, and the same start and * end dates as the adjustment it replaces. * * ## Price overrides (DEPRECATED) * - * :::info Price overrides are being phased out in favor adding/removing/replacing prices. (See - * [Customize your customer's subscriptions](../reference/schedule-plan-change#customize-your-customers-subscriptions)) - * ::: + * Price overrides are being phased out in favor adding/removing/replacing prices. (See + * [Customize your customer's subscriptions](/api-reference/subscription/schedule-plan-change)) + * * * Price overrides are used to update some or all prices in a plan for the specific subscription * being created. This is useful when a new customer has negotiated a rate that is unique to the @@ -801,9 +805,10 @@ interface SubscriptionServiceAsync { * * To override prices, provide a list of objects with the key `price_overrides`. The price * object in the list of overrides is expected to contain the existing price id, the - * `model_type` and configuration. (See the [Price resource](../reference/price) for the - * specification of different price model configurations.) The numerical values can be updated, - * but the billable metric, cadence, type, and name of a price can not be overridden. + * `model_type` and configuration. (See the + * [Price resource](/product-catalog/price-configuration) for the specification of different + * price model configurations.) The numerical values can be updated, but the billable metric, + * cadence, type, and name of a price can not be overridden. * * ### Maximums, and minimums * @@ -822,7 +827,7 @@ interface SubscriptionServiceAsync { * * By default, Orb calculates the prorated difference in any fixed fees when making a plan * change, adjusting the customer balance as needed. For details on this behavior, see - * [Modifying subscriptions](../guides/product-catalog/modifying-subscriptions.md#prorations-for-in-advance-fees). + * [Modifying subscriptions](/product-catalog/modifying-subscriptions#prorations-for-in-advance-fees). */ @JvmOverloads fun schedulePlanChange( diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/SubscriptionServiceAsyncImpl.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/SubscriptionServiceAsyncImpl.kt index 68f21492..bd499261 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/SubscriptionServiceAsyncImpl.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/SubscriptionServiceAsyncImpl.kt @@ -65,7 +65,7 @@ constructor( * each billing cycle at the cadence that's configured in the plan definition. * * The default configuration for subscriptions in Orb is **In-advance billing** and **Beginning - * of month alignment** (see [Subscription](../guides/concepts#subscription) for more details). + * of month alignment** (see [Subscription](/core-concepts##subscription) for more details). * * In order to change the alignment behavior, Orb also supports billing subscriptions on the day * of the month they are created. If `align_billing_with_subscription_start_date = true` is @@ -89,26 +89,27 @@ constructor( * being created. This is useful when a customer has prices that differ from the default prices * for a specific plan. * - * :::info This feature is only available for accounts that have migrated to Subscription + * This feature is only available for accounts that have migrated to Subscription * Overrides Version 2. You can find your Subscription Overrides Version at the bottom of your - * [Plans page](https://app.withorb.com/plans) ::: + * [Plans page](https://app.withorb.com/plans) * * ### Adding Prices * * To add prices, provide a list of objects with the key `add_prices`. An object in the list * must specify an existing add-on price with a `price_id` or `external_price_id` field, or * create a new add-on price by including an object with the key `price`, identical to what - * would be used in the request body for the [create price endpoint](../reference/create-price). - * See the [Price resource](../reference/price) for the specification of different price model - * configurations possible in this object. + * would be used in the request body for the + * [create price endpoint](/api-reference/price/create-price). See the + * [Price resource](/product-catalog/price-configuration) for the specification of different + * price model configurations possible in this object. * * If the plan has phases, each object in the list must include a number with `plan_phase_order` * key to indicate which phase the price should be added to. * * An object in the list can specify an optional `start_date` and optional `end_date`. This is * equivalent to creating a price interval with the - * [add/edit price intervals endpoint](../reference/add-edit-price-intervals). If unspecified, - * the start or end date of the phase or subscription will be used. + * [add/edit price intervals endpoint](/api-reference/price-interval/add-or-edit-price-intervals). + * If unspecified, the start or end date of the phase or subscription will be used. * * An object in the list can specify an optional `minimum_amount`, `maximum_amount`, or * `discounts`. This will create adjustments which apply only to this price. @@ -130,14 +131,14 @@ constructor( * specify a price to replace it with by either referencing an existing add-on price with a * `price_id` or `external_price_id` field, or by creating a new add-on price by including an * object with the key `price`, identical to what would be used in the request body for the - * [create price endpoint](../reference/create-price). See the - * [Price resource](../reference/price) for the specification of different price model - * configurations possible in this object. + * [create price endpoint](/api-reference/price/create-price). See the + * [Price resource](/product-catalog/price-configuration) for the specification of different + * price model configurations possible in this object. * * For fixed fees, an object in the list can supply a `fixed_price_quantity` instead of a * `price`, `price_id`, or `external_price_id` field. This will update only the quantity for the - * price, similar to the [Update price quantity](../reference/update-fixed-fee-quantity) - * endpoint. + * price, similar to the + * [Update price quantity](/api-reference/subscription/update-price-quantity) endpoint. * * The replacement price will have the same phase, if applicable, and the same start and end * dates as the price it replaces. @@ -154,7 +155,8 @@ constructor( * * To add adjustments, provide a list of objects with the key `add_adjustments`. An object in * the list must include an object with the key `adjustment`, identical to the adjustment object - * in the [add/edit price intervals endpoint](../reference/add-edit-price-intervals). + * in the + * [add/edit price intervals endpoint](/api-reference/price-interval/add-or-edit-price-intervals). * * If the plan has phases, each object in the list must include a number with `plan_phase_order` * key to indicate which phase the adjustment should be added to. @@ -173,16 +175,16 @@ constructor( * object in the list must specify a plan adjustment to replace with the * `replaces_adjustment_id` key, and it must specify an adjustment to replace it with by * including an object with the key `adjustment`, identical to the adjustment object in the - * [add/edit price intervals endpoint](../reference/add-edit-price-intervals). + * [add/edit price intervals endpoint](/api-reference/price-interval/add-or-edit-price-intervals). * * The replacement adjustment will have the same phase, if applicable, and the same start and * end dates as the adjustment it replaces. * * ## Price overrides (DEPRECATED) * - * :::info Price overrides are being phased out in favor adding/removing/replacing prices. (See - * [Customize your customer's subscriptions](../reference/create-subscription#customize-your-customers-subscriptions)) - * ::: + * Price overrides are being phased out in favor adding/removing/replacing prices. (See + * [Customize your customer's subscriptions](/api-reference/subscription/create-subscription)) + * * * Price overrides are used to update some or all prices in a plan for the specific subscription * being created. This is useful when a new customer has negotiated a rate that is unique to the @@ -190,9 +192,10 @@ constructor( * * To override prices, provide a list of objects with the key `price_overrides`. The price * object in the list of overrides is expected to contain the existing price id, the - * `model_type` and configuration. (See the [Price resource](../reference/price) for the - * specification of different price model configurations.) The numerical values can be updated, - * but the billable metric, cadence, type, and name of a price can not be overridden. + * `model_type` and configuration. (See the + * [Price resource](/product-catalog/price-configuration) for the specification of different + * price model configurations.) The numerical values can be updated, but the billable metric, + * cadence, type, and name of a price can not be overridden. * * ### Maximums and Minimums * @@ -356,9 +359,9 @@ constructor( /** * This endpoint returns a list of all subscriptions for an account 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). * * Subscriptions can be filtered for a specific customer by using either the customer_id or * external_customer_id query parameters. To filter subscriptions for multiple customers, use @@ -445,8 +448,7 @@ constructor( * issued invoice, Orb will generate a balance refund for the current period. If the * cancellation is before the most recently issued invoice, Orb will void the intervening * invoice and generate a new one based on the new dates for the subscription. See the section - * on - * [cancellation behaviors](../guides/product-catalog/creating-subscriptions.md#cancellation-behaviors). + * on [cancellation behaviors](/product-catalog/creating-subscriptions#cancellation-behaviors). */ override fun cancel( params: SubscriptionCancelParams, @@ -478,7 +480,7 @@ constructor( jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** - * This endpoint is used to fetch a [Subscription](../guides/concepts#subscription) given an + * This endpoint is used to fetch a [Subscription](/core-concepts##subscription) given an * identifier. */ override fun fetch( @@ -551,7 +553,7 @@ constructor( .withErrorHandler(errorHandler) /** - * This endpoint returns a [paginated](../reference/pagination) list of all plans associated + * This endpoint returns a [paginated](/api-reference/pagination) list of all plans associated * with a subscription along with their start and end dates. This list contains the * subscription's initial plan along with past and future plan changes. */ @@ -792,9 +794,9 @@ constructor( /** * This endpoint is used to add and edit subscription - * [price intervals](../reference/price-interval). By making modifications to a subscription’s - * price intervals, you can - * [flexibly and atomically control the billing behavior of a subscription](../guides/product-catalog/modifying-subscriptions). + * [price intervals](/api-reference/price-interval/add-or-edit-price-intervals). By making + * modifications to a subscription’s price intervals, you can + * [flexibly and atomically control the billing behavior of a subscription](/product-catalog/modifying-subscriptions). * * ## Adding price intervals * @@ -926,26 +928,27 @@ constructor( * you schedule the plan change. This is useful when a customer has prices that differ from the * default prices for a specific plan. * - * :::info This feature is only available for accounts that have migrated to Subscription + * This feature is only available for accounts that have migrated to Subscription * Overrides Version 2. You can find your Subscription Overrides Version at the bottom of your - * [Plans page](https://app.withorb.com/plans) ::: + * [Plans page](https://app.withorb.com/plans) * * ### Adding Prices * * To add prices, provide a list of objects with the key `add_prices`. An object in the list * must specify an existing add-on price with a `price_id` or `external_price_id` field, or * create a new add-on price by including an object with the key `price`, identical to what - * would be used in the request body for the [create price endpoint](../reference/create-price). - * See the [Price resource](../reference/price) for the specification of different price model - * configurations possible in this object. + * would be used in the request body for the + * [create price endpoint](/api-reference/price/create-price). See the + * [Price resource](/product-catalog/price-configuration) for the specification of different + * price model configurations possible in this object. * * If the plan has phases, each object in the list must include a number with `plan_phase_order` * key to indicate which phase the price should be added to. * * An object in the list can specify an optional `start_date` and optional `end_date`. This is * equivalent to creating a price interval with the - * [add/edit price intervals endpoint](../reference/add-edit-price-intervals). If unspecified, - * the start or end date of the phase or subscription will be used. + * [add/edit price intervals endpoint](/api-reference/price-interval/add-or-edit-price-intervals). + * If unspecified, the start or end date of the phase or subscription will be used. * * An object in the list can specify an optional `minimum_amount`, `maximum_amount`, or * `discounts`. This will create adjustments which apply only to this price. @@ -967,14 +970,14 @@ constructor( * specify a price to replace it with by either referencing an existing add-on price with a * `price_id` or `external_price_id` field, or by creating a new add-on price by including an * object with the key `price`, identical to what would be used in the request body for the - * [create price endpoint](../reference/create-price). See the - * [Price resource](../reference/price) for the specification of different price model - * configurations possible in this object. + * [create price endpoint](/api-reference/price/create-price). See the + * [Price resource](/product-catalog/price-configuration) for the specification of different + * price model configurations possible in this object. * * For fixed fees, an object in the list can supply a `fixed_price_quantity` instead of a * `price`, `price_id`, or `external_price_id` field. This will update only the quantity for the - * price, similar to the [Update price quantity](../reference/update-fixed-fee-quantity) - * endpoint. + * price, similar to the + * [Update price quantity](/api-reference/subscription/update-price-quantity) endpoint. * * The replacement price will have the same phase, if applicable, and the same start and end * dates as the price it replaces. @@ -991,7 +994,8 @@ constructor( * * To add adjustments, provide a list of objects with the key `add_adjustments`. An object in * the list must include an object with the key `adjustment`, identical to the adjustment object - * in the [add/edit price intervals endpoint](../reference/add-edit-price-intervals). + * in the + * [add/edit price intervals endpoint](/api-reference/price-interval/add-or-edit-price-intervals). * * If the plan has phases, each object in the list must include a number with `plan_phase_order` * key to indicate which phase the adjustment should be added to. @@ -1010,16 +1014,16 @@ constructor( * object in the list must specify a plan adjustment to replace with the * `replaces_adjustment_id` key, and it must specify an adjustment to replace it with by * including an object with the key `adjustment`, identical to the adjustment object in the - * [add/edit price intervals endpoint](../reference/add-edit-price-intervals). + * [add/edit price intervals endpoint](/api-reference/price-interval/add-or-edit-price-intervals). * * The replacement adjustment will have the same phase, if applicable, and the same start and * end dates as the adjustment it replaces. * * ## Price overrides (DEPRECATED) * - * :::info Price overrides are being phased out in favor adding/removing/replacing prices. (See - * [Customize your customer's subscriptions](../reference/schedule-plan-change#customize-your-customers-subscriptions)) - * ::: + * Price overrides are being phased out in favor adding/removing/replacing prices. (See + * [Customize your customer's subscriptions](/api-reference/subscription/schedule-plan-change)) + * * * Price overrides are used to update some or all prices in a plan for the specific subscription * being created. This is useful when a new customer has negotiated a rate that is unique to the @@ -1027,9 +1031,10 @@ constructor( * * To override prices, provide a list of objects with the key `price_overrides`. The price * object in the list of overrides is expected to contain the existing price id, the - * `model_type` and configuration. (See the [Price resource](../reference/price) for the - * specification of different price model configurations.) The numerical values can be updated, - * but the billable metric, cadence, type, and name of a price can not be overridden. + * `model_type` and configuration. (See the + * [Price resource](/product-catalog/price-configuration) for the specification of different + * price model configurations.) The numerical values can be updated, but the billable metric, + * cadence, type, and name of a price can not be overridden. * * ### Maximums, and minimums * @@ -1048,7 +1053,7 @@ constructor( * * By default, Orb calculates the prorated difference in any fixed fees when making a plan * change, adjusting the customer balance as needed. For details on this behavior, see - * [Modifying subscriptions](../guides/product-catalog/modifying-subscriptions.md#prorations-for-in-advance-fees). + * [Modifying subscriptions](/product-catalog/modifying-subscriptions#prorations-for-in-advance-fees). */ override fun schedulePlanChange( params: SubscriptionSchedulePlanChangeParams, diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/coupons/SubscriptionServiceAsync.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/coupons/SubscriptionServiceAsync.kt index 1121c3eb..da626b9b 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/coupons/SubscriptionServiceAsync.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/coupons/SubscriptionServiceAsync.kt @@ -13,9 +13,9 @@ interface SubscriptionServiceAsync { /** * 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). */ @JvmOverloads fun list( diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/coupons/SubscriptionServiceAsyncImpl.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/coupons/SubscriptionServiceAsyncImpl.kt index c88b4b88..f0fbce6b 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/coupons/SubscriptionServiceAsyncImpl.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/coupons/SubscriptionServiceAsyncImpl.kt @@ -28,9 +28,9 @@ constructor( /** * 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). */ override fun list( params: CouponSubscriptionListParams, diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/customers/CostServiceAsync.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/customers/CostServiceAsync.kt index d62bc32b..56b301d8 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/customers/CostServiceAsync.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/customers/CostServiceAsync.kt @@ -16,8 +16,8 @@ interface CostServiceAsync { /** * 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: @@ -25,8 +25,8 @@ interface CostServiceAsync { * 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 @@ -132,8 +132,8 @@ interface CostServiceAsync { /** * 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: @@ -141,8 +141,8 @@ interface CostServiceAsync { * 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 diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/customers/CostServiceAsyncImpl.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/customers/CostServiceAsyncImpl.kt index c0863491..a0705c2c 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/customers/CostServiceAsyncImpl.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/customers/CostServiceAsyncImpl.kt @@ -31,8 +31,8 @@ constructor( /** * 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: @@ -40,8 +40,8 @@ constructor( * 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 @@ -170,8 +170,8 @@ constructor( /** * 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: @@ -179,8 +179,8 @@ constructor( * 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 diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/customers/credits/LedgerServiceAsync.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/customers/credits/LedgerServiceAsync.kt index c8ffa815..d006d91e 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/customers/credits/LedgerServiceAsync.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/customers/credits/LedgerServiceAsync.kt @@ -20,11 +20,11 @@ interface LedgerServiceAsync { /** * 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 + * [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). + * [here](/product-catalog/prepurchase). * * There are four major types of modifications to credit balance, detailed below. * @@ -323,11 +323,11 @@ interface LedgerServiceAsync { /** * 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 + * [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). + * [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/services/async/customers/credits/LedgerServiceAsyncImpl.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/customers/credits/LedgerServiceAsyncImpl.kt index da12ae9c..77b621f8 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/customers/credits/LedgerServiceAsyncImpl.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/customers/credits/LedgerServiceAsyncImpl.kt @@ -36,11 +36,11 @@ constructor( /** * 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 + * [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). + * [here](/product-catalog/prepurchase). * * There are four major types of modifications to credit balance, detailed below. * @@ -421,11 +421,11 @@ constructor( /** * 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 + * [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). + * [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/services/async/events/BackfillServiceAsync.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/events/BackfillServiceAsync.kt index 5f09daf1..ec1ffcf2 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/events/BackfillServiceAsync.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/events/BackfillServiceAsync.kt @@ -43,9 +43,9 @@ interface BackfillServiceAsync { * events 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 + * timeframe 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 + * [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. */ @@ -59,7 +59,7 @@ interface BackfillServiceAsync { * 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 + * 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). */ diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/events/BackfillServiceAsyncImpl.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/events/BackfillServiceAsyncImpl.kt index 9d867fc3..8a8030c4 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/events/BackfillServiceAsyncImpl.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/events/BackfillServiceAsyncImpl.kt @@ -59,9 +59,9 @@ constructor( * events 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 + * timeframe 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 + * [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. */ @@ -99,7 +99,7 @@ constructor( * 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 + * 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). */ diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/events/VolumeServiceAsync.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/events/VolumeServiceAsync.kt index 46435efb..d48f5210 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/events/VolumeServiceAsync.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/events/VolumeServiceAsync.kt @@ -13,12 +13,12 @@ interface VolumeServiceAsync { /** * 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 diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/events/VolumeServiceAsyncImpl.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/events/VolumeServiceAsyncImpl.kt index 6cd82f2e..3b3cf398 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/events/VolumeServiceAsyncImpl.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/events/VolumeServiceAsyncImpl.kt @@ -27,12 +27,12 @@ constructor( /** * 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 diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/plans/ExternalPlanIdServiceAsync.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/plans/ExternalPlanIdServiceAsync.kt index b964d9f7..fdc8346b 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/plans/ExternalPlanIdServiceAsync.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/plans/ExternalPlanIdServiceAsync.kt @@ -25,7 +25,7 @@ interface ExternalPlanIdServiceAsync { ): CompletableFuture /** - * 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. * @@ -36,10 +36,10 @@ interface ExternalPlanIdServiceAsync { * ## 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 + * serialized 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). " + * [Price schema](/core-concepts#plan-and-price). " */ @JvmOverloads fun fetch( diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/plans/ExternalPlanIdServiceAsyncImpl.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/plans/ExternalPlanIdServiceAsyncImpl.kt index fb7b4d9c..afdb85d9 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/plans/ExternalPlanIdServiceAsyncImpl.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/plans/ExternalPlanIdServiceAsyncImpl.kt @@ -63,7 +63,7 @@ constructor( jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** - * 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. * @@ -74,10 +74,10 @@ constructor( * ## 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 + * serialized 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). " + * [Price schema](/core-concepts#plan-and-price). " */ override fun fetch( params: PlanExternalPlanIdFetchParams, diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/prices/ExternalPriceIdServiceAsync.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/prices/ExternalPriceIdServiceAsync.kt index dc23bf22..d1335b78 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/prices/ExternalPriceIdServiceAsync.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/prices/ExternalPriceIdServiceAsync.kt @@ -24,8 +24,8 @@ interface ExternalPriceIdServiceAsync { /** * This endpoint returns a price given an external price id. See the - * [price creation API](../reference/create-price) for more information about external price - * aliases. + * [price creation API](/api-reference/price/create-price) for more information about external + * price aliases. */ @JvmOverloads fun fetch( diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/prices/ExternalPriceIdServiceAsyncImpl.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/prices/ExternalPriceIdServiceAsyncImpl.kt index ab014fef..c2d9eb49 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/prices/ExternalPriceIdServiceAsyncImpl.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/prices/ExternalPriceIdServiceAsyncImpl.kt @@ -62,8 +62,8 @@ constructor( /** * This endpoint returns a price given an external price id. See the - * [price creation API](../reference/create-price) for more information about external price - * aliases. + * [price creation API](/api-reference/price/create-price) for more information about external + * price aliases. */ override fun fetch( params: PriceExternalPriceIdFetchParams, diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/AlertService.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/AlertService.kt index 435fcb2c..05bfae6c 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/AlertService.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/AlertService.kt @@ -41,7 +41,7 @@ interface AlertService { * 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](../reference/pagination). + * follows Orb's [standardized pagination format](/api-reference/pagination). */ @JvmOverloads fun list( @@ -53,8 +53,7 @@ interface AlertService { * 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). + * of each type of alert per [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. */ @@ -68,8 +67,7 @@ interface AlertService { * 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). + * of each type of alert per [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. */ diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/AlertServiceImpl.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/AlertServiceImpl.kt index 07261080..c6b7ab68 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/AlertServiceImpl.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/AlertServiceImpl.kt @@ -93,7 +93,7 @@ constructor( * 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](../reference/pagination). + * follows Orb's [standardized pagination format](/api-reference/pagination). */ override fun list(params: AlertListParams, requestOptions: RequestOptions): AlertListPage { val request = @@ -124,8 +124,7 @@ constructor( * 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). + * of each type of alert per [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. */ @@ -161,8 +160,7 @@ constructor( * 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). + * of each type of alert per [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. */ diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/CreditNoteService.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/CreditNoteService.kt index 8b25af3f..938cd213 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/CreditNoteService.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/CreditNoteService.kt @@ -13,9 +13,7 @@ import com.withorb.api.models.CreditNoteListParams interface CreditNoteService { - /** - * 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). */ @JvmOverloads fun create( params: CreditNoteCreateParams, @@ -34,8 +32,8 @@ interface CreditNoteService { ): CreditNoteListPage /** - * 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. */ @JvmOverloads fun fetch( diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/CreditNoteServiceImpl.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/CreditNoteServiceImpl.kt index cbda5b08..ae000b11 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/CreditNoteServiceImpl.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/CreditNoteServiceImpl.kt @@ -28,9 +28,7 @@ constructor( private val createHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) - /** - * 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). */ override fun create( params: CreditNoteCreateParams, requestOptions: RequestOptions @@ -94,8 +92,8 @@ constructor( jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** - * 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. */ override fun fetch(params: CreditNoteFetchParams, requestOptions: RequestOptions): CreditNote { val request = diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/CustomerService.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/CustomerService.kt index 78e9b49e..90dfaf9c 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/CustomerService.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/CustomerService.kt @@ -28,16 +28,16 @@ interface CustomerService { /** * 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 + * relationship. 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 */ @JvmOverloads fun create( @@ -60,9 +60,9 @@ interface CustomerService { /** * 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. */ @JvmOverloads fun list( @@ -91,8 +91,8 @@ interface CustomerService { * 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. */ @JvmOverloads fun fetch( @@ -102,7 +102,7 @@ interface CustomerService { /** * 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). @@ -115,8 +115,8 @@ interface CustomerService { /** * 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 semantics of this endpoint exactly mirror [Update Customer](update-customer). + * [Customer ID Aliases](/events-and-metrics/customer-aliases)). Note that the resource and + * semantics of this endpoint exactly mirror [Update Customer](update-customer). */ @JvmOverloads fun updateByExternalId( diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/CustomerServiceImpl.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/CustomerServiceImpl.kt index e0d3239c..5bcaa19b 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/CustomerServiceImpl.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/CustomerServiceImpl.kt @@ -55,16 +55,16 @@ constructor( /** * 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 + * relationship. 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 */ override fun create(params: CustomerCreateParams, requestOptions: RequestOptions): Customer { val request = @@ -126,9 +126,9 @@ constructor( /** * 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. */ override fun list( params: CustomerListParams, @@ -194,8 +194,8 @@ constructor( * 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. */ override fun fetch(params: CustomerFetchParams, requestOptions: RequestOptions): Customer { val request = @@ -223,7 +223,7 @@ constructor( /** * 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). @@ -257,8 +257,8 @@ constructor( /** * 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 semantics of this endpoint exactly mirror [Update Customer](update-customer). + * [Customer ID Aliases](/events-and-metrics/customer-aliases)). Note that the resource and + * semantics of this endpoint exactly mirror [Update Customer](update-customer). */ override fun updateByExternalId( params: CustomerUpdateByExternalIdParams, diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/EventService.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/EventService.kt index e451ae9b..b8283b72 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/EventService.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/EventService.kt @@ -274,8 +274,7 @@ interface EventService { * * 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 @@ -309,7 +308,7 @@ interface EventService { /** * 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 diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/EventServiceImpl.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/EventServiceImpl.kt index 45c06df5..46ea6a76 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/EventServiceImpl.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/EventServiceImpl.kt @@ -339,8 +339,7 @@ constructor( * * 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 @@ -396,7 +395,7 @@ constructor( /** * 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 diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/InvoiceService.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/InvoiceService.kt index 3a99b624..e317889a 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/InvoiceService.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/InvoiceService.kt @@ -40,11 +40,11 @@ interface InvoiceService { ): Invoice /** - * 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 + * 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`. @@ -60,8 +60,7 @@ interface InvoiceService { ): InvoiceListPage /** - * 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. */ @JvmOverloads fun fetch( @@ -70,7 +69,7 @@ interface InvoiceService { ): Invoice /** - * This endpoint can be used to fetch the upcoming [invoice](../guides/concepts#invoice) for the + * This endpoint can be used to fetch the upcoming [invoice](/core-concepts#invoice) for the * current billing period given a subscription. */ @JvmOverloads diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/InvoiceServiceImpl.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/InvoiceServiceImpl.kt index fbe6211d..844c048c 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/InvoiceServiceImpl.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/InvoiceServiceImpl.kt @@ -94,11 +94,11 @@ constructor( .withErrorHandler(errorHandler) /** - * 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 + * 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`. @@ -133,8 +133,7 @@ constructor( jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** - * 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. */ override fun fetch(params: InvoiceFetchParams, requestOptions: RequestOptions): Invoice { val request = @@ -162,7 +161,7 @@ constructor( .withErrorHandler(errorHandler) /** - * This endpoint can be used to fetch the upcoming [invoice](../guides/concepts#invoice) for the + * This endpoint can be used to fetch the upcoming [invoice](/core-concepts#invoice) for the * current billing period given a subscription. */ override fun fetchUpcoming( diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/ItemService.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/ItemService.kt index ccc44a1e..bc1e8e86 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/ItemService.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/ItemService.kt @@ -14,7 +14,7 @@ import com.withorb.api.models.ItemUpdateParams interface ItemService { - /** This endpoint is used to create an [Item](../guides/concepts#item). */ + /** This endpoint is used to create an [Item](/core-concepts#item). */ @JvmOverloads fun create( params: ItemCreateParams, diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/ItemServiceImpl.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/ItemServiceImpl.kt index 5b9d528e..6844e94b 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/ItemServiceImpl.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/ItemServiceImpl.kt @@ -29,7 +29,7 @@ constructor( private val createHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) - /** This endpoint is used to create an [Item](../guides/concepts#item). */ + /** This endpoint is used to create an [Item](/core-concepts#item). */ override fun create(params: ItemCreateParams, requestOptions: RequestOptions): Item { val request = HttpRequest.builder() diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/MetricService.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/MetricService.kt index 5bcb58f6..80d5c03b 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/MetricService.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/MetricService.kt @@ -15,9 +15,9 @@ import com.withorb.api.models.MetricUpdateParams interface MetricService { /** - * 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. */ @JvmOverloads fun create( @@ -36,7 +36,7 @@ interface MetricService { ): BillableMetric /** - * 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. */ @@ -47,8 +47,8 @@ interface MetricService { ): MetricListPage /** - * 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. */ @JvmOverloads fun fetch( diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/MetricServiceImpl.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/MetricServiceImpl.kt index fcf9d1ef..ce7a0637 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/MetricServiceImpl.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/MetricServiceImpl.kt @@ -30,9 +30,9 @@ constructor( jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** - * 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. */ override fun create( params: MetricCreateParams, @@ -96,7 +96,7 @@ constructor( .withErrorHandler(errorHandler) /** - * 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. */ @@ -126,8 +126,8 @@ constructor( jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** - * 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. */ override fun fetch(params: MetricFetchParams, requestOptions: RequestOptions): BillableMetric { val request = diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/PlanService.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/PlanService.kt index 3340af24..9818cf73 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/PlanService.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/PlanService.kt @@ -37,10 +37,10 @@ interface PlanService { ): Plan /** - * 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 retrieve the next page of results if they exist. + * 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. */ @JvmOverloads fun list( @@ -49,17 +49,17 @@ interface PlanService { ): PlanListPage /** - * This endpoint is used to fetch [plan](../guides/concepts##plan-and-price) details given a - * plan identifier. It returns information about the prices included in the plan and their + * 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 + * serialized 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). + * [Price schema](/core-concepts#plan-and-price). * * ## Phases * diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/PlanServiceImpl.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/PlanServiceImpl.kt index 46603a7a..53071ff5 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/PlanServiceImpl.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/PlanServiceImpl.kt @@ -95,10 +95,10 @@ constructor( jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** - * 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 retrieve the next page of results if they exist. + * 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. */ override fun list(params: PlanListParams, requestOptions: RequestOptions): PlanListPage { val request = @@ -126,17 +126,17 @@ constructor( jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** - * This endpoint is used to fetch [plan](../guides/concepts##plan-and-price) details given a - * plan identifier. It returns information about the prices included in the plan and their + * 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 + * serialized 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). + * [Price schema](/core-concepts#plan-and-price). * * ## Phases * diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/PriceService.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/PriceService.kt index 4e60cb74..08ca5db0 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/PriceService.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/PriceService.kt @@ -20,15 +20,16 @@ interface PriceService { fun externalPriceId(): ExternalPriceIdService /** - * This endpoint is used to create a [price](../reference/price). A price created using this - * endpoint is always an add-on, meaning that it’s not associated with a specific plan and can - * instead be individually added to subscriptions, including subscriptions on different plans. + * This endpoint is used to create a [price](/product-catalog/price-configuration). A price + * created using this endpoint is always an add-on, meaning that it’s not associated with a + * specific plan and can instead be individually added to subscriptions, including subscriptions + * on different plans. * * An `external_price_id` can be optionally specified as an alias to allow ergonomic interaction * with prices in the Orb API. * - * See the [Price resource](../reference/price) for the specification of different price model - * configurations possible in this endpoint. + * See the [Price resource](/product-catalog/price-configuration) for the specification of + * different price model configurations possible in this endpoint. */ @JvmOverloads fun create( @@ -48,7 +49,7 @@ interface PriceService { /** * This endpoint is used to list all add-on prices created using the - * [price creation endpoint](../reference/create-price). + * [price creation endpoint](/api-reference/price/create-price). */ @JvmOverloads fun list( @@ -59,8 +60,8 @@ interface PriceService { /** * This endpoint is used to evaluate the output of a price for a given customer and time range. * It enables filtering and grouping the output using - * [computed properties](../guides/extensibility/advanced-metrics#computed-properties), - * supporting the following workflows: + * [computed properties](/extensibility/advanced-metrics#computed-properties), supporting the + * following workflows: * 1. Showing detailed usage and costs to the end customer. * 2. Auditing subtotals on invoice line items. * diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/PriceServiceImpl.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/PriceServiceImpl.kt index 9bb33305..df55a7cb 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/PriceServiceImpl.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/PriceServiceImpl.kt @@ -40,15 +40,16 @@ constructor( jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** - * This endpoint is used to create a [price](../reference/price). A price created using this - * endpoint is always an add-on, meaning that it’s not associated with a specific plan and can - * instead be individually added to subscriptions, including subscriptions on different plans. + * This endpoint is used to create a [price](/product-catalog/price-configuration). A price + * created using this endpoint is always an add-on, meaning that it’s not associated with a + * specific plan and can instead be individually added to subscriptions, including subscriptions + * on different plans. * * An `external_price_id` can be optionally specified as an alias to allow ergonomic interaction * with prices in the Orb API. * - * See the [Price resource](../reference/price) for the specification of different price model - * configurations possible in this endpoint. + * See the [Price resource](/product-catalog/price-configuration) for the specification of + * different price model configurations possible in this endpoint. */ override fun create(params: PriceCreateParams, requestOptions: RequestOptions): Price { val request = @@ -106,7 +107,7 @@ constructor( /** * This endpoint is used to list all add-on prices created using the - * [price creation endpoint](../reference/create-price). + * [price creation endpoint](/api-reference/price/create-price). */ override fun list(params: PriceListParams, requestOptions: RequestOptions): PriceListPage { val request = @@ -136,8 +137,8 @@ constructor( /** * This endpoint is used to evaluate the output of a price for a given customer and time range. * It enables filtering and grouping the output using - * [computed properties](../guides/extensibility/advanced-metrics#computed-properties), - * supporting the following workflows: + * [computed properties](/extensibility/advanced-metrics#computed-properties), supporting the + * following workflows: * 1. Showing detailed usage and costs to the end customer. * 2. Auditing subtotals on invoice line items. * diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/SubscriptionService.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/SubscriptionService.kt index 918e7f76..1f859551 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/SubscriptionService.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/SubscriptionService.kt @@ -48,7 +48,7 @@ interface SubscriptionService { * each billing cycle at the cadence that's configured in the plan definition. * * The default configuration for subscriptions in Orb is **In-advance billing** and **Beginning - * of month alignment** (see [Subscription](../guides/concepts#subscription) for more details). + * of month alignment** (see [Subscription](/core-concepts##subscription) for more details). * * In order to change the alignment behavior, Orb also supports billing subscriptions on the day * of the month they are created. If `align_billing_with_subscription_start_date = true` is @@ -72,26 +72,27 @@ interface SubscriptionService { * being created. This is useful when a customer has prices that differ from the default prices * for a specific plan. * - * :::info This feature is only available for accounts that have migrated to Subscription + * This feature is only available for accounts that have migrated to Subscription * Overrides Version 2. You can find your Subscription Overrides Version at the bottom of your - * [Plans page](https://app.withorb.com/plans) ::: + * [Plans page](https://app.withorb.com/plans) * * ### Adding Prices * * To add prices, provide a list of objects with the key `add_prices`. An object in the list * must specify an existing add-on price with a `price_id` or `external_price_id` field, or * create a new add-on price by including an object with the key `price`, identical to what - * would be used in the request body for the [create price endpoint](../reference/create-price). - * See the [Price resource](../reference/price) for the specification of different price model - * configurations possible in this object. + * would be used in the request body for the + * [create price endpoint](/api-reference/price/create-price). See the + * [Price resource](/product-catalog/price-configuration) for the specification of different + * price model configurations possible in this object. * * If the plan has phases, each object in the list must include a number with `plan_phase_order` * key to indicate which phase the price should be added to. * * An object in the list can specify an optional `start_date` and optional `end_date`. This is * equivalent to creating a price interval with the - * [add/edit price intervals endpoint](../reference/add-edit-price-intervals). If unspecified, - * the start or end date of the phase or subscription will be used. + * [add/edit price intervals endpoint](/api-reference/price-interval/add-or-edit-price-intervals). + * If unspecified, the start or end date of the phase or subscription will be used. * * An object in the list can specify an optional `minimum_amount`, `maximum_amount`, or * `discounts`. This will create adjustments which apply only to this price. @@ -113,14 +114,14 @@ interface SubscriptionService { * specify a price to replace it with by either referencing an existing add-on price with a * `price_id` or `external_price_id` field, or by creating a new add-on price by including an * object with the key `price`, identical to what would be used in the request body for the - * [create price endpoint](../reference/create-price). See the - * [Price resource](../reference/price) for the specification of different price model - * configurations possible in this object. + * [create price endpoint](/api-reference/price/create-price). See the + * [Price resource](/product-catalog/price-configuration) for the specification of different + * price model configurations possible in this object. * * For fixed fees, an object in the list can supply a `fixed_price_quantity` instead of a * `price`, `price_id`, or `external_price_id` field. This will update only the quantity for the - * price, similar to the [Update price quantity](../reference/update-fixed-fee-quantity) - * endpoint. + * price, similar to the + * [Update price quantity](/api-reference/subscription/update-price-quantity) endpoint. * * The replacement price will have the same phase, if applicable, and the same start and end * dates as the price it replaces. @@ -137,7 +138,8 @@ interface SubscriptionService { * * To add adjustments, provide a list of objects with the key `add_adjustments`. An object in * the list must include an object with the key `adjustment`, identical to the adjustment object - * in the [add/edit price intervals endpoint](../reference/add-edit-price-intervals). + * in the + * [add/edit price intervals endpoint](/api-reference/price-interval/add-or-edit-price-intervals). * * If the plan has phases, each object in the list must include a number with `plan_phase_order` * key to indicate which phase the adjustment should be added to. @@ -156,16 +158,16 @@ interface SubscriptionService { * object in the list must specify a plan adjustment to replace with the * `replaces_adjustment_id` key, and it must specify an adjustment to replace it with by * including an object with the key `adjustment`, identical to the adjustment object in the - * [add/edit price intervals endpoint](../reference/add-edit-price-intervals). + * [add/edit price intervals endpoint](/api-reference/price-interval/add-or-edit-price-intervals). * * The replacement adjustment will have the same phase, if applicable, and the same start and * end dates as the adjustment it replaces. * * ## Price overrides (DEPRECATED) * - * :::info Price overrides are being phased out in favor adding/removing/replacing prices. (See - * [Customize your customer's subscriptions](../reference/create-subscription#customize-your-customers-subscriptions)) - * ::: + * Price overrides are being phased out in favor adding/removing/replacing prices. (See + * [Customize your customer's subscriptions](/api-reference/subscription/create-subscription)) + * * * Price overrides are used to update some or all prices in a plan for the specific subscription * being created. This is useful when a new customer has negotiated a rate that is unique to the @@ -173,9 +175,10 @@ interface SubscriptionService { * * To override prices, provide a list of objects with the key `price_overrides`. The price * object in the list of overrides is expected to contain the existing price id, the - * `model_type` and configuration. (See the [Price resource](../reference/price) for the - * specification of different price model configurations.) The numerical values can be updated, - * but the billable metric, cadence, type, and name of a price can not be overridden. + * `model_type` and configuration. (See the + * [Price resource](/product-catalog/price-configuration) for the specification of different + * price model configurations.) The numerical values can be updated, but the billable metric, + * cadence, type, and name of a price can not be overridden. * * ### Maximums and Minimums * @@ -292,9 +295,9 @@ interface SubscriptionService { /** * This endpoint returns a list of all subscriptions for an account 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). * * Subscriptions can be filtered for a specific customer by using either the customer_id or * external_customer_id query parameters. To filter subscriptions for multiple customers, use @@ -357,8 +360,7 @@ interface SubscriptionService { * issued invoice, Orb will generate a balance refund for the current period. If the * cancellation is before the most recently issued invoice, Orb will void the intervening * invoice and generate a new one based on the new dates for the subscription. See the section - * on - * [cancellation behaviors](../guides/product-catalog/creating-subscriptions.md#cancellation-behaviors). + * on [cancellation behaviors](/product-catalog/creating-subscriptions#cancellation-behaviors). */ @JvmOverloads fun cancel( @@ -367,7 +369,7 @@ interface SubscriptionService { ): SubscriptionCancelResponse /** - * This endpoint is used to fetch a [Subscription](../guides/concepts#subscription) given an + * This endpoint is used to fetch a [Subscription](/core-concepts##subscription) given an * identifier. */ @JvmOverloads @@ -394,7 +396,7 @@ interface SubscriptionService { ): SubscriptionFetchCostsResponse /** - * This endpoint returns a [paginated](../reference/pagination) list of all plans associated + * This endpoint returns a [paginated](/api-reference/pagination) list of all plans associated * with a subscription along with their start and end dates. This list contains the * subscription's initial plan along with past and future plan changes. */ @@ -589,9 +591,9 @@ interface SubscriptionService { /** * This endpoint is used to add and edit subscription - * [price intervals](../reference/price-interval). By making modifications to a subscription’s - * price intervals, you can - * [flexibly and atomically control the billing behavior of a subscription](../guides/product-catalog/modifying-subscriptions). + * [price intervals](/api-reference/price-interval/add-or-edit-price-intervals). By making + * modifications to a subscription’s price intervals, you can + * [flexibly and atomically control the billing behavior of a subscription](/product-catalog/modifying-subscriptions). * * ## Adding price intervals * @@ -699,26 +701,27 @@ interface SubscriptionService { * you schedule the plan change. This is useful when a customer has prices that differ from the * default prices for a specific plan. * - * :::info This feature is only available for accounts that have migrated to Subscription + * This feature is only available for accounts that have migrated to Subscription * Overrides Version 2. You can find your Subscription Overrides Version at the bottom of your - * [Plans page](https://app.withorb.com/plans) ::: + * [Plans page](https://app.withorb.com/plans) * * ### Adding Prices * * To add prices, provide a list of objects with the key `add_prices`. An object in the list * must specify an existing add-on price with a `price_id` or `external_price_id` field, or * create a new add-on price by including an object with the key `price`, identical to what - * would be used in the request body for the [create price endpoint](../reference/create-price). - * See the [Price resource](../reference/price) for the specification of different price model - * configurations possible in this object. + * would be used in the request body for the + * [create price endpoint](/api-reference/price/create-price). See the + * [Price resource](/product-catalog/price-configuration) for the specification of different + * price model configurations possible in this object. * * If the plan has phases, each object in the list must include a number with `plan_phase_order` * key to indicate which phase the price should be added to. * * An object in the list can specify an optional `start_date` and optional `end_date`. This is * equivalent to creating a price interval with the - * [add/edit price intervals endpoint](../reference/add-edit-price-intervals). If unspecified, - * the start or end date of the phase or subscription will be used. + * [add/edit price intervals endpoint](/api-reference/price-interval/add-or-edit-price-intervals). + * If unspecified, the start or end date of the phase or subscription will be used. * * An object in the list can specify an optional `minimum_amount`, `maximum_amount`, or * `discounts`. This will create adjustments which apply only to this price. @@ -740,14 +743,14 @@ interface SubscriptionService { * specify a price to replace it with by either referencing an existing add-on price with a * `price_id` or `external_price_id` field, or by creating a new add-on price by including an * object with the key `price`, identical to what would be used in the request body for the - * [create price endpoint](../reference/create-price). See the - * [Price resource](../reference/price) for the specification of different price model - * configurations possible in this object. + * [create price endpoint](/api-reference/price/create-price). See the + * [Price resource](/product-catalog/price-configuration) for the specification of different + * price model configurations possible in this object. * * For fixed fees, an object in the list can supply a `fixed_price_quantity` instead of a * `price`, `price_id`, or `external_price_id` field. This will update only the quantity for the - * price, similar to the [Update price quantity](../reference/update-fixed-fee-quantity) - * endpoint. + * price, similar to the + * [Update price quantity](/api-reference/subscription/update-price-quantity) endpoint. * * The replacement price will have the same phase, if applicable, and the same start and end * dates as the price it replaces. @@ -764,7 +767,8 @@ interface SubscriptionService { * * To add adjustments, provide a list of objects with the key `add_adjustments`. An object in * the list must include an object with the key `adjustment`, identical to the adjustment object - * in the [add/edit price intervals endpoint](../reference/add-edit-price-intervals). + * in the + * [add/edit price intervals endpoint](/api-reference/price-interval/add-or-edit-price-intervals). * * If the plan has phases, each object in the list must include a number with `plan_phase_order` * key to indicate which phase the adjustment should be added to. @@ -783,16 +787,16 @@ interface SubscriptionService { * object in the list must specify a plan adjustment to replace with the * `replaces_adjustment_id` key, and it must specify an adjustment to replace it with by * including an object with the key `adjustment`, identical to the adjustment object in the - * [add/edit price intervals endpoint](../reference/add-edit-price-intervals). + * [add/edit price intervals endpoint](/api-reference/price-interval/add-or-edit-price-intervals). * * The replacement adjustment will have the same phase, if applicable, and the same start and * end dates as the adjustment it replaces. * * ## Price overrides (DEPRECATED) * - * :::info Price overrides are being phased out in favor adding/removing/replacing prices. (See - * [Customize your customer's subscriptions](../reference/schedule-plan-change#customize-your-customers-subscriptions)) - * ::: + * Price overrides are being phased out in favor adding/removing/replacing prices. (See + * [Customize your customer's subscriptions](/api-reference/subscription/schedule-plan-change)) + * * * Price overrides are used to update some or all prices in a plan for the specific subscription * being created. This is useful when a new customer has negotiated a rate that is unique to the @@ -800,9 +804,10 @@ interface SubscriptionService { * * To override prices, provide a list of objects with the key `price_overrides`. The price * object in the list of overrides is expected to contain the existing price id, the - * `model_type` and configuration. (See the [Price resource](../reference/price) for the - * specification of different price model configurations.) The numerical values can be updated, - * but the billable metric, cadence, type, and name of a price can not be overridden. + * `model_type` and configuration. (See the + * [Price resource](/product-catalog/price-configuration) for the specification of different + * price model configurations.) The numerical values can be updated, but the billable metric, + * cadence, type, and name of a price can not be overridden. * * ### Maximums, and minimums * @@ -821,7 +826,7 @@ interface SubscriptionService { * * By default, Orb calculates the prorated difference in any fixed fees when making a plan * change, adjusting the customer balance as needed. For details on this behavior, see - * [Modifying subscriptions](../guides/product-catalog/modifying-subscriptions.md#prorations-for-in-advance-fees). + * [Modifying subscriptions](/product-catalog/modifying-subscriptions#prorations-for-in-advance-fees). */ @JvmOverloads fun schedulePlanChange( diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/SubscriptionServiceImpl.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/SubscriptionServiceImpl.kt index 6c768c8e..43a06fac 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/SubscriptionServiceImpl.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/SubscriptionServiceImpl.kt @@ -64,7 +64,7 @@ constructor( * each billing cycle at the cadence that's configured in the plan definition. * * The default configuration for subscriptions in Orb is **In-advance billing** and **Beginning - * of month alignment** (see [Subscription](../guides/concepts#subscription) for more details). + * of month alignment** (see [Subscription](/core-concepts##subscription) for more details). * * In order to change the alignment behavior, Orb also supports billing subscriptions on the day * of the month they are created. If `align_billing_with_subscription_start_date = true` is @@ -88,26 +88,27 @@ constructor( * being created. This is useful when a customer has prices that differ from the default prices * for a specific plan. * - * :::info This feature is only available for accounts that have migrated to Subscription + * This feature is only available for accounts that have migrated to Subscription * Overrides Version 2. You can find your Subscription Overrides Version at the bottom of your - * [Plans page](https://app.withorb.com/plans) ::: + * [Plans page](https://app.withorb.com/plans) * * ### Adding Prices * * To add prices, provide a list of objects with the key `add_prices`. An object in the list * must specify an existing add-on price with a `price_id` or `external_price_id` field, or * create a new add-on price by including an object with the key `price`, identical to what - * would be used in the request body for the [create price endpoint](../reference/create-price). - * See the [Price resource](../reference/price) for the specification of different price model - * configurations possible in this object. + * would be used in the request body for the + * [create price endpoint](/api-reference/price/create-price). See the + * [Price resource](/product-catalog/price-configuration) for the specification of different + * price model configurations possible in this object. * * If the plan has phases, each object in the list must include a number with `plan_phase_order` * key to indicate which phase the price should be added to. * * An object in the list can specify an optional `start_date` and optional `end_date`. This is * equivalent to creating a price interval with the - * [add/edit price intervals endpoint](../reference/add-edit-price-intervals). If unspecified, - * the start or end date of the phase or subscription will be used. + * [add/edit price intervals endpoint](/api-reference/price-interval/add-or-edit-price-intervals). + * If unspecified, the start or end date of the phase or subscription will be used. * * An object in the list can specify an optional `minimum_amount`, `maximum_amount`, or * `discounts`. This will create adjustments which apply only to this price. @@ -129,14 +130,14 @@ constructor( * specify a price to replace it with by either referencing an existing add-on price with a * `price_id` or `external_price_id` field, or by creating a new add-on price by including an * object with the key `price`, identical to what would be used in the request body for the - * [create price endpoint](../reference/create-price). See the - * [Price resource](../reference/price) for the specification of different price model - * configurations possible in this object. + * [create price endpoint](/api-reference/price/create-price). See the + * [Price resource](/product-catalog/price-configuration) for the specification of different + * price model configurations possible in this object. * * For fixed fees, an object in the list can supply a `fixed_price_quantity` instead of a * `price`, `price_id`, or `external_price_id` field. This will update only the quantity for the - * price, similar to the [Update price quantity](../reference/update-fixed-fee-quantity) - * endpoint. + * price, similar to the + * [Update price quantity](/api-reference/subscription/update-price-quantity) endpoint. * * The replacement price will have the same phase, if applicable, and the same start and end * dates as the price it replaces. @@ -153,7 +154,8 @@ constructor( * * To add adjustments, provide a list of objects with the key `add_adjustments`. An object in * the list must include an object with the key `adjustment`, identical to the adjustment object - * in the [add/edit price intervals endpoint](../reference/add-edit-price-intervals). + * in the + * [add/edit price intervals endpoint](/api-reference/price-interval/add-or-edit-price-intervals). * * If the plan has phases, each object in the list must include a number with `plan_phase_order` * key to indicate which phase the adjustment should be added to. @@ -172,16 +174,16 @@ constructor( * object in the list must specify a plan adjustment to replace with the * `replaces_adjustment_id` key, and it must specify an adjustment to replace it with by * including an object with the key `adjustment`, identical to the adjustment object in the - * [add/edit price intervals endpoint](../reference/add-edit-price-intervals). + * [add/edit price intervals endpoint](/api-reference/price-interval/add-or-edit-price-intervals). * * The replacement adjustment will have the same phase, if applicable, and the same start and * end dates as the adjustment it replaces. * * ## Price overrides (DEPRECATED) * - * :::info Price overrides are being phased out in favor adding/removing/replacing prices. (See - * [Customize your customer's subscriptions](../reference/create-subscription#customize-your-customers-subscriptions)) - * ::: + * Price overrides are being phased out in favor adding/removing/replacing prices. (See + * [Customize your customer's subscriptions](/api-reference/subscription/create-subscription)) + * * * Price overrides are used to update some or all prices in a plan for the specific subscription * being created. This is useful when a new customer has negotiated a rate that is unique to the @@ -189,9 +191,10 @@ constructor( * * To override prices, provide a list of objects with the key `price_overrides`. The price * object in the list of overrides is expected to contain the existing price id, the - * `model_type` and configuration. (See the [Price resource](../reference/price) for the - * specification of different price model configurations.) The numerical values can be updated, - * but the billable metric, cadence, type, and name of a price can not be overridden. + * `model_type` and configuration. (See the + * [Price resource](/product-catalog/price-configuration) for the specification of different + * price model configurations.) The numerical values can be updated, but the billable metric, + * cadence, type, and name of a price can not be overridden. * * ### Maximums and Minimums * @@ -353,9 +356,9 @@ constructor( /** * This endpoint returns a list of all subscriptions for an account 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). * * Subscriptions can be filtered for a specific customer by using either the customer_id or * external_customer_id query parameters. To filter subscriptions for multiple customers, use @@ -441,8 +444,7 @@ constructor( * issued invoice, Orb will generate a balance refund for the current period. If the * cancellation is before the most recently issued invoice, Orb will void the intervening * invoice and generate a new one based on the new dates for the subscription. See the section - * on - * [cancellation behaviors](../guides/product-catalog/creating-subscriptions.md#cancellation-behaviors). + * on [cancellation behaviors](/product-catalog/creating-subscriptions#cancellation-behaviors). */ override fun cancel( params: SubscriptionCancelParams, @@ -473,7 +475,7 @@ constructor( jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** - * This endpoint is used to fetch a [Subscription](../guides/concepts#subscription) given an + * This endpoint is used to fetch a [Subscription](/core-concepts##subscription) given an * identifier. */ override fun fetch( @@ -544,7 +546,7 @@ constructor( .withErrorHandler(errorHandler) /** - * This endpoint returns a [paginated](../reference/pagination) list of all plans associated + * This endpoint returns a [paginated](/api-reference/pagination) list of all plans associated * with a subscription along with their start and end dates. This list contains the * subscription's initial plan along with past and future plan changes. */ @@ -783,9 +785,9 @@ constructor( /** * This endpoint is used to add and edit subscription - * [price intervals](../reference/price-interval). By making modifications to a subscription’s - * price intervals, you can - * [flexibly and atomically control the billing behavior of a subscription](../guides/product-catalog/modifying-subscriptions). + * [price intervals](/api-reference/price-interval/add-or-edit-price-intervals). By making + * modifications to a subscription’s price intervals, you can + * [flexibly and atomically control the billing behavior of a subscription](/product-catalog/modifying-subscriptions). * * ## Adding price intervals * @@ -916,26 +918,27 @@ constructor( * you schedule the plan change. This is useful when a customer has prices that differ from the * default prices for a specific plan. * - * :::info This feature is only available for accounts that have migrated to Subscription + * This feature is only available for accounts that have migrated to Subscription * Overrides Version 2. You can find your Subscription Overrides Version at the bottom of your - * [Plans page](https://app.withorb.com/plans) ::: + * [Plans page](https://app.withorb.com/plans) * * ### Adding Prices * * To add prices, provide a list of objects with the key `add_prices`. An object in the list * must specify an existing add-on price with a `price_id` or `external_price_id` field, or * create a new add-on price by including an object with the key `price`, identical to what - * would be used in the request body for the [create price endpoint](../reference/create-price). - * See the [Price resource](../reference/price) for the specification of different price model - * configurations possible in this object. + * would be used in the request body for the + * [create price endpoint](/api-reference/price/create-price). See the + * [Price resource](/product-catalog/price-configuration) for the specification of different + * price model configurations possible in this object. * * If the plan has phases, each object in the list must include a number with `plan_phase_order` * key to indicate which phase the price should be added to. * * An object in the list can specify an optional `start_date` and optional `end_date`. This is * equivalent to creating a price interval with the - * [add/edit price intervals endpoint](../reference/add-edit-price-intervals). If unspecified, - * the start or end date of the phase or subscription will be used. + * [add/edit price intervals endpoint](/api-reference/price-interval/add-or-edit-price-intervals). + * If unspecified, the start or end date of the phase or subscription will be used. * * An object in the list can specify an optional `minimum_amount`, `maximum_amount`, or * `discounts`. This will create adjustments which apply only to this price. @@ -957,14 +960,14 @@ constructor( * specify a price to replace it with by either referencing an existing add-on price with a * `price_id` or `external_price_id` field, or by creating a new add-on price by including an * object with the key `price`, identical to what would be used in the request body for the - * [create price endpoint](../reference/create-price). See the - * [Price resource](../reference/price) for the specification of different price model - * configurations possible in this object. + * [create price endpoint](/api-reference/price/create-price). See the + * [Price resource](/product-catalog/price-configuration) for the specification of different + * price model configurations possible in this object. * * For fixed fees, an object in the list can supply a `fixed_price_quantity` instead of a * `price`, `price_id`, or `external_price_id` field. This will update only the quantity for the - * price, similar to the [Update price quantity](../reference/update-fixed-fee-quantity) - * endpoint. + * price, similar to the + * [Update price quantity](/api-reference/subscription/update-price-quantity) endpoint. * * The replacement price will have the same phase, if applicable, and the same start and end * dates as the price it replaces. @@ -981,7 +984,8 @@ constructor( * * To add adjustments, provide a list of objects with the key `add_adjustments`. An object in * the list must include an object with the key `adjustment`, identical to the adjustment object - * in the [add/edit price intervals endpoint](../reference/add-edit-price-intervals). + * in the + * [add/edit price intervals endpoint](/api-reference/price-interval/add-or-edit-price-intervals). * * If the plan has phases, each object in the list must include a number with `plan_phase_order` * key to indicate which phase the adjustment should be added to. @@ -1000,16 +1004,16 @@ constructor( * object in the list must specify a plan adjustment to replace with the * `replaces_adjustment_id` key, and it must specify an adjustment to replace it with by * including an object with the key `adjustment`, identical to the adjustment object in the - * [add/edit price intervals endpoint](../reference/add-edit-price-intervals). + * [add/edit price intervals endpoint](/api-reference/price-interval/add-or-edit-price-intervals). * * The replacement adjustment will have the same phase, if applicable, and the same start and * end dates as the adjustment it replaces. * * ## Price overrides (DEPRECATED) * - * :::info Price overrides are being phased out in favor adding/removing/replacing prices. (See - * [Customize your customer's subscriptions](../reference/schedule-plan-change#customize-your-customers-subscriptions)) - * ::: + * Price overrides are being phased out in favor adding/removing/replacing prices. (See + * [Customize your customer's subscriptions](/api-reference/subscription/schedule-plan-change)) + * * * Price overrides are used to update some or all prices in a plan for the specific subscription * being created. This is useful when a new customer has negotiated a rate that is unique to the @@ -1017,9 +1021,10 @@ constructor( * * To override prices, provide a list of objects with the key `price_overrides`. The price * object in the list of overrides is expected to contain the existing price id, the - * `model_type` and configuration. (See the [Price resource](../reference/price) for the - * specification of different price model configurations.) The numerical values can be updated, - * but the billable metric, cadence, type, and name of a price can not be overridden. + * `model_type` and configuration. (See the + * [Price resource](/product-catalog/price-configuration) for the specification of different + * price model configurations.) The numerical values can be updated, but the billable metric, + * cadence, type, and name of a price can not be overridden. * * ### Maximums, and minimums * @@ -1038,7 +1043,7 @@ constructor( * * By default, Orb calculates the prorated difference in any fixed fees when making a plan * change, adjusting the customer balance as needed. For details on this behavior, see - * [Modifying subscriptions](../guides/product-catalog/modifying-subscriptions.md#prorations-for-in-advance-fees). + * [Modifying subscriptions](/product-catalog/modifying-subscriptions#prorations-for-in-advance-fees). */ override fun schedulePlanChange( params: SubscriptionSchedulePlanChangeParams, diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/coupons/SubscriptionService.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/coupons/SubscriptionService.kt index e8c38ab8..fea9ef1b 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/coupons/SubscriptionService.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/coupons/SubscriptionService.kt @@ -12,9 +12,9 @@ interface SubscriptionService { /** * 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). */ @JvmOverloads fun list( diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/coupons/SubscriptionServiceImpl.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/coupons/SubscriptionServiceImpl.kt index 4d2b2361..5ec92bc9 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/coupons/SubscriptionServiceImpl.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/coupons/SubscriptionServiceImpl.kt @@ -27,9 +27,9 @@ constructor( /** * 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). */ override fun list( params: CouponSubscriptionListParams, diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/customers/CostService.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/customers/CostService.kt index 7d4aa41f..3825eafb 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/customers/CostService.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/customers/CostService.kt @@ -15,8 +15,8 @@ interface CostService { /** * 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: @@ -24,8 +24,8 @@ interface CostService { * 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 @@ -131,8 +131,8 @@ interface CostService { /** * 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: @@ -140,8 +140,8 @@ interface CostService { * 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 diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/customers/CostServiceImpl.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/customers/CostServiceImpl.kt index 8dd6fcc6..8f8e46a6 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/customers/CostServiceImpl.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/customers/CostServiceImpl.kt @@ -30,8 +30,8 @@ constructor( /** * 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: @@ -39,8 +39,8 @@ constructor( * 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 @@ -168,8 +168,8 @@ constructor( /** * 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: @@ -177,8 +177,8 @@ constructor( * 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 diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/customers/credits/LedgerService.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/customers/credits/LedgerService.kt index b09ee73b..2b43dc64 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/customers/credits/LedgerService.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/customers/credits/LedgerService.kt @@ -19,11 +19,11 @@ interface LedgerService { /** * 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 + * [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). + * [here](/product-catalog/prepurchase). * * There are four major types of modifications to credit balance, detailed below. * @@ -322,11 +322,11 @@ interface LedgerService { /** * 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 + * [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). + * [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/services/blocking/customers/credits/LedgerServiceImpl.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/customers/credits/LedgerServiceImpl.kt index b7b1a134..931846c6 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/customers/credits/LedgerServiceImpl.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/customers/credits/LedgerServiceImpl.kt @@ -35,11 +35,11 @@ constructor( /** * 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 + * [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). + * [here](/product-catalog/prepurchase). * * There are four major types of modifications to credit balance, detailed below. * @@ -415,11 +415,11 @@ constructor( /** * 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 + * [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). + * [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/services/blocking/events/BackfillService.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/events/BackfillService.kt index 743924ac..4d7a2f20 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/events/BackfillService.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/events/BackfillService.kt @@ -42,9 +42,9 @@ interface BackfillService { * events 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 + * timeframe 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 + * [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. */ @@ -58,7 +58,7 @@ interface BackfillService { * 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 + * 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). */ diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/events/BackfillServiceImpl.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/events/BackfillServiceImpl.kt index 0fc9f355..e16fd8f6 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/events/BackfillServiceImpl.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/events/BackfillServiceImpl.kt @@ -58,9 +58,9 @@ constructor( * events 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 + * timeframe 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 + * [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. */ @@ -97,7 +97,7 @@ constructor( * 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 + * 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). */ diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/events/VolumeService.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/events/VolumeService.kt index 45320d15..e28d16d6 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/events/VolumeService.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/events/VolumeService.kt @@ -12,12 +12,12 @@ interface VolumeService { /** * 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 diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/events/VolumeServiceImpl.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/events/VolumeServiceImpl.kt index 3c84099d..23578dd3 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/events/VolumeServiceImpl.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/events/VolumeServiceImpl.kt @@ -26,12 +26,12 @@ constructor( /** * 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 diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/plans/ExternalPlanIdService.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/plans/ExternalPlanIdService.kt index 4bad4338..e08eac13 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/plans/ExternalPlanIdService.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/plans/ExternalPlanIdService.kt @@ -24,7 +24,7 @@ interface ExternalPlanIdService { ): Plan /** - * 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. * @@ -35,10 +35,10 @@ interface ExternalPlanIdService { * ## 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 + * serialized 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). " + * [Price schema](/core-concepts#plan-and-price). " */ @JvmOverloads fun fetch( diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/plans/ExternalPlanIdServiceImpl.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/plans/ExternalPlanIdServiceImpl.kt index 8d380b0e..acb28514 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/plans/ExternalPlanIdServiceImpl.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/plans/ExternalPlanIdServiceImpl.kt @@ -61,7 +61,7 @@ constructor( jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** - * 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. * @@ -72,10 +72,10 @@ constructor( * ## 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 + * serialized 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). " + * [Price schema](/core-concepts#plan-and-price). " */ override fun fetch( params: PlanExternalPlanIdFetchParams, diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/prices/ExternalPriceIdService.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/prices/ExternalPriceIdService.kt index 786bd953..b656beb8 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/prices/ExternalPriceIdService.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/prices/ExternalPriceIdService.kt @@ -23,8 +23,8 @@ interface ExternalPriceIdService { /** * This endpoint returns a price given an external price id. See the - * [price creation API](../reference/create-price) for more information about external price - * aliases. + * [price creation API](/api-reference/price/create-price) for more information about external + * price aliases. */ @JvmOverloads fun fetch( diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/prices/ExternalPriceIdServiceImpl.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/prices/ExternalPriceIdServiceImpl.kt index 91d08eeb..3e152b9d 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/prices/ExternalPriceIdServiceImpl.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/prices/ExternalPriceIdServiceImpl.kt @@ -60,8 +60,8 @@ constructor( /** * This endpoint returns a price given an external price id. See the - * [price creation API](../reference/create-price) for more information about external price - * aliases. + * [price creation API](/api-reference/price/create-price) for more information about external + * price aliases. */ override fun fetch( params: PriceExternalPriceIdFetchParams,