diff --git a/.release-please-manifest.json b/.release-please-manifest.json index caf5ca3f..59acac47 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.26.0" + ".": "0.27.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 0c16dd10..ae59be0a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 103 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-8663e8fc543041d9694eddcd2f7e9784611369606700f99340e6dc80607b2dfa.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-0dbb8ba730f755468357ebda41332664e8396faf29a6a6a64ad37cf35cf70d0c.yml diff --git a/CHANGELOG.md b/CHANGELOG.md index 42d16fdd..06678905 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,24 @@ # Changelog +## 0.27.0 (2025-02-04) + +Full Changelog: [v0.26.0...v0.27.0](https://github.com/orbcorp/orb-java/compare/v0.26.0...v0.27.0) + +### Features + +* **api:** api update ([#229](https://github.com/orbcorp/orb-java/issues/229)) ([a0b4d91](https://github.com/orbcorp/orb-java/commit/a0b4d9178723acb177202d88d4355ae8d4dd3196)) +* **client:** send client-side timeout headers ([#228](https://github.com/orbcorp/orb-java/issues/228)) ([720ac83](https://github.com/orbcorp/orb-java/commit/720ac83e1167d1c24dd71e2d2b7b98b0390c0f17)) + + +### Chores + +* **internal:** codegen related update ([#224](https://github.com/orbcorp/orb-java/issues/224)) ([ba91826](https://github.com/orbcorp/orb-java/commit/ba91826dde6c642771682ce5b56f61638bcab7a5)) + + +### Documentation + +* fix incorrect additional properties info ([#227](https://github.com/orbcorp/orb-java/issues/227)) ([8fe2133](https://github.com/orbcorp/orb-java/commit/8fe2133556f1cd283180a045f47a084b40664502)) + ## 0.26.0 (2025-01-30) Full Changelog: [v0.25.0...v0.26.0](https://github.com/orbcorp/orb-java/compare/v0.25.0...v0.26.0) diff --git a/README.md b/README.md index a5549cf6..ba590f44 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.26.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.27.0) @@ -19,7 +19,7 @@ The REST API documentation can be found on [docs.withorb.com](https://docs.witho ### Gradle ```kotlin -implementation("com.withorb.api:orb-java:0.26.0") +implementation("com.withorb.api:orb-java:0.27.0") ``` ### Maven @@ -28,7 +28,7 @@ implementation("com.withorb.api:orb-java:0.26.0") com.withorb.api orb-java - 0.26.0 + 0.27.0 ``` @@ -140,19 +140,7 @@ See [Pagination](#pagination) below for more information on transparently workin To make a request to the Orb API, you generally build an instance of the appropriate `Params` class. -In [Example: creating a resource](#example-creating-a-resource) above, we used the `CustomerCreateParams.builder()` to pass to the `create` method of the `customers` service. - -Sometimes, the API may support other properties that are not yet supported in the Java SDK types. In that case, you can attach them using the `putAdditionalProperty` method. - -```java -import com.withorb.api.core.JsonValue; -import com.withorb.api.models.CustomerCreateParams; - -CustomerCreateParams params = CustomerCreateParams.builder() - // ... normal properties - .putAdditionalProperty("secret_param", JsonValue.from("4242")) - .build(); -``` +See [Undocumented request params](#undocumented-request-params) for how to send arbitrary parameters. ## Responses @@ -344,18 +332,26 @@ This library is typed for convenient access to the documented API. If you need t ### Undocumented request params -To make requests using undocumented parameters, you can provide or override parameters on the params object while building it. +In [Example: creating a resource](#example-creating-a-resource) above, we used the `CustomerCreateParams.builder()` to pass to the `create` method of the `customers` service. + +Sometimes, the API may support other properties that are not yet supported in the Java SDK types. In that case, you can attach them using raw setters: ```java -FooCreateParams address = FooCreateParams.builder() - .id("my_id") - .putAdditionalProperty("secret_prop", JsonValue.from("hello")) +import com.withorb.api.core.JsonValue; +import com.withorb.api.models.CustomerCreateParams; + +CustomerCreateParams params = CustomerCreateParams.builder() + .putAdditionalHeader("Secret-Header", "42") + .putAdditionalQueryParam("secret_query_param", "42") + .putAdditionalBodyProperty("secretProperty", JsonValue.from("42")) .build(); ``` +You can also use the `putAdditionalProperty` method on nested headers, query params, or body objects. + ### Undocumented response properties -To access undocumented response properties, you can use `res._additionalProperties()` on a response object to get a map of untyped fields of type `Map`. You can then access fields like `._additionalProperties().get("secret_prop").asString()` or use other helpers defined on the `JsonValue` class to extract it to a desired type. +To access undocumented response properties, you can use `res._additionalProperties()` on a response object to get a map of untyped fields of type `Map`. You can then access fields like `res._additionalProperties().get("secret_prop").asString()` or use other helpers defined on the `JsonValue` class to extract it to a desired type. ## Logging diff --git a/build.gradle.kts b/build.gradle.kts index 25877df7..bdcbace5 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,4 +1,4 @@ allprojects { group = "com.withorb.api" - version = "0.26.0" // x-release-please-version + version = "0.27.0" // x-release-please-version } diff --git a/orb-java-client-okhttp/src/main/kotlin/com/withorb/api/client/okhttp/OkHttpClient.kt b/orb-java-client-okhttp/src/main/kotlin/com/withorb/api/client/okhttp/OkHttpClient.kt index 3484d4e1..74283f2f 100644 --- a/orb-java-client-okhttp/src/main/kotlin/com/withorb/api/client/okhttp/OkHttpClient.kt +++ b/orb-java-client-okhttp/src/main/kotlin/com/withorb/api/client/okhttp/OkHttpClient.kt @@ -31,38 +31,11 @@ class OkHttpClient private constructor(private val okHttpClient: okhttp3.OkHttpClient, private val baseUrl: HttpUrl) : HttpClient { - private fun getClient(requestOptions: RequestOptions): okhttp3.OkHttpClient { - val clientBuilder = okHttpClient.newBuilder() - - val logLevel = - when (System.getenv("ORB_LOG")?.lowercase()) { - "info" -> HttpLoggingInterceptor.Level.BASIC - "debug" -> HttpLoggingInterceptor.Level.BODY - else -> null - } - if (logLevel != null) { - clientBuilder.addNetworkInterceptor( - HttpLoggingInterceptor().setLevel(logLevel).apply { redactHeader("Authorization") } - ) - } - - val timeout = requestOptions.timeout - if (timeout != null) { - clientBuilder - .connectTimeout(timeout) - .readTimeout(timeout) - .writeTimeout(timeout) - .callTimeout(if (timeout.seconds == 0L) timeout else timeout.plusSeconds(30)) - } - - return clientBuilder.build() - } - override fun execute( request: HttpRequest, requestOptions: RequestOptions, ): HttpResponse { - val call = getClient(requestOptions).newCall(request.toRequest()) + val call = newCall(request, requestOptions) return try { call.execute().toResponse() @@ -81,18 +54,18 @@ private constructor(private val okHttpClient: okhttp3.OkHttpClient, private val request.body?.run { future.whenComplete { _, _ -> close() } } - val call = getClient(requestOptions).newCall(request.toRequest()) - call.enqueue( - object : Callback { - override fun onResponse(call: Call, response: Response) { - future.complete(response.toResponse()) - } + newCall(request, requestOptions) + .enqueue( + object : Callback { + override fun onResponse(call: Call, response: Response) { + future.complete(response.toResponse()) + } - override fun onFailure(call: Call, e: IOException) { - future.completeExceptionally(OrbIoException("Request failed", e)) + override fun onFailure(call: Call, e: IOException) { + future.completeExceptionally(OrbIoException("Request failed", e)) + } } - } - ) + ) return future } @@ -103,7 +76,35 @@ private constructor(private val okHttpClient: okhttp3.OkHttpClient, private val okHttpClient.cache?.close() } - private fun HttpRequest.toRequest(): Request { + private fun newCall(request: HttpRequest, requestOptions: RequestOptions): Call { + val clientBuilder = okHttpClient.newBuilder() + + val logLevel = + when (System.getenv("ORB_LOG")?.lowercase()) { + "info" -> HttpLoggingInterceptor.Level.BASIC + "debug" -> HttpLoggingInterceptor.Level.BODY + else -> null + } + if (logLevel != null) { + clientBuilder.addNetworkInterceptor( + HttpLoggingInterceptor().setLevel(logLevel).apply { redactHeader("Authorization") } + ) + } + + val timeout = requestOptions.timeout + if (timeout != null) { + clientBuilder + .connectTimeout(timeout) + .readTimeout(timeout) + .writeTimeout(timeout) + .callTimeout(if (timeout.seconds == 0L) timeout else timeout.plusSeconds(30)) + } + + val client = clientBuilder.build() + return client.newCall(request.toRequest(client)) + } + + private fun HttpRequest.toRequest(client: okhttp3.OkHttpClient): Request { var body: RequestBody? = body?.toRequestBody() // OkHttpClient always requires a request body for PUT and POST methods. if (body == null && (method == HttpMethod.PUT || method == HttpMethod.POST)) { @@ -115,6 +116,21 @@ private constructor(private val okHttpClient: okhttp3.OkHttpClient, private val headers.values(name).forEach { builder.header(name, it) } } + if ( + !headers.names().contains("X-Stainless-Read-Timeout") && client.readTimeoutMillis != 0 + ) { + builder.header( + "X-Stainless-Read-Timeout", + Duration.ofMillis(client.readTimeoutMillis.toLong()).seconds.toString() + ) + } + if (!headers.names().contains("X-Stainless-Timeout") && client.callTimeoutMillis != 0) { + builder.header( + "X-Stainless-Timeout", + Duration.ofMillis(client.callTimeoutMillis.toLong()).seconds.toString() + ) + } + return builder.build() } @@ -171,7 +187,7 @@ private constructor(private val okHttpClient: okhttp3.OkHttpClient, private val @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var baseUrl: HttpUrl? = null // The default timeout is 1 minute. diff --git a/orb-java-client-okhttp/src/main/kotlin/com/withorb/api/client/okhttp/OrbOkHttpClient.kt b/orb-java-client-okhttp/src/main/kotlin/com/withorb/api/client/okhttp/OrbOkHttpClient.kt index 70382242..442c5824 100644 --- a/orb-java-client-okhttp/src/main/kotlin/com/withorb/api/client/okhttp/OrbOkHttpClient.kt +++ b/orb-java-client-okhttp/src/main/kotlin/com/withorb/api/client/okhttp/OrbOkHttpClient.kt @@ -22,7 +22,8 @@ class OrbOkHttpClient private constructor() { @JvmStatic fun fromEnv(): OrbClient = builder().fromEnv().build() } - class Builder { + /** A builder for [OrbOkHttpClient]. */ + class Builder internal constructor() { private var clientOptions: ClientOptions.Builder = ClientOptions.builder() private var baseUrl: String = ClientOptions.PRODUCTION_URL diff --git a/orb-java-client-okhttp/src/main/kotlin/com/withorb/api/client/okhttp/OrbOkHttpClientAsync.kt b/orb-java-client-okhttp/src/main/kotlin/com/withorb/api/client/okhttp/OrbOkHttpClientAsync.kt index 36e46218..3c9e6f22 100644 --- a/orb-java-client-okhttp/src/main/kotlin/com/withorb/api/client/okhttp/OrbOkHttpClientAsync.kt +++ b/orb-java-client-okhttp/src/main/kotlin/com/withorb/api/client/okhttp/OrbOkHttpClientAsync.kt @@ -22,7 +22,8 @@ class OrbOkHttpClientAsync private constructor() { @JvmStatic fun fromEnv(): OrbClientAsync = builder().fromEnv().build() } - class Builder { + /** A builder for [OrbOkHttpClientAsync]. */ + class Builder internal constructor() { private var clientOptions: ClientOptions.Builder = ClientOptions.builder() private var baseUrl: String = ClientOptions.PRODUCTION_URL diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/client/OrbClient.kt b/orb-java-core/src/main/kotlin/com/withorb/api/client/OrbClient.kt index 8f4221f3..b256deff 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/client/OrbClient.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/client/OrbClient.kt @@ -18,8 +18,28 @@ import com.withorb.api.services.blocking.SubscriptionService import com.withorb.api.services.blocking.TopLevelService import com.withorb.api.services.blocking.WebhookService +/** + * A client for interacting with the Orb REST API synchronously. You can also switch to asynchronous + * execution via the [async] method. + * + * This client performs best when you create a single instance and reuse it for all interactions + * with the REST API. This is because each client holds its own connection pool and thread pools. + * Reusing connections and threads reduces latency and saves memory. The client also handles rate + * limiting per client. This means that creating and using multiple instances at the same time will + * not respect rate limits. + * + * The threads and connections that are held will be released automatically if they remain idle. But + * if you are writing an application that needs to aggressively release unused resources, then you + * may call [close]. + */ interface OrbClient { + /** + * Returns a version of this client that uses asynchronous execution. + * + * The returned client shares its resources, like its connection pool and thread pools, with + * this client. + */ fun async(): OrbClientAsync fun topLevel(): TopLevelService @@ -46,9 +66,22 @@ interface OrbClient { fun subscriptions(): SubscriptionService + fun webhooks(): WebhookService + fun alerts(): AlertService fun dimensionalPriceGroups(): DimensionalPriceGroupService - fun webhooks(): WebhookService + /** + * Closes this client, relinquishing any underlying resources. + * + * This is purposefully not inherited from [AutoCloseable] because the client is long-lived and + * usually should not be synchronously closed via try-with-resources. + * + * It's also usually not necessary to call this method at all. the default HTTP client + * automatically releases threads and connections if they remain idle, but if you are writing an + * application that needs to aggressively release unused resources, then you may call this + * method. + */ + fun close() } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/client/OrbClientAsync.kt b/orb-java-core/src/main/kotlin/com/withorb/api/client/OrbClientAsync.kt index 161df6c8..61f2d9d7 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/client/OrbClientAsync.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/client/OrbClientAsync.kt @@ -17,8 +17,28 @@ import com.withorb.api.services.async.PriceServiceAsync import com.withorb.api.services.async.SubscriptionServiceAsync import com.withorb.api.services.async.TopLevelServiceAsync +/** + * A client for interacting with the Orb REST API asynchronously. You can also switch to synchronous + * execution via the [sync] method. + * + * This client performs best when you create a single instance and reuse it for all interactions + * with the REST API. This is because each client holds its own connection pool and thread pools. + * Reusing connections and threads reduces latency and saves memory. The client also handles rate + * limiting per client. This means that creating and using multiple instances at the same time will + * not respect rate limits. + * + * The threads and connections that are held will be released automatically if they remain idle. But + * if you are writing an application that needs to aggressively release unused resources, then you + * may call [close]. + */ interface OrbClientAsync { + /** + * Returns a version of this client that uses synchronous execution. + * + * The returned client shares its resources, like its connection pool and thread pools, with + * this client. + */ fun sync(): OrbClient fun topLevel(): TopLevelServiceAsync @@ -48,4 +68,17 @@ interface OrbClientAsync { fun alerts(): AlertServiceAsync fun dimensionalPriceGroups(): DimensionalPriceGroupServiceAsync + + /** + * Closes this client, relinquishing any underlying resources. + * + * This is purposefully not inherited from [AutoCloseable] because the client is long-lived and + * usually should not be synchronously closed via try-with-resources. + * + * It's also usually not necessary to call this method at all. the default HTTP client + * automatically releases threads and connections if they remain idle, but if you are writing an + * application that needs to aggressively release unused resources, then you may call this + * method. + */ + fun close() } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/client/OrbClientAsyncImpl.kt b/orb-java-core/src/main/kotlin/com/withorb/api/client/OrbClientAsyncImpl.kt index ba6efc41..71cadda5 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/client/OrbClientAsyncImpl.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/client/OrbClientAsyncImpl.kt @@ -33,8 +33,7 @@ import com.withorb.api.services.async.SubscriptionServiceAsyncImpl import com.withorb.api.services.async.TopLevelServiceAsync import com.withorb.api.services.async.TopLevelServiceAsyncImpl -class OrbClientAsyncImpl -constructor( +class OrbClientAsyncImpl( private val clientOptions: ClientOptions, ) : OrbClientAsync { @@ -131,4 +130,6 @@ constructor( override fun dimensionalPriceGroups(): DimensionalPriceGroupServiceAsync = dimensionalPriceGroups + + override fun close() = clientOptions.httpClient.close() } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/client/OrbClientImpl.kt b/orb-java-core/src/main/kotlin/com/withorb/api/client/OrbClientImpl.kt index 6f0bec20..adf67509 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/client/OrbClientImpl.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/client/OrbClientImpl.kt @@ -35,8 +35,7 @@ import com.withorb.api.services.blocking.TopLevelServiceImpl import com.withorb.api.services.blocking.WebhookService import com.withorb.api.services.blocking.WebhookServiceImpl -class OrbClientImpl -constructor( +class OrbClientImpl( private val clientOptions: ClientOptions, ) : OrbClient { @@ -119,9 +118,11 @@ constructor( override fun subscriptions(): SubscriptionService = subscriptions + override fun webhooks(): WebhookService = webhooks + override fun alerts(): AlertService = alerts override fun dimensionalPriceGroups(): DimensionalPriceGroupService = dimensionalPriceGroups - override fun webhooks(): WebhookService = webhooks + override fun close() = clientOptions.httpClient.close() } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/core/ClientOptions.kt b/orb-java-core/src/main/kotlin/com/withorb/api/core/ClientOptions.kt index 7eea461c..796f695d 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/core/ClientOptions.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/core/ClientOptions.kt @@ -37,7 +37,8 @@ private constructor( @JvmStatic fun fromEnv(): ClientOptions = builder().fromEnv().build() } - class Builder { + /** A builder for [ClientOptions]. */ + class Builder internal constructor() { private var httpClient: HttpClient? = null private var jsonMapper: JsonMapper = jsonMapper() diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/core/Params.kt b/orb-java-core/src/main/kotlin/com/withorb/api/core/Params.kt new file mode 100644 index 00000000..e9c719da --- /dev/null +++ b/orb-java-core/src/main/kotlin/com/withorb/api/core/Params.kt @@ -0,0 +1,16 @@ +package com.withorb.api.core + +import com.withorb.api.core.http.Headers +import com.withorb.api.core.http.QueryParams + +/** An interface representing parameters passed to a service method. */ +interface Params { + /** The full set of headers in the parameters, including both fixed and additional headers. */ + fun _headers(): Headers + + /** + * The full set of query params in the parameters, including both fixed and additional query + * params. + */ + fun _queryParams(): QueryParams +} diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/core/PrepareRequest.kt b/orb-java-core/src/main/kotlin/com/withorb/api/core/PrepareRequest.kt new file mode 100644 index 00000000..1a4592ad --- /dev/null +++ b/orb-java-core/src/main/kotlin/com/withorb/api/core/PrepareRequest.kt @@ -0,0 +1,24 @@ +@file:JvmName("PrepareRequest") + +package com.withorb.api.core + +import com.withorb.api.core.http.HttpRequest +import java.util.concurrent.CompletableFuture + +@JvmSynthetic +internal fun HttpRequest.prepare(clientOptions: ClientOptions, params: Params): HttpRequest = + toBuilder() + .putAllQueryParams(clientOptions.queryParams) + .replaceAllQueryParams(params._queryParams()) + .putAllHeaders(clientOptions.headers) + .replaceAllHeaders(params._headers()) + .build() + +@JvmSynthetic +internal fun HttpRequest.prepareAsync( + clientOptions: ClientOptions, + params: Params +): CompletableFuture = + // This async version exists to make it easier to add async specific preparation logic in the + // future. + CompletableFuture.completedFuture(prepare(clientOptions, params)) diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/core/RequestOptions.kt b/orb-java-core/src/main/kotlin/com/withorb/api/core/RequestOptions.kt index 8aeae2a9..5d9b4401 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/core/RequestOptions.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/core/RequestOptions.kt @@ -23,7 +23,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { + private var responseValidation: Boolean? = null private var timeout: Duration? = null diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/core/http/Headers.kt b/orb-java-core/src/main/kotlin/com/withorb/api/core/http/Headers.kt index 25aa7f71..8bec2dde 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/core/http/Headers.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/core/http/Headers.kt @@ -22,7 +22,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private val map: MutableMap> = TreeMap(String.CASE_INSENSITIVE_ORDER) diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/core/http/HttpRequest.kt b/orb-java-core/src/main/kotlin/com/withorb/api/core/http/HttpRequest.kt index 5aed352c..a5a3aaab 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/core/http/HttpRequest.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/core/http/HttpRequest.kt @@ -22,7 +22,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var method: HttpMethod? = null private var url: String? = null diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/core/http/QueryParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/core/http/QueryParams.kt index 53c19d9f..b09686de 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/core/http/QueryParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/core/http/QueryParams.kt @@ -21,7 +21,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private val map: MutableMap> = mutableMapOf() private var size: Int = 0 diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/core/http/RetryingHttpClient.kt b/orb-java-core/src/main/kotlin/com/withorb/api/core/http/RetryingHttpClient.kt index a31f46fa..ba6f4dda 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/core/http/RetryingHttpClient.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/core/http/RetryingHttpClient.kt @@ -57,15 +57,17 @@ private constructor( } response - } catch (t: Throwable) { - if (++retries > maxRetries || !shouldRetry(t)) { - throw t + } catch (throwable: Throwable) { + if (++retries > maxRetries || !shouldRetry(throwable)) { + throw throwable } null } val backoffMillis = getRetryBackoffMillis(retries, response) + // All responses must be closed, so close the failed one before retrying. + response?.close() Thread.sleep(backoffMillis.toMillis()) } } @@ -113,6 +115,8 @@ private constructor( } val backoffMillis = getRetryBackoffMillis(retries, response) + // All responses must be closed, so close the failed one before retrying. + response?.close() return sleepAsync(backoffMillis.toMillis()).thenCompose { executeWithRetries(requestWithRetryCount, requestOptions) } @@ -223,27 +227,27 @@ private constructor( return Duration.ofNanos((TimeUnit.SECONDS.toNanos(1) * backoffSeconds * jitter).toLong()) } - private fun sleepAsync(millis: Long): CompletableFuture { - val future = CompletableFuture() - TIMER.schedule( - object : TimerTask() { - override fun run() { - future.complete(null) - } - }, - millis - ) - return future - } - companion object { private val TIMER = Timer("RetryingHttpClient", true) + private fun sleepAsync(millis: Long): CompletableFuture { + val future = CompletableFuture() + TIMER.schedule( + object : TimerTask() { + override fun run() { + future.complete(null) + } + }, + millis + ) + return future + } + @JvmStatic fun builder() = Builder() } - class Builder { + class Builder internal constructor() { private var httpClient: HttpClient? = null private var clock: Clock = Clock.systemUTC() diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/errors/OrbError.kt b/orb-java-core/src/main/kotlin/com/withorb/api/errors/OrbError.kt index 50c17f36..172a304f 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/errors/OrbError.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/errors/OrbError.kt @@ -30,7 +30,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [OrbError]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() 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 7a1b4a84..321ab11e 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 @@ -156,7 +156,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Alert]. */ + class Builder internal constructor() { private var id: JsonField? = null private var createdAt: JsonField? = null @@ -365,7 +366,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Customer]. */ + class Builder internal constructor() { private var id: JsonField? = null private var externalCustomerId: JsonField? = null @@ -473,7 +475,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metric]. */ + class Builder internal constructor() { private var id: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -603,7 +606,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Plan]. */ + class Builder internal constructor() { private var id: JsonField? = null private var externalPlanId: JsonField? = null @@ -746,7 +750,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Subscription]. */ + class Builder internal constructor() { private var id: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -849,7 +854,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Threshold]. */ + class Builder internal constructor() { private var value: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -922,6 +928,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -939,6 +953,7 @@ private constructor( @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } + /** An enum containing [Type]'s known values. */ enum class Known { USAGE_EXCEEDED, COST_EXCEEDED, @@ -947,15 +962,32 @@ private constructor( CREDIT_BALANCE_RECOVERED, } + /** + * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Type] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { USAGE_EXCEEDED, COST_EXCEEDED, CREDIT_BALANCE_DEPLETED, CREDIT_BALANCE_DROPPED, CREDIT_BALANCE_RECOVERED, + /** An enum member indicating that [Type] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { USAGE_EXCEEDED -> Value.USAGE_EXCEEDED @@ -966,6 +998,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { USAGE_EXCEEDED -> Known.USAGE_EXCEEDED 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 aa1a4cd2..17954d4a 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 @@ -12,6 +12,7 @@ import com.withorb.api.core.JsonField import com.withorb.api.core.JsonMissing import com.withorb.api.core.JsonValue import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -30,12 +31,12 @@ import java.util.Optional * `credit_balance_recovered` alerts do not require thresholds. */ class AlertCreateForCustomerParams -constructor( +private constructor( private val customerId: String, private val body: AlertCreateForCustomerBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun customerId(): String = customerId @@ -63,11 +64,11 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getBody(): AlertCreateForCustomerBody = body + @JvmSynthetic internal fun _body(): AlertCreateForCustomerBody = body - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun getPathParam(index: Int): String { return when (index) { @@ -136,7 +137,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AlertCreateForCustomerBody]. */ + class Builder internal constructor() { private var currency: JsonField? = null private var type: JsonField? = null @@ -244,8 +246,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [AlertCreateForCustomerParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var customerId: String? = null private var body: AlertCreateForCustomerBody.Builder = AlertCreateForCustomerBody.builder() @@ -421,6 +424,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -438,6 +449,7 @@ constructor( @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } + /** An enum containing [Type]'s known values. */ enum class Known { USAGE_EXCEEDED, COST_EXCEEDED, @@ -446,15 +458,32 @@ constructor( CREDIT_BALANCE_RECOVERED, } + /** + * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Type] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { USAGE_EXCEEDED, COST_EXCEEDED, CREDIT_BALANCE_DEPLETED, CREDIT_BALANCE_DROPPED, CREDIT_BALANCE_RECOVERED, + /** An enum member indicating that [Type] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { USAGE_EXCEEDED -> Value.USAGE_EXCEEDED @@ -465,6 +494,14 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { USAGE_EXCEEDED -> Known.USAGE_EXCEEDED @@ -538,7 +575,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Threshold]. */ + class Builder internal constructor() { private var value: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() 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 0475ed90..a5cd29b0 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 @@ -12,6 +12,7 @@ import com.withorb.api.core.JsonField import com.withorb.api.core.JsonMissing import com.withorb.api.core.JsonValue import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -30,12 +31,12 @@ import java.util.Optional * `credit_balance_recovered` alerts do not require thresholds. */ class AlertCreateForExternalCustomerParams -constructor( +private constructor( private val externalCustomerId: String, private val body: AlertCreateForExternalCustomerBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun externalCustomerId(): String = externalCustomerId @@ -63,11 +64,11 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getBody(): AlertCreateForExternalCustomerBody = body + @JvmSynthetic internal fun _body(): AlertCreateForExternalCustomerBody = body - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun getPathParam(index: Int): String { return when (index) { @@ -136,7 +137,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AlertCreateForExternalCustomerBody]. */ + class Builder internal constructor() { private var currency: JsonField? = null private var type: JsonField? = null @@ -247,8 +249,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [AlertCreateForExternalCustomerParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var externalCustomerId: String? = null private var body: AlertCreateForExternalCustomerBody.Builder = @@ -430,6 +433,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -447,6 +458,7 @@ constructor( @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } + /** An enum containing [Type]'s known values. */ enum class Known { USAGE_EXCEEDED, COST_EXCEEDED, @@ -455,15 +467,32 @@ constructor( CREDIT_BALANCE_RECOVERED, } + /** + * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Type] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { USAGE_EXCEEDED, COST_EXCEEDED, CREDIT_BALANCE_DEPLETED, CREDIT_BALANCE_DROPPED, CREDIT_BALANCE_RECOVERED, + /** An enum member indicating that [Type] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { USAGE_EXCEEDED -> Value.USAGE_EXCEEDED @@ -474,6 +503,14 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { USAGE_EXCEEDED -> Known.USAGE_EXCEEDED @@ -547,7 +584,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Threshold]. */ + class Builder internal constructor() { private var value: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() 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 a02901f1..fc8eb74d 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 @@ -12,6 +12,7 @@ import com.withorb.api.core.JsonField import com.withorb.api.core.JsonMissing import com.withorb.api.core.JsonValue import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -34,12 +35,12 @@ import java.util.Optional * current billing cycle. */ class AlertCreateForSubscriptionParams -constructor( +private constructor( private val subscriptionId: String, private val body: AlertCreateForSubscriptionBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun subscriptionId(): String = subscriptionId @@ -67,11 +68,11 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getBody(): AlertCreateForSubscriptionBody = body + @JvmSynthetic internal fun _body(): AlertCreateForSubscriptionBody = body - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun getPathParam(index: Int): String { return when (index) { @@ -139,7 +140,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AlertCreateForSubscriptionBody]. */ + class Builder internal constructor() { private var thresholds: JsonField>? = null private var type: JsonField? = null @@ -247,8 +249,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [AlertCreateForSubscriptionParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var subscriptionId: String? = null private var body: AlertCreateForSubscriptionBody.Builder = @@ -468,7 +471,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Threshold]. */ + class Builder internal constructor() { private var value: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -541,6 +545,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -558,6 +570,7 @@ constructor( @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } + /** An enum containing [Type]'s known values. */ enum class Known { USAGE_EXCEEDED, COST_EXCEEDED, @@ -566,15 +579,32 @@ constructor( CREDIT_BALANCE_RECOVERED, } + /** + * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Type] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { USAGE_EXCEEDED, COST_EXCEEDED, CREDIT_BALANCE_DEPLETED, CREDIT_BALANCE_DROPPED, CREDIT_BALANCE_RECOVERED, + /** An enum member indicating that [Type] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { USAGE_EXCEEDED -> Value.USAGE_EXCEEDED @@ -585,6 +615,14 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { USAGE_EXCEEDED -> Known.USAGE_EXCEEDED diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertDisableParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertDisableParams.kt index fa1f0f6a..a96e969e 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertDisableParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertDisableParams.kt @@ -4,6 +4,7 @@ package com.withorb.api.models import com.withorb.api.core.JsonValue import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -17,13 +18,13 @@ import java.util.Optional * customer or subscription level alerts. */ class AlertDisableParams -constructor( +private constructor( private val alertConfigurationId: String, private val subscriptionId: String?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, private val additionalBodyProperties: Map, -) { +) : Params { fun alertConfigurationId(): String = alertConfigurationId @@ -37,13 +38,12 @@ constructor( fun _additionalBodyProperties(): Map = additionalBodyProperties @JvmSynthetic - internal fun getBody(): Optional> = + internal fun _body(): Optional> = Optional.ofNullable(additionalBodyProperties.ifEmpty { null }) - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic - internal fun getQueryParams(): QueryParams { + override fun _queryParams(): QueryParams { val queryParams = QueryParams.builder() this.subscriptionId?.let { queryParams.put("subscription_id", listOf(it.toString())) } queryParams.putAll(additionalQueryParams) @@ -64,8 +64,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [AlertDisableParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var alertConfigurationId: String? = null private var subscriptionId: String? = null diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertEnableParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertEnableParams.kt index 0c62f3b4..f4af9ee3 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertEnableParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertEnableParams.kt @@ -4,6 +4,7 @@ package com.withorb.api.models import com.withorb.api.core.JsonValue import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -17,13 +18,13 @@ import java.util.Optional * customer or subscription level alerts. */ class AlertEnableParams -constructor( +private constructor( private val alertConfigurationId: String, private val subscriptionId: String?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, private val additionalBodyProperties: Map, -) { +) : Params { fun alertConfigurationId(): String = alertConfigurationId @@ -37,13 +38,12 @@ constructor( fun _additionalBodyProperties(): Map = additionalBodyProperties @JvmSynthetic - internal fun getBody(): Optional> = + internal fun _body(): Optional> = Optional.ofNullable(additionalBodyProperties.ifEmpty { null }) - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic - internal fun getQueryParams(): QueryParams { + override fun _queryParams(): QueryParams { val queryParams = QueryParams.builder() this.subscriptionId?.let { queryParams.put("subscription_id", listOf(it.toString())) } queryParams.putAll(additionalQueryParams) @@ -64,8 +64,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [AlertEnableParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var alertConfigurationId: String? = null private var subscriptionId: String? = null 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 7088ecd4..28d4372b 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 @@ -190,8 +190,7 @@ private constructor( } } - class AutoPager - constructor( + class AutoPager( private val firstPage: AlertListPage, ) : Iterable { 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 161853a7..b6d17272 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 @@ -193,8 +193,7 @@ private constructor( } } - class AutoPager - constructor( + class AutoPager( private val firstPage: AlertListPageAsync, ) { 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 6aea2a47..3d7fbd2e 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 @@ -3,6 +3,7 @@ package com.withorb.api.models import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams import java.time.OffsetDateTime @@ -22,7 +23,7 @@ import java.util.Optional * follows Orb's [standardized pagination format](/api-reference/pagination). */ class AlertListParams -constructor( +private constructor( private val createdAtGt: OffsetDateTime?, private val createdAtGte: OffsetDateTime?, private val createdAtLt: OffsetDateTime?, @@ -34,7 +35,7 @@ constructor( private val subscriptionId: String?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun createdAtGt(): Optional = Optional.ofNullable(createdAtGt) @@ -66,10 +67,9 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic - internal fun getQueryParams(): QueryParams { + override fun _queryParams(): QueryParams { val queryParams = QueryParams.builder() this.createdAtGt?.let { queryParams.put( @@ -113,8 +113,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [AlertListParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var createdAtGt: OffsetDateTime? = null private var createdAtGte: OffsetDateTime? = null diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertRetrieveParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertRetrieveParams.kt index 88564459..eb956630 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertRetrieveParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertRetrieveParams.kt @@ -3,6 +3,7 @@ package com.withorb.api.models import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -10,11 +11,11 @@ import java.util.Objects /** This endpoint retrieves an alert by its ID. */ class AlertRetrieveParams -constructor( +private constructor( private val alertId: String, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun alertId(): String = alertId @@ -22,9 +23,9 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun getPathParam(index: Int): String { return when (index) { @@ -40,8 +41,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [AlertRetrieveParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var alertId: String? = null private var additionalHeaders: Headers.Builder = Headers.builder() diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertUpdateParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertUpdateParams.kt index deca74b4..456a06c1 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertUpdateParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/AlertUpdateParams.kt @@ -11,6 +11,7 @@ import com.withorb.api.core.JsonField import com.withorb.api.core.JsonMissing import com.withorb.api.core.JsonValue import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -20,12 +21,12 @@ import java.util.Objects /** This endpoint updates the thresholds of an alert. */ class AlertUpdateParams -constructor( +private constructor( private val alertConfigurationId: String, private val body: AlertUpdateBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun alertConfigurationId(): String = alertConfigurationId @@ -41,11 +42,11 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getBody(): AlertUpdateBody = body + @JvmSynthetic internal fun _body(): AlertUpdateBody = body - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun getPathParam(index: Int): String { return when (index) { @@ -95,7 +96,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AlertUpdateBody]. */ + class Builder internal constructor() { private var thresholds: JsonField>? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -179,8 +181,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [AlertUpdateParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var alertConfigurationId: String? = null private var body: AlertUpdateBody.Builder = AlertUpdateBody.builder() @@ -384,7 +387,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Threshold]. */ + class Builder internal constructor() { private var value: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/AmountDiscount.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/AmountDiscount.kt index dc4ff07a..5b1d58f3 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/AmountDiscount.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/AmountDiscount.kt @@ -95,7 +95,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AmountDiscount]. */ + class Builder internal constructor() { private var amountDiscount: JsonField? = null private var appliesToPriceIds: JsonField>? = null @@ -199,6 +200,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -208,21 +217,49 @@ private constructor( @JvmStatic fun of(value: String) = DiscountType(JsonField.of(value)) } + /** An enum containing [DiscountType]'s known values. */ enum class Known { AMOUNT, } + /** + * An enum containing [DiscountType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [DiscountType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { AMOUNT, + /** + * An enum member indicating that [DiscountType] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { AMOUNT -> Value.AMOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { AMOUNT -> Known.AMOUNT diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/BillableMetric.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/BillableMetric.kt index ecea132a..6358f0da 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/BillableMetric.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/BillableMetric.kt @@ -114,7 +114,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillableMetric]. */ + class Builder internal constructor() { private var id: JsonField? = null private var description: JsonField? = null @@ -246,7 +247,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -300,6 +302,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -313,19 +323,37 @@ private constructor( @JvmStatic fun of(value: String) = Status(JsonField.of(value)) } + /** An enum containing [Status]'s known values. */ enum class Known { ACTIVE, DRAFT, ARCHIVED, } + /** + * An enum containing [Status]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Status] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ACTIVE, DRAFT, ARCHIVED, + /** An enum member indicating that [Status] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { ACTIVE -> Value.ACTIVE @@ -334,6 +362,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { ACTIVE -> Known.ACTIVE diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/BillingCycleRelativeDate.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/BillingCycleRelativeDate.kt index c5225e6a..e91cdb76 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/BillingCycleRelativeDate.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/BillingCycleRelativeDate.kt @@ -13,6 +13,13 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't match + * any known member, and you want to know that value. For example, if the SDK is on an older + * version than the API, then the API may respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -24,17 +31,39 @@ private constructor( @JvmStatic fun of(value: String) = BillingCycleRelativeDate(JsonField.of(value)) } + /** An enum containing [BillingCycleRelativeDate]'s known values. */ enum class Known { START_OF_TERM, END_OF_TERM, } + /** + * An enum containing [BillingCycleRelativeDate]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [BillingCycleRelativeDate] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the SDK + * is on an older version than the API, then the API may respond with new members that the SDK + * is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { START_OF_TERM, END_OF_TERM, + /** + * An enum member indicating that [BillingCycleRelativeDate] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] if + * the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want to + * throw for the unknown case. + */ fun value(): Value = when (this) { START_OF_TERM -> Value.START_OF_TERM @@ -42,6 +71,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't want + * to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { START_OF_TERM -> Known.START_OF_TERM 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 0252efa9..76e6f1ff 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 @@ -161,7 +161,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Coupon]. */ + class Builder internal constructor() { private var id: JsonField? = null private var archivedAt: JsonField? = null @@ -402,18 +403,31 @@ private constructor( @JvmStatic fun ofAmount(amount: AmountDiscount) = Discount(amount = amount) } + /** + * An interface that defines how to map each variant of [Discount] to a value of type [T]. + */ interface Visitor { fun visitPercentage(percentage: PercentageDiscount): T fun visitAmount(amount: AmountDiscount): T + /** + * Maps an unknown variant of [Discount] to a value of type [T]. + * + * An instance of [Discount] can contain an unknown variant if it was deserialized from + * data that doesn't match any known variant. For example, if the SDK is on an older + * version than the API, then the API may respond with new variants that the SDK is + * unaware of. + * + * @throws OrbInvalidDataException in the default implementation. + */ fun unknown(json: JsonValue?): T { throw OrbInvalidDataException("Unknown Discount: $json") } } - class Deserializer : BaseDeserializer(Discount::class) { + internal class Deserializer : BaseDeserializer(Discount::class) { override fun ObjectCodec.deserialize(node: JsonNode): Discount { val json = JsonValue.fromJsonNode(node) @@ -439,7 +453,7 @@ private constructor( } } - class Serializer : BaseSerializer(Discount::class) { + internal class Serializer : BaseSerializer(Discount::class) { override fun serialize( value: Discount, diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CouponArchiveParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CouponArchiveParams.kt index 1311b3f7..8f07cb7a 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CouponArchiveParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CouponArchiveParams.kt @@ -4,6 +4,7 @@ package com.withorb.api.models import com.withorb.api.core.JsonValue import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -17,12 +18,12 @@ import java.util.Optional * redemption code can be reused for a different coupon. */ class CouponArchiveParams -constructor( +private constructor( private val couponId: String, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, private val additionalBodyProperties: Map, -) { +) : Params { fun couponId(): String = couponId @@ -33,12 +34,12 @@ constructor( fun _additionalBodyProperties(): Map = additionalBodyProperties @JvmSynthetic - internal fun getBody(): Optional> = + internal fun _body(): Optional> = Optional.ofNullable(additionalBodyProperties.ifEmpty { null }) - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun getPathParam(index: Int): String { return when (index) { @@ -54,8 +55,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [CouponArchiveParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var couponId: String? = null private var additionalHeaders: Headers.Builder = Headers.builder() diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CouponCreateParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CouponCreateParams.kt index 850787da..4d477bfa 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CouponCreateParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CouponCreateParams.kt @@ -21,6 +21,7 @@ import com.withorb.api.core.JsonField import com.withorb.api.core.JsonMissing import com.withorb.api.core.JsonValue import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.getOrThrow import com.withorb.api.core.http.Headers @@ -37,11 +38,11 @@ import kotlin.jvm.optionals.getOrNull * or plan change. */ class CouponCreateParams -constructor( +private constructor( private val body: CouponCreateBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun discount(): Discount = body.discount() @@ -83,11 +84,11 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getBody(): CouponCreateBody = body + @JvmSynthetic internal fun _body(): CouponCreateBody = body - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams @NoAutoDetect class CouponCreateBody @@ -176,7 +177,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CouponCreateBody]. */ + class Builder internal constructor() { private var discount: JsonField? = null private var redemptionCode: JsonField? = null @@ -200,9 +202,30 @@ constructor( fun discount(newCouponPercentage: Discount.NewCouponPercentageDiscount) = discount(Discount.ofNewCouponPercentage(newCouponPercentage)) + fun newCouponPercentageDiscount(percentageDiscount: Double) = + discount( + Discount.NewCouponPercentageDiscount.builder() + .discountType( + CouponCreateParams.Discount.NewCouponPercentageDiscount.DiscountType + .PERCENTAGE + ) + .percentageDiscount(percentageDiscount) + .build() + ) + fun discount(newCouponAmount: Discount.NewCouponAmountDiscount) = discount(Discount.ofNewCouponAmount(newCouponAmount)) + fun newCouponAmountDiscount(amountDiscount: String) = + discount( + Discount.NewCouponAmountDiscount.builder() + .discountType( + CouponCreateParams.Discount.NewCouponAmountDiscount.DiscountType.AMOUNT + ) + .amountDiscount(amountDiscount) + .build() + ) + /** This string can be used to redeem this coupon for a given subscription. */ fun redemptionCode(redemptionCode: String) = redemptionCode(JsonField.of(redemptionCode)) @@ -325,8 +348,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [CouponCreateParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var body: CouponCreateBody.Builder = CouponCreateBody.builder() private var additionalHeaders: Headers.Builder = Headers.builder() @@ -347,10 +371,18 @@ constructor( body.discount(newCouponPercentage) } + fun newCouponPercentageDiscount(percentageDiscount: Double) = apply { + body.newCouponPercentageDiscount(percentageDiscount) + } + fun discount(newCouponAmount: Discount.NewCouponAmountDiscount) = apply { body.discount(newCouponAmount) } + fun newCouponAmountDiscount(amountDiscount: String) = apply { + body.newCouponAmountDiscount(amountDiscount) + } + /** This string can be used to redeem this coupon for a given subscription. */ fun redemptionCode(redemptionCode: String) = apply { body.redemptionCode(redemptionCode) } @@ -629,18 +661,31 @@ constructor( Discount(newCouponAmount = newCouponAmount) } + /** + * An interface that defines how to map each variant of [Discount] to a value of type [T]. + */ interface Visitor { fun visitNewCouponPercentage(newCouponPercentage: NewCouponPercentageDiscount): T fun visitNewCouponAmount(newCouponAmount: NewCouponAmountDiscount): T + /** + * Maps an unknown variant of [Discount] to a value of type [T]. + * + * An instance of [Discount] can contain an unknown variant if it was deserialized from + * data that doesn't match any known variant. For example, if the SDK is on an older + * version than the API, then the API may respond with new variants that the SDK is + * unaware of. + * + * @throws OrbInvalidDataException in the default implementation. + */ fun unknown(json: JsonValue?): T { throw OrbInvalidDataException("Unknown Discount: $json") } } - class Deserializer : BaseDeserializer(Discount::class) { + internal class Deserializer : BaseDeserializer(Discount::class) { override fun ObjectCodec.deserialize(node: JsonNode): Discount { val json = JsonValue.fromJsonNode(node) @@ -670,7 +715,7 @@ constructor( } } - class Serializer : BaseSerializer(Discount::class) { + internal class Serializer : BaseSerializer(Discount::class) { override fun serialize( value: Discount, @@ -736,7 +781,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewCouponPercentageDiscount]. */ + class Builder internal constructor() { private var discountType: JsonField? = null private var percentageDiscount: JsonField? = null @@ -801,6 +847,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -810,21 +864,52 @@ constructor( @JvmStatic fun of(value: String) = DiscountType(JsonField.of(value)) } + /** An enum containing [DiscountType]'s known values. */ enum class Known { PERCENTAGE, } + /** + * An enum containing [DiscountType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DiscountType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PERCENTAGE, + /** + * An enum member indicating that [DiscountType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { PERCENTAGE -> Value.PERCENTAGE else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { PERCENTAGE -> Known.PERCENTAGE @@ -913,7 +998,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewCouponAmountDiscount]. */ + class Builder internal constructor() { private var amountDiscount: JsonField? = null private var discountType: JsonField? = null @@ -977,6 +1063,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -986,21 +1080,52 @@ constructor( @JvmStatic fun of(value: String) = DiscountType(JsonField.of(value)) } + /** An enum containing [DiscountType]'s known values. */ enum class Known { AMOUNT, } + /** + * An enum containing [DiscountType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DiscountType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { AMOUNT, + /** + * An enum member indicating that [DiscountType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { AMOUNT -> Value.AMOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { AMOUNT -> Known.AMOUNT diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CouponFetchParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CouponFetchParams.kt index 743ba726..9b65c996 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CouponFetchParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CouponFetchParams.kt @@ -3,6 +3,7 @@ package com.withorb.api.models import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -13,11 +14,11 @@ import java.util.Objects * [List coupons](list-coupons) endpoint with the redemption_code parameter. */ class CouponFetchParams -constructor( +private constructor( private val couponId: String, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun couponId(): String = couponId @@ -25,9 +26,9 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun getPathParam(index: Int): String { return when (index) { @@ -43,8 +44,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [CouponFetchParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var couponId: String? = null private var additionalHeaders: Headers.Builder = Headers.builder() 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 3b2d74d3..1fae071e 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 @@ -186,8 +186,7 @@ private constructor( } } - class AutoPager - constructor( + class AutoPager( private val firstPage: CouponListPage, ) : Iterable { 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 8e2d01d8..84aefe66 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 @@ -189,8 +189,7 @@ private constructor( } } - class AutoPager - constructor( + class AutoPager( private val firstPage: CouponListPageAsync, ) { diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CouponListParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CouponListParams.kt index 4fc6ac77..b114782f 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CouponListParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CouponListParams.kt @@ -3,6 +3,7 @@ package com.withorb.api.models import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams import java.util.Objects @@ -16,14 +17,14 @@ import java.util.Optional * exist. More information about pagination can be found in the Pagination-metadata schema. */ class CouponListParams -constructor( +private constructor( private val cursor: String?, private val limit: Long?, private val redemptionCode: String?, private val showArchived: Boolean?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { /** * Cursor for pagination. This can be populated by the `next_cursor` value returned from the @@ -44,10 +45,9 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic - internal fun getQueryParams(): QueryParams { + override fun _queryParams(): QueryParams { val queryParams = QueryParams.builder() this.cursor?.let { queryParams.put("cursor", listOf(it.toString())) } this.limit?.let { queryParams.put("limit", listOf(it.toString())) } @@ -64,8 +64,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [CouponListParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var cursor: String? = null private var limit: Long? = null 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 703e3fb8..2618230a 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 @@ -189,8 +189,7 @@ private constructor( } } - class AutoPager - constructor( + class AutoPager( private val firstPage: CouponSubscriptionListPage, ) : Iterable { 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 5ef983df..df82f6a3 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 @@ -192,8 +192,7 @@ private constructor( } } - class AutoPager - constructor( + class AutoPager( private val firstPage: CouponSubscriptionListPageAsync, ) { 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 506e9972..4abb2350 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 @@ -3,6 +3,7 @@ package com.withorb.api.models import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -16,13 +17,13 @@ import java.util.Optional * [Subscription](/core-concepts#subscription). */ class CouponSubscriptionListParams -constructor( +private constructor( private val couponId: String, private val cursor: String?, private val limit: Long?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun couponId(): String = couponId @@ -39,10 +40,9 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic - internal fun getQueryParams(): QueryParams { + override fun _queryParams(): QueryParams { val queryParams = QueryParams.builder() this.cursor?.let { queryParams.put("cursor", listOf(it.toString())) } this.limit?.let { queryParams.put("limit", listOf(it.toString())) } @@ -64,8 +64,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [CouponSubscriptionListParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var couponId: String? = null private var cursor: String? = null 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 5f1dac93..416feebb 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 @@ -217,7 +217,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CreditNote]. */ + class Builder internal constructor() { private var id: JsonField? = null private var createdAt: JsonField? = null @@ -500,7 +501,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Customer]. */ + class Builder internal constructor() { private var id: JsonField? = null private var externalCustomerId: JsonField? = null @@ -674,7 +676,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [LineItem]. */ + class Builder internal constructor() { private var id: JsonField? = null private var amount: JsonField? = null @@ -875,7 +878,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TaxAmount]. */ + class Builder internal constructor() { private var amount: JsonField? = null private var taxRateDescription: JsonField? = null @@ -1064,7 +1068,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Discount]. */ + class Builder internal constructor() { private var id: JsonField? = null private var amountApplied: JsonField? = null @@ -1191,6 +1196,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -1202,17 +1215,39 @@ private constructor( @JvmStatic fun of(value: String) = DiscountType(JsonField.of(value)) } + /** An enum containing [DiscountType]'s known values. */ enum class Known { PERCENTAGE, AMOUNT, } + /** + * An enum containing [DiscountType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DiscountType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PERCENTAGE, AMOUNT, + /** + * An enum member indicating that [DiscountType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { PERCENTAGE -> Value.PERCENTAGE @@ -1220,6 +1255,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { PERCENTAGE -> Known.PERCENTAGE @@ -1357,7 +1401,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MaximumAmountAdjustment]. */ + class Builder internal constructor() { private var amountApplied: JsonField? = null private var discountType: JsonField? = null @@ -1460,6 +1505,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -1469,21 +1522,51 @@ private constructor( @JvmStatic fun of(value: String) = DiscountType(JsonField.of(value)) } + /** An enum containing [DiscountType]'s known values. */ enum class Known { PERCENTAGE, } + /** + * An enum containing [DiscountType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [DiscountType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PERCENTAGE, + /** + * An enum member indicating that [DiscountType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { PERCENTAGE -> Value.PERCENTAGE else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { PERCENTAGE -> Known.PERCENTAGE @@ -1550,7 +1633,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AppliesToPrice]. */ + class Builder internal constructor() { private var id: JsonField? = null private var name: JsonField? = null @@ -1643,6 +1727,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -1658,6 +1750,7 @@ private constructor( @JvmStatic fun of(value: String) = Reason(JsonField.of(value)) } + /** An enum containing [Reason]'s known values. */ enum class Known { DUPLICATE, FRAUDULENT, @@ -1665,14 +1758,31 @@ private constructor( PRODUCT_UNSATISFACTORY, } + /** + * An enum containing [Reason]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Reason] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DUPLICATE, FRAUDULENT, ORDER_CHANGE, PRODUCT_UNSATISFACTORY, + /** An enum member indicating that [Reason] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { DUPLICATE -> Value.DUPLICATE @@ -1682,6 +1792,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { DUPLICATE -> Known.DUPLICATE @@ -1712,6 +1830,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -1723,17 +1849,35 @@ private constructor( @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } + /** An enum containing [Type]'s known values. */ enum class Known { REFUND, ADJUSTMENT, } + /** + * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Type] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { REFUND, ADJUSTMENT, + /** An enum member indicating that [Type] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { REFUND -> Value.REFUND @@ -1741,6 +1885,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { REFUND -> Known.REFUND @@ -1841,7 +1993,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Discount]. */ + class Builder internal constructor() { private var amountApplied: JsonField? = null private var discountType: JsonField? = null @@ -1944,6 +2097,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -1953,21 +2114,51 @@ private constructor( @JvmStatic fun of(value: String) = DiscountType(JsonField.of(value)) } + /** An enum containing [DiscountType]'s known values. */ enum class Known { PERCENTAGE, } + /** + * An enum containing [DiscountType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [DiscountType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PERCENTAGE, + /** + * An enum member indicating that [DiscountType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { PERCENTAGE -> Value.PERCENTAGE else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { PERCENTAGE -> Known.PERCENTAGE @@ -2034,7 +2225,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AppliesToPrice]. */ + class Builder internal constructor() { private var id: JsonField? = null private var name: JsonField? = null 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 f97ed262..8f621b09 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 @@ -12,6 +12,7 @@ import com.withorb.api.core.JsonField import com.withorb.api.core.JsonMissing import com.withorb.api.core.JsonValue import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -23,11 +24,11 @@ import java.util.Optional /** This endpoint is used to create a single [`Credit Note`](/invoicing/credit-notes). */ class CreditNoteCreateParams -constructor( +private constructor( private val body: CreditNoteCreateBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun lineItems(): List = body.lineItems() @@ -51,11 +52,11 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getBody(): CreditNoteCreateBody = body + @JvmSynthetic internal fun _body(): CreditNoteCreateBody = body - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams @NoAutoDetect class CreditNoteCreateBody @@ -116,7 +117,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CreditNoteCreateBody]. */ + class Builder internal constructor() { private var lineItems: JsonField>? = null private var memo: JsonField = JsonMissing.of() @@ -221,8 +223,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [CreditNoteCreateParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var body: CreditNoteCreateBody.Builder = CreditNoteCreateBody.builder() private var additionalHeaders: Headers.Builder = Headers.builder() @@ -435,7 +438,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [LineItem]. */ + class Builder internal constructor() { private var amount: JsonField? = null private var invoiceLineItemId: JsonField? = null @@ -515,6 +519,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -530,6 +542,7 @@ constructor( @JvmStatic fun of(value: String) = Reason(JsonField.of(value)) } + /** An enum containing [Reason]'s known values. */ enum class Known { DUPLICATE, FRAUDULENT, @@ -537,14 +550,31 @@ constructor( PRODUCT_UNSATISFACTORY, } + /** + * An enum containing [Reason]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Reason] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DUPLICATE, FRAUDULENT, ORDER_CHANGE, PRODUCT_UNSATISFACTORY, + /** An enum member indicating that [Reason] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { DUPLICATE -> Value.DUPLICATE @@ -554,6 +584,14 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { DUPLICATE -> Known.DUPLICATE 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 d48e298d..26e906b2 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 @@ -3,6 +3,7 @@ package com.withorb.api.models import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -13,11 +14,11 @@ import java.util.Objects * identifier. */ class CreditNoteFetchParams -constructor( +private constructor( private val creditNoteId: String, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun creditNoteId(): String = creditNoteId @@ -25,9 +26,9 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun getPathParam(index: Int): String { return when (index) { @@ -43,8 +44,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [CreditNoteFetchParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var creditNoteId: String? = null private var additionalHeaders: Headers.Builder = Headers.builder() 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 95190fec..bb4c34f1 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 @@ -188,8 +188,7 @@ private constructor( } } - class AutoPager - constructor( + class AutoPager( private val firstPage: CreditNoteListPage, ) : Iterable { 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 e30cd766..c97d1e38 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 @@ -191,8 +191,7 @@ private constructor( } } - class AutoPager - constructor( + class AutoPager( private val firstPage: CreditNoteListPageAsync, ) { diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CreditNoteListParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CreditNoteListParams.kt index c7e1ca90..048cd11e 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CreditNoteListParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CreditNoteListParams.kt @@ -3,6 +3,7 @@ package com.withorb.api.models import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams import java.util.Objects @@ -14,12 +15,12 @@ import java.util.Optional * `creation_time`. */ class CreditNoteListParams -constructor( +private constructor( private val cursor: String?, private val limit: Long?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { /** * Cursor for pagination. This can be populated by the `next_cursor` value returned from the @@ -34,10 +35,9 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic - internal fun getQueryParams(): QueryParams { + override fun _queryParams(): QueryParams { val queryParams = QueryParams.builder() this.cursor?.let { queryParams.put("cursor", listOf(it.toString())) } this.limit?.let { queryParams.put("limit", listOf(it.toString())) } @@ -52,8 +52,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [CreditNoteListParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var cursor: String? = null private var limit: Long? = null 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 ed1a0d16..9af3e19f 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 @@ -532,7 +532,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Customer]. */ + class Builder internal constructor() { private var id: JsonField? = null private var additionalEmails: JsonField>? = null @@ -1263,7 +1264,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingAddress]. */ + class Builder internal constructor() { private var city: JsonField? = null private var country: JsonField? = null @@ -1403,7 +1405,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -1461,6 +1464,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -1478,6 +1489,7 @@ private constructor( @JvmStatic fun of(value: String) = PaymentProvider(JsonField.of(value)) } + /** An enum containing [PaymentProvider]'s known values. */ enum class Known { QUICKBOOKS, BILL_COM, @@ -1486,15 +1498,35 @@ private constructor( NETSUITE, } + /** + * An enum containing [PaymentProvider]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [PaymentProvider] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { QUICKBOOKS, BILL_COM, STRIPE_CHARGE, STRIPE_INVOICE, NETSUITE, + /** + * An enum member indicating that [PaymentProvider] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { QUICKBOOKS -> Value.QUICKBOOKS @@ -1505,6 +1537,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { QUICKBOOKS -> Known.QUICKBOOKS @@ -1610,7 +1650,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [ShippingAddress]. */ + class Builder internal constructor() { private var city: JsonField? = null private var country: JsonField? = null @@ -1873,7 +1914,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TaxId]. */ + class Builder internal constructor() { private var country: JsonField? = null private var type: JsonField? = null @@ -1934,6 +1976,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -2097,6 +2147,7 @@ private constructor( @JvmStatic fun of(value: String) = Country(JsonField.of(value)) } + /** An enum containing [Country]'s known values. */ enum class Known { AD, AE, @@ -2178,6 +2229,15 @@ private constructor( ZA, } + /** + * An enum containing [Country]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Country] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { AD, AE, @@ -2257,9 +2317,19 @@ private constructor( VE, VN, ZA, + /** + * An enum member indicating that [Country] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { AD -> Value.AD @@ -2343,6 +2413,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { AD -> Known.AD @@ -2447,6 +2526,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -2596,6 +2683,7 @@ private constructor( @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } + /** An enum containing [Type]'s known values. */ enum class Known { AD_NRT, AE_TRN, @@ -2670,6 +2758,15 @@ private constructor( ZA_VAT, } + /** + * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Type] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { AD_NRT, AE_TRN, @@ -2742,9 +2839,17 @@ private constructor( VE_RIF, VN_TIN, ZA_VAT, + /** An enum member indicating that [Type] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { AD_NRT -> Value.AD_NRT @@ -2821,6 +2926,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { AD_NRT -> Known.AD_NRT @@ -2978,7 +3092,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AccountingSyncConfiguration]. */ + class Builder internal constructor() { private var accountingProviders: JsonField>? = null private var excluded: JsonField? = null @@ -3097,7 +3212,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AccountingProvider]. */ + class Builder internal constructor() { private var externalProviderId: JsonField? = null private var providerType: JsonField? = null @@ -3163,6 +3279,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -3174,17 +3298,39 @@ private constructor( @JvmStatic fun of(value: String) = ProviderType(JsonField.of(value)) } + /** An enum containing [ProviderType]'s known values. */ enum class Known { QUICKBOOKS, NETSUITE, } + /** + * An enum containing [ProviderType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ProviderType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { QUICKBOOKS, NETSUITE, + /** + * An enum member indicating that [ProviderType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { QUICKBOOKS -> Value.QUICKBOOKS @@ -3192,6 +3338,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { QUICKBOOKS -> Known.QUICKBOOKS @@ -3287,7 +3442,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [ReportingConfiguration]. */ + class Builder internal constructor() { private var exempt: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerBalanceTransactionCreateParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerBalanceTransactionCreateParams.kt index f70a56e3..bb529d6e 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerBalanceTransactionCreateParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerBalanceTransactionCreateParams.kt @@ -12,6 +12,7 @@ import com.withorb.api.core.JsonField import com.withorb.api.core.JsonMissing import com.withorb.api.core.JsonValue import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -26,12 +27,12 @@ import java.util.Optional * newly created transaction. */ class CustomerBalanceTransactionCreateParams -constructor( +private constructor( private val customerId: String, private val body: CustomerBalanceTransactionCreateBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun customerId(): String = customerId @@ -55,11 +56,11 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getBody(): CustomerBalanceTransactionCreateBody = body + @JvmSynthetic internal fun _body(): CustomerBalanceTransactionCreateBody = body - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun getPathParam(index: Int): String { return when (index) { @@ -124,7 +125,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CustomerBalanceTransactionCreateBody]. */ + class Builder internal constructor() { private var amount: JsonField? = null private var type: JsonField? = null @@ -214,8 +216,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [CustomerBalanceTransactionCreateParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var customerId: String? = null private var body: CustomerBalanceTransactionCreateBody.Builder = @@ -385,6 +388,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -396,17 +407,35 @@ constructor( @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } + /** An enum containing [Type]'s known values. */ enum class Known { INCREMENT, DECREMENT, } + /** + * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Type] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { INCREMENT, DECREMENT, + /** An enum member indicating that [Type] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { INCREMENT -> Value.INCREMENT @@ -414,6 +443,14 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { INCREMENT -> Known.INCREMENT diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerBalanceTransactionCreateResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerBalanceTransactionCreateResponse.kt index 24dc02bd..fa74282e 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerBalanceTransactionCreateResponse.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerBalanceTransactionCreateResponse.kt @@ -156,7 +156,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CustomerBalanceTransactionCreateResponse]. */ + class Builder internal constructor() { private var id: JsonField? = null private var action: JsonField? = null @@ -305,6 +306,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -328,6 +337,7 @@ private constructor( @JvmStatic fun of(value: String) = Action(JsonField.of(value)) } + /** An enum containing [Action]'s known values. */ enum class Known { APPLIED_TO_INVOICE, MANUAL_ADJUSTMENT, @@ -339,6 +349,15 @@ private constructor( OVERPAYMENT_REFUND, } + /** + * An enum containing [Action]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Action] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { APPLIED_TO_INVOICE, MANUAL_ADJUSTMENT, @@ -348,9 +367,17 @@ private constructor( CREDIT_NOTE_APPLIED, CREDIT_NOTE_VOIDED, OVERPAYMENT_REFUND, + /** An enum member indicating that [Action] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { APPLIED_TO_INVOICE -> Value.APPLIED_TO_INVOICE @@ -364,6 +391,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { APPLIED_TO_INVOICE -> Known.APPLIED_TO_INVOICE @@ -429,7 +464,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CreditNote]. */ + class Builder internal constructor() { private var id: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -523,7 +559,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Invoice]. */ + class Builder internal constructor() { private var id: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -586,6 +623,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -597,17 +642,35 @@ private constructor( @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } + /** An enum containing [Type]'s known values. */ enum class Known { INCREMENT, DECREMENT, } + /** + * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Type] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { INCREMENT, DECREMENT, + /** An enum member indicating that [Type] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { INCREMENT -> Value.INCREMENT @@ -615,6 +678,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { INCREMENT -> Known.INCREMENT 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 0ce3df44..481ae313 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 @@ -216,8 +216,7 @@ private constructor( } } - class AutoPager - constructor( + class AutoPager( private val firstPage: CustomerBalanceTransactionListPage, ) : Iterable { 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 37b8e537..ffd6c712 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 @@ -219,8 +219,7 @@ private constructor( } } - class AutoPager - constructor( + class AutoPager( private val firstPage: CustomerBalanceTransactionListPageAsync, ) { diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerBalanceTransactionListParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerBalanceTransactionListParams.kt index 5a7167cf..54fd58b2 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerBalanceTransactionListParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerBalanceTransactionListParams.kt @@ -3,6 +3,7 @@ package com.withorb.api.models import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -38,7 +39,7 @@ import java.util.Optional * will be applied to the invoice before forwarding payment to the gateway. */ class CustomerBalanceTransactionListParams -constructor( +private constructor( private val customerId: String, private val cursor: String?, private val limit: Long?, @@ -48,7 +49,7 @@ constructor( private val operationTimeLte: OffsetDateTime?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun customerId(): String = customerId @@ -73,10 +74,9 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic - internal fun getQueryParams(): QueryParams { + override fun _queryParams(): QueryParams { val queryParams = QueryParams.builder() this.cursor?.let { queryParams.put("cursor", listOf(it.toString())) } this.limit?.let { queryParams.put("limit", listOf(it.toString())) } @@ -122,8 +122,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [CustomerBalanceTransactionListParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var customerId: String? = null private var cursor: String? = null diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerBalanceTransactionListResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerBalanceTransactionListResponse.kt index 42d5857a..4622acb5 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerBalanceTransactionListResponse.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerBalanceTransactionListResponse.kt @@ -156,7 +156,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CustomerBalanceTransactionListResponse]. */ + class Builder internal constructor() { private var id: JsonField? = null private var action: JsonField? = null @@ -305,6 +306,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -328,6 +337,7 @@ private constructor( @JvmStatic fun of(value: String) = Action(JsonField.of(value)) } + /** An enum containing [Action]'s known values. */ enum class Known { APPLIED_TO_INVOICE, MANUAL_ADJUSTMENT, @@ -339,6 +349,15 @@ private constructor( OVERPAYMENT_REFUND, } + /** + * An enum containing [Action]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Action] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { APPLIED_TO_INVOICE, MANUAL_ADJUSTMENT, @@ -348,9 +367,17 @@ private constructor( CREDIT_NOTE_APPLIED, CREDIT_NOTE_VOIDED, OVERPAYMENT_REFUND, + /** An enum member indicating that [Action] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { APPLIED_TO_INVOICE -> Value.APPLIED_TO_INVOICE @@ -364,6 +391,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { APPLIED_TO_INVOICE -> Known.APPLIED_TO_INVOICE @@ -429,7 +464,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CreditNote]. */ + class Builder internal constructor() { private var id: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -523,7 +559,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Invoice]. */ + class Builder internal constructor() { private var id: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -586,6 +623,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -597,17 +642,35 @@ private constructor( @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } + /** An enum containing [Type]'s known values. */ enum class Known { INCREMENT, DECREMENT, } + /** + * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Type] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { INCREMENT, DECREMENT, + /** An enum member indicating that [Type] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { INCREMENT -> Value.INCREMENT @@ -615,6 +678,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { INCREMENT -> Known.INCREMENT 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 56296037..b9145099 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 @@ -6,6 +6,7 @@ import com.fasterxml.jackson.annotation.JsonCreator import com.withorb.api.core.Enum import com.withorb.api.core.JsonField import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -124,7 +125,7 @@ import java.util.Optional * available. */ class CustomerCostListByExternalIdParams -constructor( +private constructor( private val externalCustomerId: String, private val currency: String?, private val timeframeEnd: OffsetDateTime?, @@ -132,7 +133,7 @@ constructor( private val viewMode: ViewMode?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun externalCustomerId(): String = externalCustomerId @@ -156,10 +157,9 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic - internal fun getQueryParams(): QueryParams { + override fun _queryParams(): QueryParams { val queryParams = QueryParams.builder() this.currency?.let { queryParams.put("currency", listOf(it.toString())) } this.timeframeEnd?.let { @@ -193,8 +193,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [CustomerCostListByExternalIdParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var externalCustomerId: String? = null private var currency: String? = null @@ -378,6 +379,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -389,17 +398,35 @@ constructor( @JvmStatic fun of(value: String) = ViewMode(JsonField.of(value)) } + /** An enum containing [ViewMode]'s known values. */ enum class Known { PERIODIC, CUMULATIVE, } + /** + * An enum containing [ViewMode]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ViewMode] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PERIODIC, CUMULATIVE, + /** An enum member indicating that [ViewMode] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { PERIODIC -> Value.PERIODIC @@ -407,6 +434,14 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { PERIODIC -> Known.PERIODIC 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 b5774a8a..18ed4cab 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 @@ -54,7 +54,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CustomerCostListByExternalIdResponse]. */ + class Builder internal constructor() { private var data: JsonField>? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -192,7 +193,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Data]. */ + class Builder internal constructor() { private var perPriceCosts: JsonField>? = null private var subtotal: JsonField? = null @@ -378,7 +380,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [PerPriceCost]. */ + class Builder internal constructor() { private var price: JsonField? = null private var subtotal: JsonField? = null @@ -791,6 +794,37 @@ private constructor( fun price(maxGroupTieredPackage: Price.MaxGroupTieredPackagePrice) = price(Price.ofMaxGroupTieredPackage(maxGroupTieredPackage)) + /** + * The Price resource represents a price that can be billed on a subscription, + * resulting in a charge on an invoice in the form of an invoice line item. Prices + * take a quantity and determine an amount to bill. + * + * Orb supports a few different pricing models out of the box. Each of these models + * is serialized differently in a given Price object. The model_type field + * determines the key for the configuration object that is present. + * + * For more on the types of prices, see + * [the core concepts documentation](/core-concepts#plan-and-price) + */ + fun price(scalableMatrixWithUnitPricing: Price.ScalableMatrixWithUnitPricingPrice) = + price(Price.ofScalableMatrixWithUnitPricing(scalableMatrixWithUnitPricing)) + + /** + * The Price resource represents a price that can be billed on a subscription, + * resulting in a charge on an invoice in the form of an invoice line item. Prices + * take a quantity and determine an amount to bill. + * + * Orb supports a few different pricing models out of the box. Each of these models + * is serialized differently in a given Price object. The model_type field + * determines the key for the configuration object that is present. + * + * For more on the types of prices, see + * [the core concepts documentation](/core-concepts#plan-and-price) + */ + fun price( + scalableMatrixWithTieredPricing: Price.ScalableMatrixWithTieredPricingPrice + ) = price(Price.ofScalableMatrixWithTieredPricing(scalableMatrixWithTieredPricing)) + /** * 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 214793b0..dcd0ee24 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 @@ -6,6 +6,7 @@ import com.fasterxml.jackson.annotation.JsonCreator import com.withorb.api.core.Enum import com.withorb.api.core.JsonField import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -124,7 +125,7 @@ import java.util.Optional * available. */ class CustomerCostListParams -constructor( +private constructor( private val customerId: String, private val currency: String?, private val timeframeEnd: OffsetDateTime?, @@ -132,7 +133,7 @@ constructor( private val viewMode: ViewMode?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun customerId(): String = customerId @@ -156,10 +157,9 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic - internal fun getQueryParams(): QueryParams { + override fun _queryParams(): QueryParams { val queryParams = QueryParams.builder() this.currency?.let { queryParams.put("currency", listOf(it.toString())) } this.timeframeEnd?.let { @@ -193,8 +193,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [CustomerCostListParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var customerId: String? = null private var currency: String? = null @@ -374,6 +375,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -385,17 +394,35 @@ constructor( @JvmStatic fun of(value: String) = ViewMode(JsonField.of(value)) } + /** An enum containing [ViewMode]'s known values. */ enum class Known { PERIODIC, CUMULATIVE, } + /** + * An enum containing [ViewMode]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ViewMode] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PERIODIC, CUMULATIVE, + /** An enum member indicating that [ViewMode] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { PERIODIC -> Value.PERIODIC @@ -403,6 +430,14 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { PERIODIC -> Known.PERIODIC 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 a41dc68f..74e9b3e8 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 @@ -54,7 +54,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CustomerCostListResponse]. */ + class Builder internal constructor() { private var data: JsonField>? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -189,7 +190,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Data]. */ + class Builder internal constructor() { private var perPriceCosts: JsonField>? = null private var subtotal: JsonField? = null @@ -375,7 +377,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [PerPriceCost]. */ + class Builder internal constructor() { private var price: JsonField? = null private var subtotal: JsonField? = null @@ -788,6 +791,37 @@ private constructor( fun price(maxGroupTieredPackage: Price.MaxGroupTieredPackagePrice) = price(Price.ofMaxGroupTieredPackage(maxGroupTieredPackage)) + /** + * The Price resource represents a price that can be billed on a subscription, + * resulting in a charge on an invoice in the form of an invoice line item. Prices + * take a quantity and determine an amount to bill. + * + * Orb supports a few different pricing models out of the box. Each of these models + * is serialized differently in a given Price object. The model_type field + * determines the key for the configuration object that is present. + * + * For more on the types of prices, see + * [the core concepts documentation](/core-concepts#plan-and-price) + */ + fun price(scalableMatrixWithUnitPricing: Price.ScalableMatrixWithUnitPricingPrice) = + price(Price.ofScalableMatrixWithUnitPricing(scalableMatrixWithUnitPricing)) + + /** + * The Price resource represents a price that can be billed on a subscription, + * resulting in a charge on an invoice in the form of an invoice line item. Prices + * take a quantity and determine an amount to bill. + * + * Orb supports a few different pricing models out of the box. Each of these models + * is serialized differently in a given Price object. The model_type field + * determines the key for the configuration object that is present. + * + * For more on the types of prices, see + * [the core concepts documentation](/core-concepts#plan-and-price) + */ + fun price( + scalableMatrixWithTieredPricing: Price.ScalableMatrixWithTieredPricingPrice + ) = price(Price.ofScalableMatrixWithTieredPricing(scalableMatrixWithTieredPricing)) + /** * 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 adf40b86..44e2b86d 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 @@ -21,6 +21,7 @@ import com.withorb.api.core.JsonField import com.withorb.api.core.JsonMissing import com.withorb.api.core.JsonValue import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.getOrThrow import com.withorb.api.core.http.Headers @@ -45,11 +46,11 @@ import kotlin.jvm.optionals.getOrNull * setting the `timezone` parameter */ class CustomerCreateParams -constructor( +private constructor( private val body: CustomerCreateBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { /** * A valid customer email, to be used for notifications. When Orb triggers payment through a @@ -422,11 +423,11 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getBody(): CustomerCreateBody = body + @JvmSynthetic internal fun _body(): CustomerCreateBody = body - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams @NoAutoDetect class CustomerCreateBody @@ -924,7 +925,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CustomerCreateBody]. */ + class Builder internal constructor() { private var email: JsonField? = null private var name: JsonField? = null @@ -1237,9 +1239,32 @@ constructor( fun taxConfiguration(newAvalara: TaxConfiguration.NewAvalaraTaxConfiguration) = taxConfiguration(TaxConfiguration.ofNewAvalara(newAvalara)) + fun newAvalaraTaxConfiguration(taxExempt: Boolean) = + taxConfiguration( + TaxConfiguration.NewAvalaraTaxConfiguration.builder() + .taxProvider( + CustomerCreateParams.TaxConfiguration.NewAvalaraTaxConfiguration + .TaxProvider + .AVALARA + ) + .taxExempt(taxExempt) + .build() + ) + fun taxConfiguration(newTaxJar: TaxConfiguration.NewTaxJarConfiguration) = taxConfiguration(TaxConfiguration.ofNewTaxJar(newTaxJar)) + fun newTaxJarTaxConfiguration(taxExempt: Boolean) = + taxConfiguration( + TaxConfiguration.NewTaxJarConfiguration.builder() + .taxProvider( + CustomerCreateParams.TaxConfiguration.NewTaxJarConfiguration.TaxProvider + .TAXJAR + ) + .taxExempt(taxExempt) + .build() + ) + /** * Tax IDs are commonly required to be displayed on customer invoices, which are added * to the headers of invoices. @@ -1652,8 +1677,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [CustomerCreateParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var body: CustomerCreateBody.Builder = CustomerCreateBody.builder() private var additionalHeaders: Headers.Builder = Headers.builder() @@ -1932,10 +1958,18 @@ constructor( body.taxConfiguration(newAvalara) } + fun newAvalaraTaxConfiguration(taxExempt: Boolean) = apply { + body.newAvalaraTaxConfiguration(taxExempt) + } + fun taxConfiguration(newTaxJar: TaxConfiguration.NewTaxJarConfiguration) = apply { body.taxConfiguration(newTaxJar) } + fun newTaxJarTaxConfiguration(taxExempt: Boolean) = apply { + body.newTaxJarTaxConfiguration(taxExempt) + } + /** * Tax IDs are commonly required to be displayed on customer invoices, which are added to * the headers of invoices. @@ -2454,7 +2488,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AccountingSyncConfiguration]. */ + class Builder internal constructor() { private var accountingProviders: JsonField>? = null private var excluded: JsonField = JsonMissing.of() @@ -2579,7 +2614,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AccountingProvider]. */ + class Builder internal constructor() { private var externalProviderId: JsonField? = null private var providerType: JsonField? = null @@ -2751,7 +2787,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingAddress]. */ + class Builder internal constructor() { private var city: JsonField = JsonMissing.of() private var country: JsonField = JsonMissing.of() @@ -2891,7 +2928,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -2949,6 +2987,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -2966,6 +3012,7 @@ constructor( @JvmStatic fun of(value: String) = PaymentProvider(JsonField.of(value)) } + /** An enum containing [PaymentProvider]'s known values. */ enum class Known { QUICKBOOKS, BILL_COM, @@ -2974,15 +3021,35 @@ constructor( NETSUITE, } + /** + * An enum containing [PaymentProvider]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [PaymentProvider] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { QUICKBOOKS, BILL_COM, STRIPE_CHARGE, STRIPE_INVOICE, NETSUITE, + /** + * An enum member indicating that [PaymentProvider] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { QUICKBOOKS -> Value.QUICKBOOKS @@ -2993,6 +3060,14 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { QUICKBOOKS -> Known.QUICKBOOKS @@ -3055,7 +3130,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [ReportingConfiguration]. */ + class Builder internal constructor() { private var exempt: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -3194,7 +3270,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [ShippingAddress]. */ + class Builder internal constructor() { private var city: JsonField = JsonMissing.of() private var country: JsonField = JsonMissing.of() @@ -3381,18 +3458,32 @@ constructor( TaxConfiguration(newTaxJar = newTaxJar) } + /** + * An interface that defines how to map each variant of [TaxConfiguration] to a value of + * type [T]. + */ interface Visitor { fun visitNewAvalara(newAvalara: NewAvalaraTaxConfiguration): T fun visitNewTaxJar(newTaxJar: NewTaxJarConfiguration): T + /** + * Maps an unknown variant of [TaxConfiguration] to a value of type [T]. + * + * An instance of [TaxConfiguration] can contain an unknown variant if it was + * deserialized from data that doesn't match any known variant. For example, if the SDK + * is on an older version than the API, then the API may respond with new variants that + * the SDK is unaware of. + * + * @throws OrbInvalidDataException in the default implementation. + */ fun unknown(json: JsonValue?): T { throw OrbInvalidDataException("Unknown TaxConfiguration: $json") } } - class Deserializer : BaseDeserializer(TaxConfiguration::class) { + internal class Deserializer : BaseDeserializer(TaxConfiguration::class) { override fun ObjectCodec.deserialize(node: JsonNode): TaxConfiguration { val json = JsonValue.fromJsonNode(node) @@ -3422,7 +3513,7 @@ constructor( } } - class Serializer : BaseSerializer(TaxConfiguration::class) { + internal class Serializer : BaseSerializer(TaxConfiguration::class) { override fun serialize( value: TaxConfiguration, @@ -3498,7 +3589,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewAvalaraTaxConfiguration]. */ + class Builder internal constructor() { private var taxExempt: JsonField? = null private var taxProvider: JsonField? = null @@ -3571,6 +3663,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -3580,21 +3680,51 @@ constructor( @JvmStatic fun of(value: String) = TaxProvider(JsonField.of(value)) } + /** An enum containing [TaxProvider]'s known values. */ enum class Known { AVALARA, } + /** + * An enum containing [TaxProvider]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [TaxProvider] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { AVALARA, + /** + * An enum member indicating that [TaxProvider] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { AVALARA -> Value.AVALARA else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { AVALARA -> Known.AVALARA @@ -3683,7 +3813,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewTaxJarConfiguration]. */ + class Builder internal constructor() { private var taxExempt: JsonField? = null private var taxProvider: JsonField? = null @@ -3743,6 +3874,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -3752,21 +3891,51 @@ constructor( @JvmStatic fun of(value: String) = TaxProvider(JsonField.of(value)) } + /** An enum containing [TaxProvider]'s known values. */ enum class Known { TAXJAR, } + /** + * An enum containing [TaxProvider]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [TaxProvider] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { TAXJAR, + /** + * An enum member indicating that [TaxProvider] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { TAXJAR -> Value.TAXJAR else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { TAXJAR -> Known.TAXJAR @@ -3964,7 +4133,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TaxId]. */ + class Builder internal constructor() { private var country: JsonField? = null private var type: JsonField? = null @@ -4025,6 +4195,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -4188,6 +4366,7 @@ constructor( @JvmStatic fun of(value: String) = Country(JsonField.of(value)) } + /** An enum containing [Country]'s known values. */ enum class Known { AD, AE, @@ -4269,6 +4448,15 @@ constructor( ZA, } + /** + * An enum containing [Country]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Country] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { AD, AE, @@ -4348,9 +4536,19 @@ constructor( VE, VN, ZA, + /** + * An enum member indicating that [Country] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { AD -> Value.AD @@ -4434,6 +4632,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { AD -> Known.AD @@ -4538,6 +4745,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -4687,6 +4902,7 @@ constructor( @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } + /** An enum containing [Type]'s known values. */ enum class Known { AD_NRT, AE_TRN, @@ -4761,6 +4977,15 @@ constructor( ZA_VAT, } + /** + * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Type] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { AD_NRT, AE_TRN, @@ -4833,9 +5058,17 @@ constructor( VE_RIF, VN_TIN, ZA_VAT, + /** An enum member indicating that [Type] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { AD_NRT -> Value.AD_NRT @@ -4912,6 +5145,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { AD_NRT -> Known.AD_NRT 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 9fa929b1..e2a9d768 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 @@ -21,6 +21,7 @@ import com.withorb.api.core.JsonField import com.withorb.api.core.JsonMissing import com.withorb.api.core.JsonValue import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.getOrThrow import com.withorb.api.core.http.Headers @@ -137,12 +138,12 @@ import kotlin.jvm.optionals.getOrNull * initial balance. */ class CustomerCreditLedgerCreateEntryByExternalIdParams -constructor( +private constructor( private val externalCustomerId: String, private val body: CustomerCreditLedgerCreateEntryByExternalIdBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun externalCustomerId(): String = externalCustomerId @@ -169,11 +170,11 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getBody(): CustomerCreditLedgerCreateEntryByExternalIdBody = body + @JvmSynthetic internal fun _body(): CustomerCreditLedgerCreateEntryByExternalIdBody = body - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun getPathParam(index: Int): String { return when (index) { @@ -375,6 +376,10 @@ constructor( ) } + /** + * An interface that defines how to map each variant of + * [CustomerCreditLedgerCreateEntryByExternalIdBody] to a value of type [T]. + */ interface Visitor { fun visitAddIncrementCreditLedgerEntryRequestParams( @@ -401,6 +406,17 @@ constructor( AddAmendmentCreditLedgerEntryRequestParams ): T + /** + * Maps an unknown variant of [CustomerCreditLedgerCreateEntryByExternalIdBody] to a + * value of type [T]. + * + * An instance of [CustomerCreditLedgerCreateEntryByExternalIdBody] can contain an + * unknown variant if it was deserialized from data that doesn't match any known + * variant. For example, if the SDK is on an older version than the API, then the API + * may respond with new variants that the SDK is unaware of. + * + * @throws OrbInvalidDataException in the default implementation. + */ fun unknown(json: JsonValue?): T { throw OrbInvalidDataException( "Unknown CustomerCreditLedgerCreateEntryByExternalIdBody: $json" @@ -408,7 +424,7 @@ constructor( } } - class Deserializer : + internal class Deserializer : BaseDeserializer( CustomerCreditLedgerCreateEntryByExternalIdBody::class ) { @@ -487,7 +503,7 @@ constructor( } } - class Serializer : + internal class Serializer : BaseSerializer( CustomerCreditLedgerCreateEntryByExternalIdBody::class ) { @@ -527,8 +543,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [CustomerCreditLedgerCreateEntryByExternalIdParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var externalCustomerId: String? = null private var body: CustomerCreditLedgerCreateEntryByExternalIdBody? = null @@ -891,7 +908,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AddIncrementCreditLedgerEntryRequestParams]. */ + class Builder internal constructor() { private var amount: JsonField? = null private var entryType: JsonField? = null @@ -1122,6 +1140,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -1131,21 +1157,51 @@ constructor( @JvmStatic fun of(value: String) = EntryType(JsonField.of(value)) } + /** An enum containing [EntryType]'s known values. */ enum class Known { INCREMENT, } + /** + * An enum containing [EntryType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EntryType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { INCREMENT, + /** + * An enum member indicating that [EntryType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { INCREMENT -> Value.INCREMENT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { INCREMENT -> Known.INCREMENT @@ -1266,7 +1322,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoiceSettings]. */ + class Builder internal constructor() { private var autoCollection: JsonField? = null private var netTerms: JsonField? = null @@ -1420,7 +1477,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -1599,7 +1657,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AddDecrementCreditLedgerEntryRequestParams]. */ + class Builder internal constructor() { private var amount: JsonField? = null private var entryType: JsonField? = null @@ -1736,6 +1795,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -1745,21 +1812,51 @@ constructor( @JvmStatic fun of(value: String) = EntryType(JsonField.of(value)) } + /** An enum containing [EntryType]'s known values. */ enum class Known { DECREMENT, } + /** + * An enum containing [EntryType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EntryType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DECREMENT, + /** + * An enum member indicating that [EntryType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { DECREMENT -> Value.DECREMENT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DECREMENT -> Known.DECREMENT @@ -1815,7 +1912,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -2041,7 +2139,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AddExpirationChangeCreditLedgerEntryRequestParams]. */ + class Builder internal constructor() { private var entryType: JsonField? = null private var expiryDate: JsonField? = null @@ -2248,6 +2347,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -2257,21 +2364,51 @@ constructor( @JvmStatic fun of(value: String) = EntryType(JsonField.of(value)) } + /** An enum containing [EntryType]'s known values. */ enum class Known { EXPIRATION_CHANGE, } + /** + * An enum containing [EntryType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EntryType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { EXPIRATION_CHANGE, + /** + * An enum member indicating that [EntryType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { EXPIRATION_CHANGE -> Value.EXPIRATION_CHANGE else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { EXPIRATION_CHANGE -> Known.EXPIRATION_CHANGE @@ -2327,7 +2464,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -2529,7 +2667,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AddVoidCreditLedgerEntryRequestParams]. */ + class Builder internal constructor() { private var amount: JsonField? = null private var blockId: JsonField? = null @@ -2688,6 +2827,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -2697,21 +2844,51 @@ constructor( @JvmStatic fun of(value: String) = EntryType(JsonField.of(value)) } + /** An enum containing [EntryType]'s known values. */ enum class Known { VOID, } + /** + * An enum containing [EntryType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EntryType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { VOID, + /** + * An enum member indicating that [EntryType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { VOID -> Value.VOID else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { VOID -> Known.VOID @@ -2767,7 +2944,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -2825,6 +3003,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -2834,21 +3020,51 @@ constructor( @JvmStatic fun of(value: String) = VoidReason(JsonField.of(value)) } + /** An enum containing [VoidReason]'s known values. */ enum class Known { REFUND, } + /** + * An enum containing [VoidReason]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [VoidReason] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { REFUND, + /** + * An enum member indicating that [VoidReason] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { REFUND -> Value.REFUND else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { REFUND -> Known.REFUND @@ -3008,7 +3224,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AddAmendmentCreditLedgerEntryRequestParams]. */ + class Builder internal constructor() { private var amount: JsonField? = null private var blockId: JsonField? = null @@ -3154,6 +3371,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -3163,21 +3388,51 @@ constructor( @JvmStatic fun of(value: String) = EntryType(JsonField.of(value)) } + /** An enum containing [EntryType]'s known values. */ enum class Known { AMENDMENT, } + /** + * An enum containing [EntryType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EntryType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { AMENDMENT, + /** + * An enum member indicating that [EntryType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { AMENDMENT -> Value.AMENDMENT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { AMENDMENT -> Known.AMENDMENT @@ -3233,7 +3488,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() 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 67256bc4..82bae509 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 @@ -248,6 +248,10 @@ private constructor( ) } + /** + * An interface that defines how to map each variant of + * [CustomerCreditLedgerCreateEntryByExternalIdResponse] to a value of type [T]. + */ interface Visitor { fun visitIncrementLedgerEntry(incrementLedgerEntry: IncrementLedgerEntry): T @@ -268,6 +272,17 @@ private constructor( fun visitAmendmentLedgerEntry(amendmentLedgerEntry: AmendmentLedgerEntry): T + /** + * Maps an unknown variant of [CustomerCreditLedgerCreateEntryByExternalIdResponse] to a + * value of type [T]. + * + * An instance of [CustomerCreditLedgerCreateEntryByExternalIdResponse] can contain an + * unknown variant if it was deserialized from data that doesn't match any known variant. + * For example, if the SDK is on an older version than the API, then the API may respond + * with new variants that the SDK is unaware of. + * + * @throws OrbInvalidDataException in the default implementation. + */ fun unknown(json: JsonValue?): T { throw OrbInvalidDataException( "Unknown CustomerCreditLedgerCreateEntryByExternalIdResponse: $json" @@ -275,7 +290,7 @@ private constructor( } } - class Deserializer : + internal class Deserializer : BaseDeserializer( CustomerCreditLedgerCreateEntryByExternalIdResponse::class ) { @@ -362,7 +377,7 @@ private constructor( } } - class Serializer : + internal class Serializer : BaseSerializer( CustomerCreditLedgerCreateEntryByExternalIdResponse::class ) { @@ -554,7 +569,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [IncrementLedgerEntry]. */ + class Builder internal constructor() { private var id: JsonField? = null private var amount: JsonField? = null @@ -766,7 +782,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CreditBlock]. */ + class Builder internal constructor() { private var id: JsonField? = null private var expiryDate: JsonField? = null @@ -902,7 +919,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Customer]. */ + class Builder internal constructor() { private var id: JsonField? = null private var externalCustomerId: JsonField? = null @@ -983,6 +1001,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -994,17 +1020,38 @@ private constructor( @JvmStatic fun of(value: String) = EntryStatus(JsonField.of(value)) } + /** An enum containing [EntryStatus]'s known values. */ enum class Known { COMMITTED, PENDING, } + /** + * An enum containing [EntryStatus]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EntryStatus] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { COMMITTED, PENDING, + /** + * An enum member indicating that [EntryStatus] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { COMMITTED -> Value.COMMITTED @@ -1012,6 +1059,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { COMMITTED -> Known.COMMITTED @@ -1040,6 +1096,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -1049,21 +1113,51 @@ private constructor( @JvmStatic fun of(value: String) = EntryType(JsonField.of(value)) } + /** An enum containing [EntryType]'s known values. */ enum class Known { INCREMENT, } + /** + * An enum containing [EntryType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EntryType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { INCREMENT, + /** + * An enum member indicating that [EntryType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { INCREMENT -> Value.INCREMENT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { INCREMENT -> Known.INCREMENT @@ -1119,7 +1213,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -1371,7 +1466,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [DecrementLedgerEntry]. */ + class Builder internal constructor() { private var id: JsonField? = null private var amount: JsonField? = null @@ -1610,7 +1706,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CreditBlock]. */ + class Builder internal constructor() { private var id: JsonField? = null private var expiryDate: JsonField? = null @@ -1746,7 +1843,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Customer]. */ + class Builder internal constructor() { private var id: JsonField? = null private var externalCustomerId: JsonField? = null @@ -1827,6 +1925,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -1838,17 +1944,38 @@ private constructor( @JvmStatic fun of(value: String) = EntryStatus(JsonField.of(value)) } + /** An enum containing [EntryStatus]'s known values. */ enum class Known { COMMITTED, PENDING, } + /** + * An enum containing [EntryStatus]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EntryStatus] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { COMMITTED, PENDING, + /** + * An enum member indicating that [EntryStatus] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { COMMITTED -> Value.COMMITTED @@ -1856,6 +1983,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { COMMITTED -> Known.COMMITTED @@ -1884,6 +2020,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -1893,21 +2037,51 @@ private constructor( @JvmStatic fun of(value: String) = EntryType(JsonField.of(value)) } + /** An enum containing [EntryType]'s known values. */ enum class Known { DECREMENT, } + /** + * An enum containing [EntryType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EntryType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DECREMENT, + /** + * An enum member indicating that [EntryType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { DECREMENT -> Value.DECREMENT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DECREMENT -> Known.DECREMENT @@ -1963,7 +2137,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -2202,7 +2377,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [ExpirationChangeLedgerEntry]. */ + class Builder internal constructor() { private var id: JsonField? = null private var amount: JsonField? = null @@ -2428,7 +2604,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CreditBlock]. */ + class Builder internal constructor() { private var id: JsonField? = null private var expiryDate: JsonField? = null @@ -2564,7 +2741,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Customer]. */ + class Builder internal constructor() { private var id: JsonField? = null private var externalCustomerId: JsonField? = null @@ -2645,6 +2823,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -2656,17 +2842,38 @@ private constructor( @JvmStatic fun of(value: String) = EntryStatus(JsonField.of(value)) } + /** An enum containing [EntryStatus]'s known values. */ enum class Known { COMMITTED, PENDING, } + /** + * An enum containing [EntryStatus]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EntryStatus] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { COMMITTED, PENDING, + /** + * An enum member indicating that [EntryStatus] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { COMMITTED -> Value.COMMITTED @@ -2674,6 +2881,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { COMMITTED -> Known.COMMITTED @@ -2702,6 +2918,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -2711,21 +2935,51 @@ private constructor( @JvmStatic fun of(value: String) = EntryType(JsonField.of(value)) } + /** An enum containing [EntryType]'s known values. */ enum class Known { EXPIRATION_CHANGE, } + /** + * An enum containing [EntryType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EntryType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { EXPIRATION_CHANGE, + /** + * An enum member indicating that [EntryType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { EXPIRATION_CHANGE -> Value.EXPIRATION_CHANGE else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { EXPIRATION_CHANGE -> Known.EXPIRATION_CHANGE @@ -2781,7 +3035,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -3009,7 +3264,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CreditBlockExpiryLedgerEntry]. */ + class Builder internal constructor() { private var id: JsonField? = null private var amount: JsonField? = null @@ -3222,7 +3478,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CreditBlock]. */ + class Builder internal constructor() { private var id: JsonField? = null private var expiryDate: JsonField? = null @@ -3358,7 +3615,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Customer]. */ + class Builder internal constructor() { private var id: JsonField? = null private var externalCustomerId: JsonField? = null @@ -3439,6 +3697,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -3450,17 +3716,38 @@ private constructor( @JvmStatic fun of(value: String) = EntryStatus(JsonField.of(value)) } + /** An enum containing [EntryStatus]'s known values. */ enum class Known { COMMITTED, PENDING, } + /** + * An enum containing [EntryStatus]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EntryStatus] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { COMMITTED, PENDING, + /** + * An enum member indicating that [EntryStatus] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { COMMITTED -> Value.COMMITTED @@ -3468,6 +3755,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { COMMITTED -> Known.COMMITTED @@ -3496,6 +3792,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -3505,21 +3809,51 @@ private constructor( @JvmStatic fun of(value: String) = EntryType(JsonField.of(value)) } + /** An enum containing [EntryType]'s known values. */ enum class Known { CREDIT_BLOCK_EXPIRY, } + /** + * An enum containing [EntryType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EntryType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { CREDIT_BLOCK_EXPIRY, + /** + * An enum member indicating that [EntryType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { CREDIT_BLOCK_EXPIRY -> Value.CREDIT_BLOCK_EXPIRY else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { CREDIT_BLOCK_EXPIRY -> Known.CREDIT_BLOCK_EXPIRY @@ -3575,7 +3909,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -3824,7 +4159,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [VoidLedgerEntry]. */ + class Builder internal constructor() { private var id: JsonField? = null private var amount: JsonField? = null @@ -4052,7 +4388,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CreditBlock]. */ + class Builder internal constructor() { private var id: JsonField? = null private var expiryDate: JsonField? = null @@ -4188,7 +4525,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Customer]. */ + class Builder internal constructor() { private var id: JsonField? = null private var externalCustomerId: JsonField? = null @@ -4269,6 +4607,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -4280,17 +4626,38 @@ private constructor( @JvmStatic fun of(value: String) = EntryStatus(JsonField.of(value)) } + /** An enum containing [EntryStatus]'s known values. */ enum class Known { COMMITTED, PENDING, } + /** + * An enum containing [EntryStatus]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EntryStatus] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { COMMITTED, PENDING, + /** + * An enum member indicating that [EntryStatus] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { COMMITTED -> Value.COMMITTED @@ -4298,6 +4665,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { COMMITTED -> Known.COMMITTED @@ -4326,6 +4702,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -4335,21 +4719,51 @@ private constructor( @JvmStatic fun of(value: String) = EntryType(JsonField.of(value)) } + /** An enum containing [EntryType]'s known values. */ enum class Known { VOID, } + /** + * An enum containing [EntryType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EntryType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { VOID, + /** + * An enum member indicating that [EntryType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { VOID -> Value.VOID else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { VOID -> Known.VOID @@ -4405,7 +4819,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -4665,7 +5080,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [VoidInitiatedLedgerEntry]. */ + class Builder internal constructor() { private var id: JsonField? = null private var amount: JsonField? = null @@ -4903,7 +5319,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CreditBlock]. */ + class Builder internal constructor() { private var id: JsonField? = null private var expiryDate: JsonField? = null @@ -5039,7 +5456,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Customer]. */ + class Builder internal constructor() { private var id: JsonField? = null private var externalCustomerId: JsonField? = null @@ -5120,6 +5538,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -5131,17 +5557,38 @@ private constructor( @JvmStatic fun of(value: String) = EntryStatus(JsonField.of(value)) } + /** An enum containing [EntryStatus]'s known values. */ enum class Known { COMMITTED, PENDING, } + /** + * An enum containing [EntryStatus]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EntryStatus] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { COMMITTED, PENDING, + /** + * An enum member indicating that [EntryStatus] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { COMMITTED -> Value.COMMITTED @@ -5149,6 +5596,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { COMMITTED -> Known.COMMITTED @@ -5177,6 +5633,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -5186,21 +5650,51 @@ private constructor( @JvmStatic fun of(value: String) = EntryType(JsonField.of(value)) } + /** An enum containing [EntryType]'s known values. */ enum class Known { VOID_INITIATED, } + /** + * An enum containing [EntryType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EntryType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { VOID_INITIATED, + /** + * An enum member indicating that [EntryType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { VOID_INITIATED -> Value.VOID_INITIATED else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { VOID_INITIATED -> Known.VOID_INITIATED @@ -5256,7 +5750,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -5484,7 +5979,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AmendmentLedgerEntry]. */ + class Builder internal constructor() { private var id: JsonField? = null private var amount: JsonField? = null @@ -5696,7 +6192,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CreditBlock]. */ + class Builder internal constructor() { private var id: JsonField? = null private var expiryDate: JsonField? = null @@ -5832,7 +6329,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Customer]. */ + class Builder internal constructor() { private var id: JsonField? = null private var externalCustomerId: JsonField? = null @@ -5913,6 +6411,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -5924,17 +6430,38 @@ private constructor( @JvmStatic fun of(value: String) = EntryStatus(JsonField.of(value)) } + /** An enum containing [EntryStatus]'s known values. */ enum class Known { COMMITTED, PENDING, } + /** + * An enum containing [EntryStatus]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EntryStatus] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { COMMITTED, PENDING, + /** + * An enum member indicating that [EntryStatus] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { COMMITTED -> Value.COMMITTED @@ -5942,6 +6469,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { COMMITTED -> Known.COMMITTED @@ -5970,6 +6506,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -5979,21 +6523,51 @@ private constructor( @JvmStatic fun of(value: String) = EntryType(JsonField.of(value)) } + /** An enum containing [EntryType]'s known values. */ enum class Known { AMENDMENT, } + /** + * An enum containing [EntryType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EntryType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { AMENDMENT, + /** + * An enum member indicating that [EntryType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { AMENDMENT -> Value.AMENDMENT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { AMENDMENT -> Known.AMENDMENT @@ -6049,7 +6623,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() 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 4d312d36..3ad0a041 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 @@ -21,6 +21,7 @@ import com.withorb.api.core.JsonField import com.withorb.api.core.JsonMissing import com.withorb.api.core.JsonValue import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.getOrThrow import com.withorb.api.core.http.Headers @@ -137,12 +138,12 @@ import kotlin.jvm.optionals.getOrNull * initial balance. */ class CustomerCreditLedgerCreateEntryParams -constructor( +private constructor( private val customerId: String, private val body: CustomerCreditLedgerCreateEntryBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun customerId(): String = customerId @@ -169,11 +170,11 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getBody(): CustomerCreditLedgerCreateEntryBody = body + @JvmSynthetic internal fun _body(): CustomerCreditLedgerCreateEntryBody = body - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun getPathParam(index: Int): String { return when (index) { @@ -372,6 +373,10 @@ constructor( ) } + /** + * An interface that defines how to map each variant of + * [CustomerCreditLedgerCreateEntryBody] to a value of type [T]. + */ interface Visitor { fun visitAddIncrementCreditLedgerEntryRequestParams( @@ -398,12 +403,23 @@ constructor( AddAmendmentCreditLedgerEntryRequestParams ): T + /** + * Maps an unknown variant of [CustomerCreditLedgerCreateEntryBody] to a value of type + * [T]. + * + * An instance of [CustomerCreditLedgerCreateEntryBody] can contain an unknown variant + * if it was deserialized from data that doesn't match any known variant. For example, + * if the SDK is on an older version than the API, then the API may respond with new + * variants that the SDK is unaware of. + * + * @throws OrbInvalidDataException in the default implementation. + */ fun unknown(json: JsonValue?): T { throw OrbInvalidDataException("Unknown CustomerCreditLedgerCreateEntryBody: $json") } } - class Deserializer : + internal class Deserializer : BaseDeserializer( CustomerCreditLedgerCreateEntryBody::class ) { @@ -482,7 +498,7 @@ constructor( } } - class Serializer : + internal class Serializer : BaseSerializer( CustomerCreditLedgerCreateEntryBody::class ) { @@ -520,8 +536,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [CustomerCreditLedgerCreateEntryParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var customerId: String? = null private var body: CustomerCreditLedgerCreateEntryBody? = null @@ -877,7 +894,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AddIncrementCreditLedgerEntryRequestParams]. */ + class Builder internal constructor() { private var amount: JsonField? = null private var entryType: JsonField? = null @@ -1108,6 +1126,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -1117,21 +1143,51 @@ constructor( @JvmStatic fun of(value: String) = EntryType(JsonField.of(value)) } + /** An enum containing [EntryType]'s known values. */ enum class Known { INCREMENT, } + /** + * An enum containing [EntryType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EntryType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { INCREMENT, + /** + * An enum member indicating that [EntryType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { INCREMENT -> Value.INCREMENT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { INCREMENT -> Known.INCREMENT @@ -1252,7 +1308,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoiceSettings]. */ + class Builder internal constructor() { private var autoCollection: JsonField? = null private var netTerms: JsonField? = null @@ -1406,7 +1463,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -1585,7 +1643,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AddDecrementCreditLedgerEntryRequestParams]. */ + class Builder internal constructor() { private var amount: JsonField? = null private var entryType: JsonField? = null @@ -1722,6 +1781,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -1731,21 +1798,51 @@ constructor( @JvmStatic fun of(value: String) = EntryType(JsonField.of(value)) } + /** An enum containing [EntryType]'s known values. */ enum class Known { DECREMENT, } + /** + * An enum containing [EntryType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EntryType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DECREMENT, + /** + * An enum member indicating that [EntryType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { DECREMENT -> Value.DECREMENT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DECREMENT -> Known.DECREMENT @@ -1801,7 +1898,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -2027,7 +2125,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AddExpirationChangeCreditLedgerEntryRequestParams]. */ + class Builder internal constructor() { private var entryType: JsonField? = null private var expiryDate: JsonField? = null @@ -2234,6 +2333,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -2243,21 +2350,51 @@ constructor( @JvmStatic fun of(value: String) = EntryType(JsonField.of(value)) } + /** An enum containing [EntryType]'s known values. */ enum class Known { EXPIRATION_CHANGE, } + /** + * An enum containing [EntryType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EntryType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { EXPIRATION_CHANGE, + /** + * An enum member indicating that [EntryType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { EXPIRATION_CHANGE -> Value.EXPIRATION_CHANGE else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { EXPIRATION_CHANGE -> Known.EXPIRATION_CHANGE @@ -2313,7 +2450,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -2515,7 +2653,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AddVoidCreditLedgerEntryRequestParams]. */ + class Builder internal constructor() { private var amount: JsonField? = null private var blockId: JsonField? = null @@ -2674,6 +2813,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -2683,21 +2830,51 @@ constructor( @JvmStatic fun of(value: String) = EntryType(JsonField.of(value)) } + /** An enum containing [EntryType]'s known values. */ enum class Known { VOID, } + /** + * An enum containing [EntryType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EntryType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { VOID, + /** + * An enum member indicating that [EntryType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { VOID -> Value.VOID else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { VOID -> Known.VOID @@ -2753,7 +2930,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -2811,6 +2989,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -2820,21 +3006,51 @@ constructor( @JvmStatic fun of(value: String) = VoidReason(JsonField.of(value)) } + /** An enum containing [VoidReason]'s known values. */ enum class Known { REFUND, } + /** + * An enum containing [VoidReason]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [VoidReason] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { REFUND, + /** + * An enum member indicating that [VoidReason] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { REFUND -> Value.REFUND else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { REFUND -> Known.REFUND @@ -2994,7 +3210,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AddAmendmentCreditLedgerEntryRequestParams]. */ + class Builder internal constructor() { private var amount: JsonField? = null private var blockId: JsonField? = null @@ -3140,6 +3357,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -3149,21 +3374,51 @@ constructor( @JvmStatic fun of(value: String) = EntryType(JsonField.of(value)) } + /** An enum containing [EntryType]'s known values. */ enum class Known { AMENDMENT, } + /** + * An enum containing [EntryType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EntryType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { AMENDMENT, + /** + * An enum member indicating that [EntryType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { AMENDMENT -> Value.AMENDMENT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { AMENDMENT -> Known.AMENDMENT @@ -3219,7 +3474,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() 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 7f53bb90..c2928511 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 @@ -239,6 +239,10 @@ private constructor( CustomerCreditLedgerCreateEntryResponse(amendmentLedgerEntry = amendmentLedgerEntry) } + /** + * An interface that defines how to map each variant of + * [CustomerCreditLedgerCreateEntryResponse] to a value of type [T]. + */ interface Visitor { fun visitIncrementLedgerEntry(incrementLedgerEntry: IncrementLedgerEntry): T @@ -259,12 +263,23 @@ private constructor( fun visitAmendmentLedgerEntry(amendmentLedgerEntry: AmendmentLedgerEntry): T + /** + * Maps an unknown variant of [CustomerCreditLedgerCreateEntryResponse] to a value of type + * [T]. + * + * An instance of [CustomerCreditLedgerCreateEntryResponse] can contain an unknown variant + * if it was deserialized from data that doesn't match any known variant. For example, if + * the SDK is on an older version than the API, then the API may respond with new variants + * that the SDK is unaware of. + * + * @throws OrbInvalidDataException in the default implementation. + */ fun unknown(json: JsonValue?): T { throw OrbInvalidDataException("Unknown CustomerCreditLedgerCreateEntryResponse: $json") } } - class Deserializer : + internal class Deserializer : BaseDeserializer( CustomerCreditLedgerCreateEntryResponse::class ) { @@ -351,7 +366,7 @@ private constructor( } } - class Serializer : + internal class Serializer : BaseSerializer( CustomerCreditLedgerCreateEntryResponse::class ) { @@ -541,7 +556,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [IncrementLedgerEntry]. */ + class Builder internal constructor() { private var id: JsonField? = null private var amount: JsonField? = null @@ -753,7 +769,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CreditBlock]. */ + class Builder internal constructor() { private var id: JsonField? = null private var expiryDate: JsonField? = null @@ -889,7 +906,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Customer]. */ + class Builder internal constructor() { private var id: JsonField? = null private var externalCustomerId: JsonField? = null @@ -970,6 +988,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -981,17 +1007,38 @@ private constructor( @JvmStatic fun of(value: String) = EntryStatus(JsonField.of(value)) } + /** An enum containing [EntryStatus]'s known values. */ enum class Known { COMMITTED, PENDING, } + /** + * An enum containing [EntryStatus]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EntryStatus] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { COMMITTED, PENDING, + /** + * An enum member indicating that [EntryStatus] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { COMMITTED -> Value.COMMITTED @@ -999,6 +1046,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { COMMITTED -> Known.COMMITTED @@ -1027,6 +1083,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -1036,21 +1100,51 @@ private constructor( @JvmStatic fun of(value: String) = EntryType(JsonField.of(value)) } + /** An enum containing [EntryType]'s known values. */ enum class Known { INCREMENT, } + /** + * An enum containing [EntryType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EntryType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { INCREMENT, + /** + * An enum member indicating that [EntryType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { INCREMENT -> Value.INCREMENT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { INCREMENT -> Known.INCREMENT @@ -1106,7 +1200,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -1358,7 +1453,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [DecrementLedgerEntry]. */ + class Builder internal constructor() { private var id: JsonField? = null private var amount: JsonField? = null @@ -1597,7 +1693,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CreditBlock]. */ + class Builder internal constructor() { private var id: JsonField? = null private var expiryDate: JsonField? = null @@ -1733,7 +1830,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Customer]. */ + class Builder internal constructor() { private var id: JsonField? = null private var externalCustomerId: JsonField? = null @@ -1814,6 +1912,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -1825,17 +1931,38 @@ private constructor( @JvmStatic fun of(value: String) = EntryStatus(JsonField.of(value)) } + /** An enum containing [EntryStatus]'s known values. */ enum class Known { COMMITTED, PENDING, } + /** + * An enum containing [EntryStatus]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EntryStatus] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { COMMITTED, PENDING, + /** + * An enum member indicating that [EntryStatus] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { COMMITTED -> Value.COMMITTED @@ -1843,6 +1970,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { COMMITTED -> Known.COMMITTED @@ -1871,6 +2007,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -1880,21 +2024,51 @@ private constructor( @JvmStatic fun of(value: String) = EntryType(JsonField.of(value)) } + /** An enum containing [EntryType]'s known values. */ enum class Known { DECREMENT, } + /** + * An enum containing [EntryType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EntryType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DECREMENT, + /** + * An enum member indicating that [EntryType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { DECREMENT -> Value.DECREMENT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DECREMENT -> Known.DECREMENT @@ -1950,7 +2124,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -2189,7 +2364,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [ExpirationChangeLedgerEntry]. */ + class Builder internal constructor() { private var id: JsonField? = null private var amount: JsonField? = null @@ -2415,7 +2591,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CreditBlock]. */ + class Builder internal constructor() { private var id: JsonField? = null private var expiryDate: JsonField? = null @@ -2551,7 +2728,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Customer]. */ + class Builder internal constructor() { private var id: JsonField? = null private var externalCustomerId: JsonField? = null @@ -2632,6 +2810,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -2643,17 +2829,38 @@ private constructor( @JvmStatic fun of(value: String) = EntryStatus(JsonField.of(value)) } + /** An enum containing [EntryStatus]'s known values. */ enum class Known { COMMITTED, PENDING, } + /** + * An enum containing [EntryStatus]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EntryStatus] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { COMMITTED, PENDING, + /** + * An enum member indicating that [EntryStatus] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { COMMITTED -> Value.COMMITTED @@ -2661,6 +2868,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { COMMITTED -> Known.COMMITTED @@ -2689,6 +2905,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -2698,21 +2922,51 @@ private constructor( @JvmStatic fun of(value: String) = EntryType(JsonField.of(value)) } + /** An enum containing [EntryType]'s known values. */ enum class Known { EXPIRATION_CHANGE, } + /** + * An enum containing [EntryType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EntryType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { EXPIRATION_CHANGE, + /** + * An enum member indicating that [EntryType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { EXPIRATION_CHANGE -> Value.EXPIRATION_CHANGE else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { EXPIRATION_CHANGE -> Known.EXPIRATION_CHANGE @@ -2768,7 +3022,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -2996,7 +3251,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CreditBlockExpiryLedgerEntry]. */ + class Builder internal constructor() { private var id: JsonField? = null private var amount: JsonField? = null @@ -3209,7 +3465,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CreditBlock]. */ + class Builder internal constructor() { private var id: JsonField? = null private var expiryDate: JsonField? = null @@ -3345,7 +3602,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Customer]. */ + class Builder internal constructor() { private var id: JsonField? = null private var externalCustomerId: JsonField? = null @@ -3426,6 +3684,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -3437,17 +3703,38 @@ private constructor( @JvmStatic fun of(value: String) = EntryStatus(JsonField.of(value)) } + /** An enum containing [EntryStatus]'s known values. */ enum class Known { COMMITTED, PENDING, } + /** + * An enum containing [EntryStatus]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EntryStatus] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { COMMITTED, PENDING, + /** + * An enum member indicating that [EntryStatus] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { COMMITTED -> Value.COMMITTED @@ -3455,6 +3742,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { COMMITTED -> Known.COMMITTED @@ -3483,6 +3779,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -3492,21 +3796,51 @@ private constructor( @JvmStatic fun of(value: String) = EntryType(JsonField.of(value)) } + /** An enum containing [EntryType]'s known values. */ enum class Known { CREDIT_BLOCK_EXPIRY, } + /** + * An enum containing [EntryType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EntryType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { CREDIT_BLOCK_EXPIRY, + /** + * An enum member indicating that [EntryType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { CREDIT_BLOCK_EXPIRY -> Value.CREDIT_BLOCK_EXPIRY else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { CREDIT_BLOCK_EXPIRY -> Known.CREDIT_BLOCK_EXPIRY @@ -3562,7 +3896,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -3811,7 +4146,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [VoidLedgerEntry]. */ + class Builder internal constructor() { private var id: JsonField? = null private var amount: JsonField? = null @@ -4039,7 +4375,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CreditBlock]. */ + class Builder internal constructor() { private var id: JsonField? = null private var expiryDate: JsonField? = null @@ -4175,7 +4512,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Customer]. */ + class Builder internal constructor() { private var id: JsonField? = null private var externalCustomerId: JsonField? = null @@ -4256,6 +4594,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -4267,17 +4613,38 @@ private constructor( @JvmStatic fun of(value: String) = EntryStatus(JsonField.of(value)) } + /** An enum containing [EntryStatus]'s known values. */ enum class Known { COMMITTED, PENDING, } + /** + * An enum containing [EntryStatus]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EntryStatus] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { COMMITTED, PENDING, + /** + * An enum member indicating that [EntryStatus] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { COMMITTED -> Value.COMMITTED @@ -4285,6 +4652,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { COMMITTED -> Known.COMMITTED @@ -4313,6 +4689,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -4322,21 +4706,51 @@ private constructor( @JvmStatic fun of(value: String) = EntryType(JsonField.of(value)) } + /** An enum containing [EntryType]'s known values. */ enum class Known { VOID, } + /** + * An enum containing [EntryType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EntryType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { VOID, + /** + * An enum member indicating that [EntryType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { VOID -> Value.VOID else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { VOID -> Known.VOID @@ -4392,7 +4806,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -4652,7 +5067,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [VoidInitiatedLedgerEntry]. */ + class Builder internal constructor() { private var id: JsonField? = null private var amount: JsonField? = null @@ -4890,7 +5306,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CreditBlock]. */ + class Builder internal constructor() { private var id: JsonField? = null private var expiryDate: JsonField? = null @@ -5026,7 +5443,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Customer]. */ + class Builder internal constructor() { private var id: JsonField? = null private var externalCustomerId: JsonField? = null @@ -5107,6 +5525,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -5118,17 +5544,38 @@ private constructor( @JvmStatic fun of(value: String) = EntryStatus(JsonField.of(value)) } + /** An enum containing [EntryStatus]'s known values. */ enum class Known { COMMITTED, PENDING, } + /** + * An enum containing [EntryStatus]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EntryStatus] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { COMMITTED, PENDING, + /** + * An enum member indicating that [EntryStatus] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { COMMITTED -> Value.COMMITTED @@ -5136,6 +5583,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { COMMITTED -> Known.COMMITTED @@ -5164,6 +5620,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -5173,21 +5637,51 @@ private constructor( @JvmStatic fun of(value: String) = EntryType(JsonField.of(value)) } + /** An enum containing [EntryType]'s known values. */ enum class Known { VOID_INITIATED, } + /** + * An enum containing [EntryType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EntryType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { VOID_INITIATED, + /** + * An enum member indicating that [EntryType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { VOID_INITIATED -> Value.VOID_INITIATED else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { VOID_INITIATED -> Known.VOID_INITIATED @@ -5243,7 +5737,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -5471,7 +5966,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AmendmentLedgerEntry]. */ + class Builder internal constructor() { private var id: JsonField? = null private var amount: JsonField? = null @@ -5683,7 +6179,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CreditBlock]. */ + class Builder internal constructor() { private var id: JsonField? = null private var expiryDate: JsonField? = null @@ -5819,7 +6316,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Customer]. */ + class Builder internal constructor() { private var id: JsonField? = null private var externalCustomerId: JsonField? = null @@ -5900,6 +6398,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -5911,17 +6417,38 @@ private constructor( @JvmStatic fun of(value: String) = EntryStatus(JsonField.of(value)) } + /** An enum containing [EntryStatus]'s known values. */ enum class Known { COMMITTED, PENDING, } + /** + * An enum containing [EntryStatus]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EntryStatus] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { COMMITTED, PENDING, + /** + * An enum member indicating that [EntryStatus] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { COMMITTED -> Value.COMMITTED @@ -5929,6 +6456,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { COMMITTED -> Known.COMMITTED @@ -5957,6 +6493,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -5966,21 +6510,51 @@ private constructor( @JvmStatic fun of(value: String) = EntryType(JsonField.of(value)) } + /** An enum containing [EntryType]'s known values. */ enum class Known { AMENDMENT, } + /** + * An enum containing [EntryType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EntryType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { AMENDMENT, + /** + * An enum member indicating that [EntryType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { AMENDMENT -> Value.AMENDMENT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { AMENDMENT -> Known.AMENDMENT @@ -6036,7 +6610,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() 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 716dc50d..0832108c 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 @@ -268,8 +268,7 @@ private constructor( } } - class AutoPager - constructor( + class AutoPager( private val firstPage: CustomerCreditLedgerListByExternalIdPage, ) : Iterable { 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 5d8f449f..6a294e96 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 @@ -271,8 +271,7 @@ private constructor( } } - class AutoPager - constructor( + class AutoPager( private val firstPage: CustomerCreditLedgerListByExternalIdPageAsync, ) { 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 7e1e4535..e2806d76 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 @@ -6,6 +6,7 @@ import com.fasterxml.jackson.annotation.JsonCreator import com.withorb.api.core.Enum import com.withorb.api.core.JsonField import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -93,7 +94,7 @@ import java.util.Optional * added to the ledger to indicate the adjustment of credits. */ class CustomerCreditLedgerListByExternalIdParams -constructor( +private constructor( private val externalCustomerId: String, private val createdAtGt: OffsetDateTime?, private val createdAtGte: OffsetDateTime?, @@ -107,7 +108,7 @@ constructor( private val minimumAmount: String?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun externalCustomerId(): String = externalCustomerId @@ -141,10 +142,9 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic - internal fun getQueryParams(): QueryParams { + override fun _queryParams(): QueryParams { val queryParams = QueryParams.builder() this.createdAtGt?.let { queryParams.put( @@ -194,8 +194,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [CustomerCreditLedgerListByExternalIdParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var externalCustomerId: String? = null private var createdAtGt: OffsetDateTime? = null @@ -419,6 +420,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -430,17 +439,37 @@ constructor( @JvmStatic fun of(value: String) = EntryStatus(JsonField.of(value)) } + /** An enum containing [EntryStatus]'s known values. */ enum class Known { COMMITTED, PENDING, } + /** + * An enum containing [EntryStatus]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EntryStatus] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { COMMITTED, PENDING, + /** + * An enum member indicating that [EntryStatus] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { COMMITTED -> Value.COMMITTED @@ -448,6 +477,14 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { COMMITTED -> Known.COMMITTED @@ -476,6 +513,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -497,6 +542,7 @@ constructor( @JvmStatic fun of(value: String) = EntryType(JsonField.of(value)) } + /** An enum containing [EntryType]'s known values. */ enum class Known { INCREMENT, DECREMENT, @@ -507,6 +553,15 @@ constructor( AMENDMENT, } + /** + * An enum containing [EntryType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EntryType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { INCREMENT, DECREMENT, @@ -515,9 +570,19 @@ constructor( VOID, VOID_INITIATED, AMENDMENT, + /** + * An enum member indicating that [EntryType] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { INCREMENT -> Value.INCREMENT @@ -530,6 +595,14 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { INCREMENT -> Known.INCREMENT 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 584c1886..cf965a98 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 @@ -246,6 +246,10 @@ private constructor( ) } + /** + * An interface that defines how to map each variant of + * [CustomerCreditLedgerListByExternalIdResponse] to a value of type [T]. + */ interface Visitor { fun visitIncrementLedgerEntry(incrementLedgerEntry: IncrementLedgerEntry): T @@ -266,6 +270,17 @@ private constructor( fun visitAmendmentLedgerEntry(amendmentLedgerEntry: AmendmentLedgerEntry): T + /** + * Maps an unknown variant of [CustomerCreditLedgerListByExternalIdResponse] to a value of + * type [T]. + * + * An instance of [CustomerCreditLedgerListByExternalIdResponse] can contain an unknown + * variant if it was deserialized from data that doesn't match any known variant. For + * example, if the SDK is on an older version than the API, then the API may respond with + * new variants that the SDK is unaware of. + * + * @throws OrbInvalidDataException in the default implementation. + */ fun unknown(json: JsonValue?): T { throw OrbInvalidDataException( "Unknown CustomerCreditLedgerListByExternalIdResponse: $json" @@ -273,7 +288,7 @@ private constructor( } } - class Deserializer : + internal class Deserializer : BaseDeserializer( CustomerCreditLedgerListByExternalIdResponse::class ) { @@ -360,7 +375,7 @@ private constructor( } } - class Serializer : + internal class Serializer : BaseSerializer( CustomerCreditLedgerListByExternalIdResponse::class ) { @@ -552,7 +567,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [IncrementLedgerEntry]. */ + class Builder internal constructor() { private var id: JsonField? = null private var amount: JsonField? = null @@ -764,7 +780,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CreditBlock]. */ + class Builder internal constructor() { private var id: JsonField? = null private var expiryDate: JsonField? = null @@ -900,7 +917,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Customer]. */ + class Builder internal constructor() { private var id: JsonField? = null private var externalCustomerId: JsonField? = null @@ -981,6 +999,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -992,17 +1018,38 @@ private constructor( @JvmStatic fun of(value: String) = EntryStatus(JsonField.of(value)) } + /** An enum containing [EntryStatus]'s known values. */ enum class Known { COMMITTED, PENDING, } + /** + * An enum containing [EntryStatus]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EntryStatus] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { COMMITTED, PENDING, + /** + * An enum member indicating that [EntryStatus] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { COMMITTED -> Value.COMMITTED @@ -1010,6 +1057,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { COMMITTED -> Known.COMMITTED @@ -1038,6 +1094,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -1047,21 +1111,51 @@ private constructor( @JvmStatic fun of(value: String) = EntryType(JsonField.of(value)) } + /** An enum containing [EntryType]'s known values. */ enum class Known { INCREMENT, } + /** + * An enum containing [EntryType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EntryType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { INCREMENT, + /** + * An enum member indicating that [EntryType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { INCREMENT -> Value.INCREMENT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { INCREMENT -> Known.INCREMENT @@ -1117,7 +1211,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -1369,7 +1464,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [DecrementLedgerEntry]. */ + class Builder internal constructor() { private var id: JsonField? = null private var amount: JsonField? = null @@ -1608,7 +1704,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CreditBlock]. */ + class Builder internal constructor() { private var id: JsonField? = null private var expiryDate: JsonField? = null @@ -1744,7 +1841,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Customer]. */ + class Builder internal constructor() { private var id: JsonField? = null private var externalCustomerId: JsonField? = null @@ -1825,6 +1923,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -1836,17 +1942,38 @@ private constructor( @JvmStatic fun of(value: String) = EntryStatus(JsonField.of(value)) } + /** An enum containing [EntryStatus]'s known values. */ enum class Known { COMMITTED, PENDING, } + /** + * An enum containing [EntryStatus]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EntryStatus] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { COMMITTED, PENDING, + /** + * An enum member indicating that [EntryStatus] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { COMMITTED -> Value.COMMITTED @@ -1854,6 +1981,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { COMMITTED -> Known.COMMITTED @@ -1882,6 +2018,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -1891,21 +2035,51 @@ private constructor( @JvmStatic fun of(value: String) = EntryType(JsonField.of(value)) } + /** An enum containing [EntryType]'s known values. */ enum class Known { DECREMENT, } + /** + * An enum containing [EntryType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EntryType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DECREMENT, + /** + * An enum member indicating that [EntryType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { DECREMENT -> Value.DECREMENT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DECREMENT -> Known.DECREMENT @@ -1961,7 +2135,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -2200,7 +2375,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [ExpirationChangeLedgerEntry]. */ + class Builder internal constructor() { private var id: JsonField? = null private var amount: JsonField? = null @@ -2426,7 +2602,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CreditBlock]. */ + class Builder internal constructor() { private var id: JsonField? = null private var expiryDate: JsonField? = null @@ -2562,7 +2739,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Customer]. */ + class Builder internal constructor() { private var id: JsonField? = null private var externalCustomerId: JsonField? = null @@ -2643,6 +2821,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -2654,17 +2840,38 @@ private constructor( @JvmStatic fun of(value: String) = EntryStatus(JsonField.of(value)) } + /** An enum containing [EntryStatus]'s known values. */ enum class Known { COMMITTED, PENDING, } + /** + * An enum containing [EntryStatus]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EntryStatus] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { COMMITTED, PENDING, + /** + * An enum member indicating that [EntryStatus] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { COMMITTED -> Value.COMMITTED @@ -2672,6 +2879,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { COMMITTED -> Known.COMMITTED @@ -2700,6 +2916,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -2709,21 +2933,51 @@ private constructor( @JvmStatic fun of(value: String) = EntryType(JsonField.of(value)) } + /** An enum containing [EntryType]'s known values. */ enum class Known { EXPIRATION_CHANGE, } + /** + * An enum containing [EntryType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EntryType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { EXPIRATION_CHANGE, + /** + * An enum member indicating that [EntryType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { EXPIRATION_CHANGE -> Value.EXPIRATION_CHANGE else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { EXPIRATION_CHANGE -> Known.EXPIRATION_CHANGE @@ -2779,7 +3033,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -3007,7 +3262,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CreditBlockExpiryLedgerEntry]. */ + class Builder internal constructor() { private var id: JsonField? = null private var amount: JsonField? = null @@ -3220,7 +3476,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CreditBlock]. */ + class Builder internal constructor() { private var id: JsonField? = null private var expiryDate: JsonField? = null @@ -3356,7 +3613,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Customer]. */ + class Builder internal constructor() { private var id: JsonField? = null private var externalCustomerId: JsonField? = null @@ -3437,6 +3695,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -3448,17 +3714,38 @@ private constructor( @JvmStatic fun of(value: String) = EntryStatus(JsonField.of(value)) } + /** An enum containing [EntryStatus]'s known values. */ enum class Known { COMMITTED, PENDING, } + /** + * An enum containing [EntryStatus]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EntryStatus] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { COMMITTED, PENDING, + /** + * An enum member indicating that [EntryStatus] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { COMMITTED -> Value.COMMITTED @@ -3466,6 +3753,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { COMMITTED -> Known.COMMITTED @@ -3494,6 +3790,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -3503,21 +3807,51 @@ private constructor( @JvmStatic fun of(value: String) = EntryType(JsonField.of(value)) } + /** An enum containing [EntryType]'s known values. */ enum class Known { CREDIT_BLOCK_EXPIRY, } + /** + * An enum containing [EntryType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EntryType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { CREDIT_BLOCK_EXPIRY, + /** + * An enum member indicating that [EntryType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { CREDIT_BLOCK_EXPIRY -> Value.CREDIT_BLOCK_EXPIRY else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { CREDIT_BLOCK_EXPIRY -> Known.CREDIT_BLOCK_EXPIRY @@ -3573,7 +3907,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -3822,7 +4157,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [VoidLedgerEntry]. */ + class Builder internal constructor() { private var id: JsonField? = null private var amount: JsonField? = null @@ -4050,7 +4386,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CreditBlock]. */ + class Builder internal constructor() { private var id: JsonField? = null private var expiryDate: JsonField? = null @@ -4186,7 +4523,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Customer]. */ + class Builder internal constructor() { private var id: JsonField? = null private var externalCustomerId: JsonField? = null @@ -4267,6 +4605,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -4278,17 +4624,38 @@ private constructor( @JvmStatic fun of(value: String) = EntryStatus(JsonField.of(value)) } + /** An enum containing [EntryStatus]'s known values. */ enum class Known { COMMITTED, PENDING, } + /** + * An enum containing [EntryStatus]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EntryStatus] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { COMMITTED, PENDING, + /** + * An enum member indicating that [EntryStatus] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { COMMITTED -> Value.COMMITTED @@ -4296,6 +4663,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { COMMITTED -> Known.COMMITTED @@ -4324,6 +4700,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -4333,21 +4717,51 @@ private constructor( @JvmStatic fun of(value: String) = EntryType(JsonField.of(value)) } + /** An enum containing [EntryType]'s known values. */ enum class Known { VOID, } + /** + * An enum containing [EntryType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EntryType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { VOID, + /** + * An enum member indicating that [EntryType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { VOID -> Value.VOID else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { VOID -> Known.VOID @@ -4403,7 +4817,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -4663,7 +5078,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [VoidInitiatedLedgerEntry]. */ + class Builder internal constructor() { private var id: JsonField? = null private var amount: JsonField? = null @@ -4901,7 +5317,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CreditBlock]. */ + class Builder internal constructor() { private var id: JsonField? = null private var expiryDate: JsonField? = null @@ -5037,7 +5454,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Customer]. */ + class Builder internal constructor() { private var id: JsonField? = null private var externalCustomerId: JsonField? = null @@ -5118,6 +5536,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -5129,17 +5555,38 @@ private constructor( @JvmStatic fun of(value: String) = EntryStatus(JsonField.of(value)) } + /** An enum containing [EntryStatus]'s known values. */ enum class Known { COMMITTED, PENDING, } + /** + * An enum containing [EntryStatus]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EntryStatus] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { COMMITTED, PENDING, + /** + * An enum member indicating that [EntryStatus] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { COMMITTED -> Value.COMMITTED @@ -5147,6 +5594,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { COMMITTED -> Known.COMMITTED @@ -5175,6 +5631,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -5184,21 +5648,51 @@ private constructor( @JvmStatic fun of(value: String) = EntryType(JsonField.of(value)) } + /** An enum containing [EntryType]'s known values. */ enum class Known { VOID_INITIATED, } + /** + * An enum containing [EntryType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EntryType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { VOID_INITIATED, + /** + * An enum member indicating that [EntryType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { VOID_INITIATED -> Value.VOID_INITIATED else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { VOID_INITIATED -> Known.VOID_INITIATED @@ -5254,7 +5748,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -5482,7 +5977,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AmendmentLedgerEntry]. */ + class Builder internal constructor() { private var id: JsonField? = null private var amount: JsonField? = null @@ -5694,7 +6190,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CreditBlock]. */ + class Builder internal constructor() { private var id: JsonField? = null private var expiryDate: JsonField? = null @@ -5830,7 +6327,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Customer]. */ + class Builder internal constructor() { private var id: JsonField? = null private var externalCustomerId: JsonField? = null @@ -5911,6 +6409,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -5922,17 +6428,38 @@ private constructor( @JvmStatic fun of(value: String) = EntryStatus(JsonField.of(value)) } + /** An enum containing [EntryStatus]'s known values. */ enum class Known { COMMITTED, PENDING, } + /** + * An enum containing [EntryStatus]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EntryStatus] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { COMMITTED, PENDING, + /** + * An enum member indicating that [EntryStatus] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { COMMITTED -> Value.COMMITTED @@ -5940,6 +6467,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { COMMITTED -> Known.COMMITTED @@ -5968,6 +6504,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -5977,21 +6521,51 @@ private constructor( @JvmStatic fun of(value: String) = EntryType(JsonField.of(value)) } + /** An enum containing [EntryType]'s known values. */ enum class Known { AMENDMENT, } + /** + * An enum containing [EntryType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EntryType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { AMENDMENT, + /** + * An enum member indicating that [EntryType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { AMENDMENT -> Value.AMENDMENT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { AMENDMENT -> Known.AMENDMENT @@ -6047,7 +6621,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() 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 53b1ab96..10c6f062 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 @@ -264,8 +264,7 @@ private constructor( } } - class AutoPager - constructor( + class AutoPager( private val firstPage: CustomerCreditLedgerListPage, ) : Iterable { 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 283ffd2d..b8c2b7c9 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 @@ -267,8 +267,7 @@ private constructor( } } - class AutoPager - constructor( + class AutoPager( private val firstPage: CustomerCreditLedgerListPageAsync, ) { 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 dbcbdbb2..3153bab1 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 @@ -6,6 +6,7 @@ import com.fasterxml.jackson.annotation.JsonCreator import com.withorb.api.core.Enum import com.withorb.api.core.JsonField import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -93,7 +94,7 @@ import java.util.Optional * added to the ledger to indicate the adjustment of credits. */ class CustomerCreditLedgerListParams -constructor( +private constructor( private val customerId: String, private val createdAtGt: OffsetDateTime?, private val createdAtGte: OffsetDateTime?, @@ -107,7 +108,7 @@ constructor( private val minimumAmount: String?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun customerId(): String = customerId @@ -141,10 +142,9 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic - internal fun getQueryParams(): QueryParams { + override fun _queryParams(): QueryParams { val queryParams = QueryParams.builder() this.createdAtGt?.let { queryParams.put( @@ -194,8 +194,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [CustomerCreditLedgerListParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var customerId: String? = null private var createdAtGt: OffsetDateTime? = null @@ -413,6 +414,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -424,17 +433,37 @@ constructor( @JvmStatic fun of(value: String) = EntryStatus(JsonField.of(value)) } + /** An enum containing [EntryStatus]'s known values. */ enum class Known { COMMITTED, PENDING, } + /** + * An enum containing [EntryStatus]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EntryStatus] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { COMMITTED, PENDING, + /** + * An enum member indicating that [EntryStatus] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { COMMITTED -> Value.COMMITTED @@ -442,6 +471,14 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { COMMITTED -> Known.COMMITTED @@ -470,6 +507,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -491,6 +536,7 @@ constructor( @JvmStatic fun of(value: String) = EntryType(JsonField.of(value)) } + /** An enum containing [EntryType]'s known values. */ enum class Known { INCREMENT, DECREMENT, @@ -501,6 +547,15 @@ constructor( AMENDMENT, } + /** + * An enum containing [EntryType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EntryType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { INCREMENT, DECREMENT, @@ -509,9 +564,19 @@ constructor( VOID, VOID_INITIATED, AMENDMENT, + /** + * An enum member indicating that [EntryType] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { INCREMENT -> Value.INCREMENT @@ -524,6 +589,14 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { INCREMENT -> Known.INCREMENT 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 880bb6f0..113f899c 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 @@ -237,6 +237,10 @@ private constructor( CustomerCreditLedgerListResponse(amendmentLedgerEntry = amendmentLedgerEntry) } + /** + * An interface that defines how to map each variant of [CustomerCreditLedgerListResponse] to a + * value of type [T]. + */ interface Visitor { fun visitIncrementLedgerEntry(incrementLedgerEntry: IncrementLedgerEntry): T @@ -257,12 +261,22 @@ private constructor( fun visitAmendmentLedgerEntry(amendmentLedgerEntry: AmendmentLedgerEntry): T + /** + * Maps an unknown variant of [CustomerCreditLedgerListResponse] to a value of type [T]. + * + * An instance of [CustomerCreditLedgerListResponse] can contain an unknown variant if it + * was deserialized from data that doesn't match any known variant. For example, if the SDK + * is on an older version than the API, then the API may respond with new variants that the + * SDK is unaware of. + * + * @throws OrbInvalidDataException in the default implementation. + */ fun unknown(json: JsonValue?): T { throw OrbInvalidDataException("Unknown CustomerCreditLedgerListResponse: $json") } } - class Deserializer : + internal class Deserializer : BaseDeserializer( CustomerCreditLedgerListResponse::class ) { @@ -347,7 +361,7 @@ private constructor( } } - class Serializer : + internal class Serializer : BaseSerializer(CustomerCreditLedgerListResponse::class) { override fun serialize( @@ -534,7 +548,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [IncrementLedgerEntry]. */ + class Builder internal constructor() { private var id: JsonField? = null private var amount: JsonField? = null @@ -746,7 +761,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CreditBlock]. */ + class Builder internal constructor() { private var id: JsonField? = null private var expiryDate: JsonField? = null @@ -882,7 +898,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Customer]. */ + class Builder internal constructor() { private var id: JsonField? = null private var externalCustomerId: JsonField? = null @@ -963,6 +980,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -974,17 +999,38 @@ private constructor( @JvmStatic fun of(value: String) = EntryStatus(JsonField.of(value)) } + /** An enum containing [EntryStatus]'s known values. */ enum class Known { COMMITTED, PENDING, } + /** + * An enum containing [EntryStatus]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EntryStatus] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { COMMITTED, PENDING, + /** + * An enum member indicating that [EntryStatus] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { COMMITTED -> Value.COMMITTED @@ -992,6 +1038,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { COMMITTED -> Known.COMMITTED @@ -1020,6 +1075,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -1029,21 +1092,51 @@ private constructor( @JvmStatic fun of(value: String) = EntryType(JsonField.of(value)) } + /** An enum containing [EntryType]'s known values. */ enum class Known { INCREMENT, } + /** + * An enum containing [EntryType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EntryType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { INCREMENT, + /** + * An enum member indicating that [EntryType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { INCREMENT -> Value.INCREMENT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { INCREMENT -> Known.INCREMENT @@ -1099,7 +1192,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -1351,7 +1445,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [DecrementLedgerEntry]. */ + class Builder internal constructor() { private var id: JsonField? = null private var amount: JsonField? = null @@ -1590,7 +1685,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CreditBlock]. */ + class Builder internal constructor() { private var id: JsonField? = null private var expiryDate: JsonField? = null @@ -1726,7 +1822,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Customer]. */ + class Builder internal constructor() { private var id: JsonField? = null private var externalCustomerId: JsonField? = null @@ -1807,6 +1904,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -1818,17 +1923,38 @@ private constructor( @JvmStatic fun of(value: String) = EntryStatus(JsonField.of(value)) } + /** An enum containing [EntryStatus]'s known values. */ enum class Known { COMMITTED, PENDING, } + /** + * An enum containing [EntryStatus]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EntryStatus] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { COMMITTED, PENDING, + /** + * An enum member indicating that [EntryStatus] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { COMMITTED -> Value.COMMITTED @@ -1836,6 +1962,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { COMMITTED -> Known.COMMITTED @@ -1864,6 +1999,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -1873,21 +2016,51 @@ private constructor( @JvmStatic fun of(value: String) = EntryType(JsonField.of(value)) } + /** An enum containing [EntryType]'s known values. */ enum class Known { DECREMENT, } + /** + * An enum containing [EntryType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EntryType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DECREMENT, + /** + * An enum member indicating that [EntryType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { DECREMENT -> Value.DECREMENT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DECREMENT -> Known.DECREMENT @@ -1943,7 +2116,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -2182,7 +2356,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [ExpirationChangeLedgerEntry]. */ + class Builder internal constructor() { private var id: JsonField? = null private var amount: JsonField? = null @@ -2408,7 +2583,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CreditBlock]. */ + class Builder internal constructor() { private var id: JsonField? = null private var expiryDate: JsonField? = null @@ -2544,7 +2720,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Customer]. */ + class Builder internal constructor() { private var id: JsonField? = null private var externalCustomerId: JsonField? = null @@ -2625,6 +2802,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -2636,17 +2821,38 @@ private constructor( @JvmStatic fun of(value: String) = EntryStatus(JsonField.of(value)) } + /** An enum containing [EntryStatus]'s known values. */ enum class Known { COMMITTED, PENDING, } + /** + * An enum containing [EntryStatus]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EntryStatus] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { COMMITTED, PENDING, + /** + * An enum member indicating that [EntryStatus] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { COMMITTED -> Value.COMMITTED @@ -2654,6 +2860,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { COMMITTED -> Known.COMMITTED @@ -2682,6 +2897,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -2691,21 +2914,51 @@ private constructor( @JvmStatic fun of(value: String) = EntryType(JsonField.of(value)) } + /** An enum containing [EntryType]'s known values. */ enum class Known { EXPIRATION_CHANGE, } + /** + * An enum containing [EntryType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EntryType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { EXPIRATION_CHANGE, + /** + * An enum member indicating that [EntryType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { EXPIRATION_CHANGE -> Value.EXPIRATION_CHANGE else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { EXPIRATION_CHANGE -> Known.EXPIRATION_CHANGE @@ -2761,7 +3014,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -2989,7 +3243,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CreditBlockExpiryLedgerEntry]. */ + class Builder internal constructor() { private var id: JsonField? = null private var amount: JsonField? = null @@ -3202,7 +3457,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CreditBlock]. */ + class Builder internal constructor() { private var id: JsonField? = null private var expiryDate: JsonField? = null @@ -3338,7 +3594,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Customer]. */ + class Builder internal constructor() { private var id: JsonField? = null private var externalCustomerId: JsonField? = null @@ -3419,6 +3676,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -3430,17 +3695,38 @@ private constructor( @JvmStatic fun of(value: String) = EntryStatus(JsonField.of(value)) } + /** An enum containing [EntryStatus]'s known values. */ enum class Known { COMMITTED, PENDING, } + /** + * An enum containing [EntryStatus]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EntryStatus] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { COMMITTED, PENDING, + /** + * An enum member indicating that [EntryStatus] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { COMMITTED -> Value.COMMITTED @@ -3448,6 +3734,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { COMMITTED -> Known.COMMITTED @@ -3476,6 +3771,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -3485,21 +3788,51 @@ private constructor( @JvmStatic fun of(value: String) = EntryType(JsonField.of(value)) } + /** An enum containing [EntryType]'s known values. */ enum class Known { CREDIT_BLOCK_EXPIRY, } + /** + * An enum containing [EntryType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EntryType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { CREDIT_BLOCK_EXPIRY, + /** + * An enum member indicating that [EntryType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { CREDIT_BLOCK_EXPIRY -> Value.CREDIT_BLOCK_EXPIRY else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { CREDIT_BLOCK_EXPIRY -> Known.CREDIT_BLOCK_EXPIRY @@ -3555,7 +3888,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -3804,7 +4138,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [VoidLedgerEntry]. */ + class Builder internal constructor() { private var id: JsonField? = null private var amount: JsonField? = null @@ -4032,7 +4367,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CreditBlock]. */ + class Builder internal constructor() { private var id: JsonField? = null private var expiryDate: JsonField? = null @@ -4168,7 +4504,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Customer]. */ + class Builder internal constructor() { private var id: JsonField? = null private var externalCustomerId: JsonField? = null @@ -4249,6 +4586,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -4260,17 +4605,38 @@ private constructor( @JvmStatic fun of(value: String) = EntryStatus(JsonField.of(value)) } + /** An enum containing [EntryStatus]'s known values. */ enum class Known { COMMITTED, PENDING, } + /** + * An enum containing [EntryStatus]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EntryStatus] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { COMMITTED, PENDING, + /** + * An enum member indicating that [EntryStatus] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { COMMITTED -> Value.COMMITTED @@ -4278,6 +4644,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { COMMITTED -> Known.COMMITTED @@ -4306,6 +4681,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -4315,21 +4698,51 @@ private constructor( @JvmStatic fun of(value: String) = EntryType(JsonField.of(value)) } + /** An enum containing [EntryType]'s known values. */ enum class Known { VOID, } + /** + * An enum containing [EntryType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EntryType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { VOID, + /** + * An enum member indicating that [EntryType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { VOID -> Value.VOID else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { VOID -> Known.VOID @@ -4385,7 +4798,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -4645,7 +5059,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [VoidInitiatedLedgerEntry]. */ + class Builder internal constructor() { private var id: JsonField? = null private var amount: JsonField? = null @@ -4883,7 +5298,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CreditBlock]. */ + class Builder internal constructor() { private var id: JsonField? = null private var expiryDate: JsonField? = null @@ -5019,7 +5435,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Customer]. */ + class Builder internal constructor() { private var id: JsonField? = null private var externalCustomerId: JsonField? = null @@ -5100,6 +5517,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -5111,17 +5536,38 @@ private constructor( @JvmStatic fun of(value: String) = EntryStatus(JsonField.of(value)) } + /** An enum containing [EntryStatus]'s known values. */ enum class Known { COMMITTED, PENDING, } + /** + * An enum containing [EntryStatus]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EntryStatus] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { COMMITTED, PENDING, + /** + * An enum member indicating that [EntryStatus] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { COMMITTED -> Value.COMMITTED @@ -5129,6 +5575,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { COMMITTED -> Known.COMMITTED @@ -5157,6 +5612,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -5166,21 +5629,51 @@ private constructor( @JvmStatic fun of(value: String) = EntryType(JsonField.of(value)) } + /** An enum containing [EntryType]'s known values. */ enum class Known { VOID_INITIATED, } + /** + * An enum containing [EntryType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EntryType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { VOID_INITIATED, + /** + * An enum member indicating that [EntryType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { VOID_INITIATED -> Value.VOID_INITIATED else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { VOID_INITIATED -> Known.VOID_INITIATED @@ -5236,7 +5729,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -5464,7 +5958,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AmendmentLedgerEntry]. */ + class Builder internal constructor() { private var id: JsonField? = null private var amount: JsonField? = null @@ -5676,7 +6171,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CreditBlock]. */ + class Builder internal constructor() { private var id: JsonField? = null private var expiryDate: JsonField? = null @@ -5812,7 +6308,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Customer]. */ + class Builder internal constructor() { private var id: JsonField? = null private var externalCustomerId: JsonField? = null @@ -5893,6 +6390,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -5904,17 +6409,38 @@ private constructor( @JvmStatic fun of(value: String) = EntryStatus(JsonField.of(value)) } + /** An enum containing [EntryStatus]'s known values. */ enum class Known { COMMITTED, PENDING, } + /** + * An enum containing [EntryStatus]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EntryStatus] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { COMMITTED, PENDING, + /** + * An enum member indicating that [EntryStatus] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { COMMITTED -> Value.COMMITTED @@ -5922,6 +6448,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { COMMITTED -> Known.COMMITTED @@ -5950,6 +6485,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -5959,21 +6502,51 @@ private constructor( @JvmStatic fun of(value: String) = EntryType(JsonField.of(value)) } + /** An enum containing [EntryType]'s known values. */ enum class Known { AMENDMENT, } + /** + * An enum containing [EntryType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [EntryType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { AMENDMENT, + /** + * An enum member indicating that [EntryType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { AMENDMENT -> Value.AMENDMENT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { AMENDMENT -> Known.AMENDMENT @@ -6029,7 +6602,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() 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 6240e6ec..6cb721a7 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 @@ -199,8 +199,7 @@ private constructor( } } - class AutoPager - constructor( + class AutoPager( private val firstPage: CustomerCreditListByExternalIdPage, ) : Iterable { 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 ad85c415..652fcd3d 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 @@ -202,8 +202,7 @@ private constructor( } } - class AutoPager - constructor( + class AutoPager( private val firstPage: CustomerCreditListByExternalIdPageAsync, ) { diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditListByExternalIdParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditListByExternalIdParams.kt index fdc424e5..6242c763 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditListByExternalIdParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditListByExternalIdParams.kt @@ -3,6 +3,7 @@ package com.withorb.api.models import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -19,7 +20,7 @@ import java.util.Optional * `currency` to an ISO 4217 string. */ class CustomerCreditListByExternalIdParams -constructor( +private constructor( private val externalCustomerId: String, private val currency: String?, private val cursor: String?, @@ -27,7 +28,7 @@ constructor( private val limit: Long?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun externalCustomerId(): String = externalCustomerId @@ -52,10 +53,9 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic - internal fun getQueryParams(): QueryParams { + override fun _queryParams(): QueryParams { val queryParams = QueryParams.builder() this.currency?.let { queryParams.put("currency", listOf(it.toString())) } this.cursor?.let { queryParams.put("cursor", listOf(it.toString())) } @@ -79,8 +79,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [CustomerCreditListByExternalIdParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var externalCustomerId: String? = null private var currency: String? = null diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditListByExternalIdResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditListByExternalIdResponse.kt index 7ebd3704..8afc939e 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditListByExternalIdResponse.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditListByExternalIdResponse.kt @@ -114,7 +114,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CustomerCreditListByExternalIdResponse]. */ + class Builder internal constructor() { private var id: JsonField? = null private var balance: JsonField? = null @@ -232,6 +233,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -243,17 +252,35 @@ private constructor( @JvmStatic fun of(value: String) = Status(JsonField.of(value)) } + /** An enum containing [Status]'s known values. */ enum class Known { ACTIVE, PENDING_PAYMENT, } + /** + * An enum containing [Status]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Status] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ACTIVE, PENDING_PAYMENT, + /** An enum member indicating that [Status] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { ACTIVE -> Value.ACTIVE @@ -261,6 +288,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { ACTIVE -> Known.ACTIVE 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 a26d5c83..3b8d836f 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 @@ -194,8 +194,7 @@ private constructor( } } - class AutoPager - constructor( + class AutoPager( private val firstPage: CustomerCreditListPage, ) : Iterable { 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 4aadb3b7..2b3725b0 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 @@ -197,8 +197,7 @@ private constructor( } } - class AutoPager - constructor( + class AutoPager( private val firstPage: CustomerCreditListPageAsync, ) { diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditListParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditListParams.kt index 92161e0e..af7102c4 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditListParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditListParams.kt @@ -3,6 +3,7 @@ package com.withorb.api.models import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -19,7 +20,7 @@ import java.util.Optional * `currency` to an ISO 4217 string. */ class CustomerCreditListParams -constructor( +private constructor( private val customerId: String, private val currency: String?, private val cursor: String?, @@ -27,7 +28,7 @@ constructor( private val limit: Long?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun customerId(): String = customerId @@ -52,10 +53,9 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic - internal fun getQueryParams(): QueryParams { + override fun _queryParams(): QueryParams { val queryParams = QueryParams.builder() this.currency?.let { queryParams.put("currency", listOf(it.toString())) } this.cursor?.let { queryParams.put("cursor", listOf(it.toString())) } @@ -79,8 +79,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [CustomerCreditListParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var customerId: String? = null private var currency: String? = null diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditListResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditListResponse.kt index 0e09c772..dc09b400 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditListResponse.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditListResponse.kt @@ -114,7 +114,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CustomerCreditListResponse]. */ + class Builder internal constructor() { private var id: JsonField? = null private var balance: JsonField? = null @@ -229,6 +230,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -240,17 +249,35 @@ private constructor( @JvmStatic fun of(value: String) = Status(JsonField.of(value)) } + /** An enum containing [Status]'s known values. */ enum class Known { ACTIVE, PENDING_PAYMENT, } + /** + * An enum containing [Status]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Status] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ACTIVE, PENDING_PAYMENT, + /** An enum member indicating that [Status] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { ACTIVE -> Value.ACTIVE @@ -258,6 +285,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { ACTIVE -> Known.ACTIVE 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 2f120d1b..22f806fb 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 @@ -12,6 +12,7 @@ import com.withorb.api.core.JsonField import com.withorb.api.core.JsonMissing import com.withorb.api.core.JsonValue import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -30,12 +31,12 @@ import java.util.Optional * replaced. */ class CustomerCreditTopUpCreateByExternalIdParams -constructor( +private constructor( private val externalCustomerId: String, private val body: CustomerCreditTopUpCreateByExternalIdBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun externalCustomerId(): String = externalCustomerId @@ -105,11 +106,11 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getBody(): CustomerCreditTopUpCreateByExternalIdBody = body + @JvmSynthetic internal fun _body(): CustomerCreditTopUpCreateByExternalIdBody = body - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun getPathParam(index: Int): String { return when (index) { @@ -245,7 +246,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CustomerCreditTopUpCreateByExternalIdBody]. */ + class Builder internal constructor() { private var amount: JsonField? = null private var currency: JsonField? = null @@ -417,8 +419,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [CustomerCreditTopUpCreateByExternalIdParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var externalCustomerId: String? = null private var body: CustomerCreditTopUpCreateByExternalIdBody.Builder = @@ -751,7 +754,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoiceSettings]. */ + class Builder internal constructor() { private var autoCollection: JsonField? = null private var netTerms: JsonField? = null @@ -873,6 +877,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -884,17 +896,38 @@ constructor( @JvmStatic fun of(value: String) = ExpiresAfterUnit(JsonField.of(value)) } + /** An enum containing [ExpiresAfterUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [ExpiresAfterUnit]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ExpiresAfterUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [ExpiresAfterUnit] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -902,6 +935,14 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY 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 afba784d..0f26331f 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 @@ -151,7 +151,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CustomerCreditTopUpCreateByExternalIdResponse]. */ + class Builder internal constructor() { private var id: JsonField? = null private var amount: JsonField? = null @@ -397,7 +398,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoiceSettings]. */ + class Builder internal constructor() { private var autoCollection: JsonField? = null private var netTerms: JsonField? = null @@ -519,6 +521,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -530,17 +540,38 @@ private constructor( @JvmStatic fun of(value: String) = ExpiresAfterUnit(JsonField.of(value)) } + /** An enum containing [ExpiresAfterUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [ExpiresAfterUnit]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ExpiresAfterUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [ExpiresAfterUnit] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -548,6 +579,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY 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 92f8bef0..57894aa6 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 @@ -12,6 +12,7 @@ import com.withorb.api.core.JsonField import com.withorb.api.core.JsonMissing import com.withorb.api.core.JsonValue import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -30,12 +31,12 @@ import java.util.Optional * replaced. */ class CustomerCreditTopUpCreateParams -constructor( +private constructor( private val customerId: String, private val body: CustomerCreditTopUpCreateBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun customerId(): String = customerId @@ -105,11 +106,11 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getBody(): CustomerCreditTopUpCreateBody = body + @JvmSynthetic internal fun _body(): CustomerCreditTopUpCreateBody = body - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun getPathParam(index: Int): String { return when (index) { @@ -245,7 +246,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CustomerCreditTopUpCreateBody]. */ + class Builder internal constructor() { private var amount: JsonField? = null private var currency: JsonField? = null @@ -416,8 +418,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [CustomerCreditTopUpCreateParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var customerId: String? = null private var body: CustomerCreditTopUpCreateBody.Builder = @@ -746,7 +749,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoiceSettings]. */ + class Builder internal constructor() { private var autoCollection: JsonField? = null private var netTerms: JsonField? = null @@ -868,6 +872,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -879,17 +891,38 @@ constructor( @JvmStatic fun of(value: String) = ExpiresAfterUnit(JsonField.of(value)) } + /** An enum containing [ExpiresAfterUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [ExpiresAfterUnit]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ExpiresAfterUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [ExpiresAfterUnit] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -897,6 +930,14 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY 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 2c070a0d..d6e33542 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 @@ -151,7 +151,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CustomerCreditTopUpCreateResponse]. */ + class Builder internal constructor() { private var id: JsonField? = null private var amount: JsonField? = null @@ -395,7 +396,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoiceSettings]. */ + class Builder internal constructor() { private var autoCollection: JsonField? = null private var netTerms: JsonField? = null @@ -517,6 +519,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -528,17 +538,38 @@ private constructor( @JvmStatic fun of(value: String) = ExpiresAfterUnit(JsonField.of(value)) } + /** An enum containing [ExpiresAfterUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [ExpiresAfterUnit]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ExpiresAfterUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [ExpiresAfterUnit] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -546,6 +577,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditTopUpDeleteByExternalIdParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditTopUpDeleteByExternalIdParams.kt index 62b8987d..3b4fbf7d 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditTopUpDeleteByExternalIdParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditTopUpDeleteByExternalIdParams.kt @@ -4,6 +4,7 @@ package com.withorb.api.models import com.withorb.api.core.JsonValue import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -13,13 +14,13 @@ import java.util.Optional /** Delete top-up by external ID */ class CustomerCreditTopUpDeleteByExternalIdParams -constructor( +private constructor( private val externalCustomerId: String, private val topUpId: String, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, private val additionalBodyProperties: Map, -) { +) : Params { fun externalCustomerId(): String = externalCustomerId @@ -32,12 +33,12 @@ constructor( fun _additionalBodyProperties(): Map = additionalBodyProperties @JvmSynthetic - internal fun getBody(): Optional> = + internal fun _body(): Optional> = Optional.ofNullable(additionalBodyProperties.ifEmpty { null }) - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun getPathParam(index: Int): String { return when (index) { @@ -54,8 +55,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [CustomerCreditTopUpDeleteByExternalIdParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var externalCustomerId: String? = null private var topUpId: String? = null diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditTopUpDeleteParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditTopUpDeleteParams.kt index f168263c..12a73212 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditTopUpDeleteParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditTopUpDeleteParams.kt @@ -4,6 +4,7 @@ package com.withorb.api.models import com.withorb.api.core.JsonValue import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -13,13 +14,13 @@ import java.util.Optional /** Delete top-up */ class CustomerCreditTopUpDeleteParams -constructor( +private constructor( private val customerId: String, private val topUpId: String, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, private val additionalBodyProperties: Map, -) { +) : Params { fun customerId(): String = customerId @@ -32,12 +33,12 @@ constructor( fun _additionalBodyProperties(): Map = additionalBodyProperties @JvmSynthetic - internal fun getBody(): Optional> = + internal fun _body(): Optional> = Optional.ofNullable(additionalBodyProperties.ifEmpty { null }) - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun getPathParam(index: Int): String { return when (index) { @@ -54,8 +55,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [CustomerCreditTopUpDeleteParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var customerId: String? = null private var topUpId: String? = null 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 ece8a14a..865ea775 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 @@ -192,8 +192,7 @@ private constructor( } } - class AutoPager - constructor( + class AutoPager( private val firstPage: CustomerCreditTopUpListByExternalIdPage, ) : Iterable { 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 bf391a8f..954301ca 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 @@ -195,8 +195,7 @@ private constructor( } } - class AutoPager - constructor( + class AutoPager( private val firstPage: CustomerCreditTopUpListByExternalIdPageAsync, ) { diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditTopUpListByExternalIdParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditTopUpListByExternalIdParams.kt index 13ed7140..d5bc71d3 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditTopUpListByExternalIdParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditTopUpListByExternalIdParams.kt @@ -3,6 +3,7 @@ package com.withorb.api.models import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -11,13 +12,13 @@ import java.util.Optional /** List top-ups by external ID */ class CustomerCreditTopUpListByExternalIdParams -constructor( +private constructor( private val externalCustomerId: String, private val cursor: String?, private val limit: Long?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun externalCustomerId(): String = externalCustomerId @@ -34,10 +35,9 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic - internal fun getQueryParams(): QueryParams { + override fun _queryParams(): QueryParams { val queryParams = QueryParams.builder() this.cursor?.let { queryParams.put("cursor", listOf(it.toString())) } this.limit?.let { queryParams.put("limit", listOf(it.toString())) } @@ -59,8 +59,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [CustomerCreditTopUpListByExternalIdParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var externalCustomerId: String? = null private var cursor: String? = null 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 4192efd5..eccfbc27 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 @@ -151,7 +151,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CustomerCreditTopUpListByExternalIdResponse]. */ + class Builder internal constructor() { private var id: JsonField? = null private var amount: JsonField? = null @@ -396,7 +397,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoiceSettings]. */ + class Builder internal constructor() { private var autoCollection: JsonField? = null private var netTerms: JsonField? = null @@ -518,6 +520,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -529,17 +539,38 @@ private constructor( @JvmStatic fun of(value: String) = ExpiresAfterUnit(JsonField.of(value)) } + /** An enum containing [ExpiresAfterUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [ExpiresAfterUnit]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ExpiresAfterUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [ExpiresAfterUnit] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -547,6 +578,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY 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 987a0859..107ad071 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 @@ -188,8 +188,7 @@ private constructor( } } - class AutoPager - constructor( + class AutoPager( private val firstPage: CustomerCreditTopUpListPage, ) : Iterable { 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 c86e8eda..9440c8f5 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 @@ -191,8 +191,7 @@ private constructor( } } - class AutoPager - constructor( + class AutoPager( private val firstPage: CustomerCreditTopUpListPageAsync, ) { diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditTopUpListParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditTopUpListParams.kt index 8d6d00f7..2ae7453a 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditTopUpListParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerCreditTopUpListParams.kt @@ -3,6 +3,7 @@ package com.withorb.api.models import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -11,13 +12,13 @@ import java.util.Optional /** List top-ups */ class CustomerCreditTopUpListParams -constructor( +private constructor( private val customerId: String, private val cursor: String?, private val limit: Long?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun customerId(): String = customerId @@ -34,10 +35,9 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic - internal fun getQueryParams(): QueryParams { + override fun _queryParams(): QueryParams { val queryParams = QueryParams.builder() this.cursor?.let { queryParams.put("cursor", listOf(it.toString())) } this.limit?.let { queryParams.put("limit", listOf(it.toString())) } @@ -59,8 +59,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [CustomerCreditTopUpListParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var customerId: String? = null private var cursor: String? = null 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 39051da3..731749d7 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 @@ -151,7 +151,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CustomerCreditTopUpListResponse]. */ + class Builder internal constructor() { private var id: JsonField? = null private var amount: JsonField? = null @@ -395,7 +396,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoiceSettings]. */ + class Builder internal constructor() { private var autoCollection: JsonField? = null private var netTerms: JsonField? = null @@ -517,6 +519,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -528,17 +538,38 @@ private constructor( @JvmStatic fun of(value: String) = ExpiresAfterUnit(JsonField.of(value)) } + /** An enum containing [ExpiresAfterUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [ExpiresAfterUnit]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ExpiresAfterUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [ExpiresAfterUnit] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -546,6 +577,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerDeleteParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerDeleteParams.kt index e031db39..f869a8ee 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerDeleteParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerDeleteParams.kt @@ -4,6 +4,7 @@ package com.withorb.api.models import com.withorb.api.core.JsonValue import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -27,12 +28,12 @@ import java.util.Optional * On successful processing, this returns an empty dictionary (`{}`) in the API. */ class CustomerDeleteParams -constructor( +private constructor( private val customerId: String, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, private val additionalBodyProperties: Map, -) { +) : Params { fun customerId(): String = customerId @@ -43,12 +44,12 @@ constructor( fun _additionalBodyProperties(): Map = additionalBodyProperties @JvmSynthetic - internal fun getBody(): Optional> = + internal fun _body(): Optional> = Optional.ofNullable(additionalBodyProperties.ifEmpty { null }) - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun getPathParam(index: Int): String { return when (index) { @@ -64,8 +65,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [CustomerDeleteParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var customerId: String? = null private var additionalHeaders: Headers.Builder = Headers.builder() 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 69c75504..29c13c3a 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 @@ -3,6 +3,7 @@ package com.withorb.api.models import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -16,11 +17,11 @@ import java.util.Objects * [Get Customer](fetch-customer). */ class CustomerFetchByExternalIdParams -constructor( +private constructor( private val externalCustomerId: String, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun externalCustomerId(): String = externalCustomerId @@ -28,9 +29,9 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun getPathParam(index: Int): String { return when (index) { @@ -46,8 +47,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [CustomerFetchByExternalIdParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var externalCustomerId: String? = null private var additionalHeaders: Headers.Builder = Headers.builder() 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 bef21530..5b14f708 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 @@ -3,6 +3,7 @@ package com.withorb.api.models import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -15,11 +16,11 @@ import java.util.Objects * See the [Customer resource](/core-concepts#customer) for a full discussion of the Customer model. */ class CustomerFetchParams -constructor( +private constructor( private val customerId: String, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun customerId(): String = customerId @@ -27,9 +28,9 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun getPathParam(index: Int): String { return when (index) { @@ -45,8 +46,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [CustomerFetchParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var customerId: String? = null private var additionalHeaders: Headers.Builder = Headers.builder() 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 c13b4775..d06ebd82 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 @@ -186,8 +186,7 @@ private constructor( } } - class AutoPager - constructor( + class AutoPager( private val firstPage: CustomerListPage, ) : Iterable { 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 5bebcc1f..8bd5fdd0 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 @@ -193,8 +193,7 @@ private constructor( } } - class AutoPager - constructor( + class AutoPager( private val firstPage: CustomerListPageAsync, ) { 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 dbfebc28..f5da69ab 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 @@ -3,6 +3,7 @@ package com.withorb.api.models import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams import java.time.OffsetDateTime @@ -18,7 +19,7 @@ import java.util.Optional * See [Customer](/core-concepts##customer) for an overview of the customer model. */ class CustomerListParams -constructor( +private constructor( private val createdAtGt: OffsetDateTime?, private val createdAtGte: OffsetDateTime?, private val createdAtLt: OffsetDateTime?, @@ -27,7 +28,7 @@ constructor( private val limit: Long?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun createdAtGt(): Optional = Optional.ofNullable(createdAtGt) @@ -50,10 +51,9 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic - internal fun getQueryParams(): QueryParams { + override fun _queryParams(): QueryParams { val queryParams = QueryParams.builder() this.createdAtGt?.let { queryParams.put( @@ -92,8 +92,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [CustomerListParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var createdAtGt: OffsetDateTime? = null private var createdAtGte: OffsetDateTime? = null diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerSyncPaymentMethodsFromGatewayByExternalCustomerIdParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerSyncPaymentMethodsFromGatewayByExternalCustomerIdParams.kt index 20566ed1..6669ce43 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerSyncPaymentMethodsFromGatewayByExternalCustomerIdParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerSyncPaymentMethodsFromGatewayByExternalCustomerIdParams.kt @@ -4,6 +4,7 @@ package com.withorb.api.models import com.withorb.api.core.JsonValue import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -20,12 +21,12 @@ import java.util.Optional * **Note**: This functionality is currently only available for Stripe. */ class CustomerSyncPaymentMethodsFromGatewayByExternalCustomerIdParams -constructor( +private constructor( private val customerId: String, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, private val additionalBodyProperties: Map, -) { +) : Params { fun customerId(): String = customerId @@ -36,12 +37,12 @@ constructor( fun _additionalBodyProperties(): Map = additionalBodyProperties @JvmSynthetic - internal fun getBody(): Optional> = + internal fun _body(): Optional> = Optional.ofNullable(additionalBodyProperties.ifEmpty { null }) - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun getPathParam(index: Int): String { return when (index) { @@ -57,8 +58,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [CustomerSyncPaymentMethodsFromGatewayByExternalCustomerIdParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var customerId: String? = null private var additionalHeaders: Headers.Builder = Headers.builder() diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerSyncPaymentMethodsFromGatewayParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerSyncPaymentMethodsFromGatewayParams.kt index 11fad893..b3941ca2 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerSyncPaymentMethodsFromGatewayParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/CustomerSyncPaymentMethodsFromGatewayParams.kt @@ -4,6 +4,7 @@ package com.withorb.api.models import com.withorb.api.core.JsonValue import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -20,12 +21,12 @@ import java.util.Optional * **Note**: This functionality is currently only available for Stripe. */ class CustomerSyncPaymentMethodsFromGatewayParams -constructor( +private constructor( private val externalCustomerId: String, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, private val additionalBodyProperties: Map, -) { +) : Params { fun externalCustomerId(): String = externalCustomerId @@ -36,12 +37,12 @@ constructor( fun _additionalBodyProperties(): Map = additionalBodyProperties @JvmSynthetic - internal fun getBody(): Optional> = + internal fun _body(): Optional> = Optional.ofNullable(additionalBodyProperties.ifEmpty { null }) - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun getPathParam(index: Int): String { return when (index) { @@ -57,8 +58,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [CustomerSyncPaymentMethodsFromGatewayParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var externalCustomerId: String? = null private var additionalHeaders: Headers.Builder = Headers.builder() 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 8ee4de61..3b8a762b 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 @@ -21,6 +21,7 @@ import com.withorb.api.core.JsonField import com.withorb.api.core.JsonMissing import com.withorb.api.core.JsonValue import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.getOrThrow import com.withorb.api.core.http.Headers @@ -38,12 +39,12 @@ import kotlin.jvm.optionals.getOrNull * semantics of this endpoint exactly mirror [Update Customer](update-customer). */ class CustomerUpdateByExternalIdParams -constructor( +private constructor( private val id: String, private val body: CustomerUpdateByExternalIdBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun id(): String = id @@ -402,11 +403,11 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getBody(): CustomerUpdateByExternalIdBody = body + @JvmSynthetic internal fun _body(): CustomerUpdateByExternalIdBody = body - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun getPathParam(index: Int): String { return when (index) { @@ -891,7 +892,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CustomerUpdateByExternalIdBody]. */ + class Builder internal constructor() { private var accountingSyncConfiguration: JsonField = JsonMissing.of() @@ -1213,9 +1215,34 @@ constructor( fun taxConfiguration(newAvalara: TaxConfiguration.NewAvalaraTaxConfiguration) = taxConfiguration(TaxConfiguration.ofNewAvalara(newAvalara)) + fun newAvalaraTaxConfiguration(taxExempt: Boolean) = + taxConfiguration( + TaxConfiguration.NewAvalaraTaxConfiguration.builder() + .taxProvider( + CustomerUpdateByExternalIdParams.TaxConfiguration + .NewAvalaraTaxConfiguration + .TaxProvider + .AVALARA + ) + .taxExempt(taxExempt) + .build() + ) + fun taxConfiguration(newTaxJar: TaxConfiguration.NewTaxJarConfiguration) = taxConfiguration(TaxConfiguration.ofNewTaxJar(newTaxJar)) + fun newTaxJarTaxConfiguration(taxExempt: Boolean) = + taxConfiguration( + TaxConfiguration.NewTaxJarConfiguration.builder() + .taxProvider( + CustomerUpdateByExternalIdParams.TaxConfiguration.NewTaxJarConfiguration + .TaxProvider + .TAXJAR + ) + .taxExempt(taxExempt) + .build() + ) + /** * Tax IDs are commonly required to be displayed on customer invoices, which are added * to the headers of invoices. @@ -1606,8 +1633,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [CustomerUpdateByExternalIdParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var id: String? = null private var body: CustomerUpdateByExternalIdBody.Builder = @@ -1899,10 +1927,18 @@ constructor( body.taxConfiguration(newAvalara) } + fun newAvalaraTaxConfiguration(taxExempt: Boolean) = apply { + body.newAvalaraTaxConfiguration(taxExempt) + } + fun taxConfiguration(newTaxJar: TaxConfiguration.NewTaxJarConfiguration) = apply { body.taxConfiguration(newTaxJar) } + fun newTaxJarTaxConfiguration(taxExempt: Boolean) = apply { + body.newTaxJarTaxConfiguration(taxExempt) + } + /** * Tax IDs are commonly required to be displayed on customer invoices, which are added to * the headers of invoices. @@ -2401,7 +2437,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AccountingSyncConfiguration]. */ + class Builder internal constructor() { private var accountingProviders: JsonField>? = null private var excluded: JsonField = JsonMissing.of() @@ -2526,7 +2563,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AccountingProvider]. */ + class Builder internal constructor() { private var externalProviderId: JsonField? = null private var providerType: JsonField? = null @@ -2698,7 +2736,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingAddress]. */ + class Builder internal constructor() { private var city: JsonField = JsonMissing.of() private var country: JsonField = JsonMissing.of() @@ -2838,7 +2877,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -2899,6 +2939,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -2916,6 +2964,7 @@ constructor( @JvmStatic fun of(value: String) = PaymentProvider(JsonField.of(value)) } + /** An enum containing [PaymentProvider]'s known values. */ enum class Known { QUICKBOOKS, BILL_COM, @@ -2924,15 +2973,35 @@ constructor( NETSUITE, } + /** + * An enum containing [PaymentProvider]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [PaymentProvider] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { QUICKBOOKS, BILL_COM, STRIPE_CHARGE, STRIPE_INVOICE, NETSUITE, + /** + * An enum member indicating that [PaymentProvider] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { QUICKBOOKS -> Value.QUICKBOOKS @@ -2943,6 +3012,14 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { QUICKBOOKS -> Known.QUICKBOOKS @@ -3005,7 +3082,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [ReportingConfiguration]. */ + class Builder internal constructor() { private var exempt: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -3144,7 +3222,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [ShippingAddress]. */ + class Builder internal constructor() { private var city: JsonField = JsonMissing.of() private var country: JsonField = JsonMissing.of() @@ -3331,18 +3410,32 @@ constructor( TaxConfiguration(newTaxJar = newTaxJar) } + /** + * An interface that defines how to map each variant of [TaxConfiguration] to a value of + * type [T]. + */ interface Visitor { fun visitNewAvalara(newAvalara: NewAvalaraTaxConfiguration): T fun visitNewTaxJar(newTaxJar: NewTaxJarConfiguration): T + /** + * Maps an unknown variant of [TaxConfiguration] to a value of type [T]. + * + * An instance of [TaxConfiguration] can contain an unknown variant if it was + * deserialized from data that doesn't match any known variant. For example, if the SDK + * is on an older version than the API, then the API may respond with new variants that + * the SDK is unaware of. + * + * @throws OrbInvalidDataException in the default implementation. + */ fun unknown(json: JsonValue?): T { throw OrbInvalidDataException("Unknown TaxConfiguration: $json") } } - class Deserializer : BaseDeserializer(TaxConfiguration::class) { + internal class Deserializer : BaseDeserializer(TaxConfiguration::class) { override fun ObjectCodec.deserialize(node: JsonNode): TaxConfiguration { val json = JsonValue.fromJsonNode(node) @@ -3372,7 +3465,7 @@ constructor( } } - class Serializer : BaseSerializer(TaxConfiguration::class) { + internal class Serializer : BaseSerializer(TaxConfiguration::class) { override fun serialize( value: TaxConfiguration, @@ -3448,7 +3541,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewAvalaraTaxConfiguration]. */ + class Builder internal constructor() { private var taxExempt: JsonField? = null private var taxProvider: JsonField? = null @@ -3521,6 +3615,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -3530,21 +3632,51 @@ constructor( @JvmStatic fun of(value: String) = TaxProvider(JsonField.of(value)) } + /** An enum containing [TaxProvider]'s known values. */ enum class Known { AVALARA, } + /** + * An enum containing [TaxProvider]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [TaxProvider] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { AVALARA, + /** + * An enum member indicating that [TaxProvider] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { AVALARA -> Value.AVALARA else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { AVALARA -> Known.AVALARA @@ -3633,7 +3765,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewTaxJarConfiguration]. */ + class Builder internal constructor() { private var taxExempt: JsonField? = null private var taxProvider: JsonField? = null @@ -3693,6 +3826,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -3702,21 +3843,51 @@ constructor( @JvmStatic fun of(value: String) = TaxProvider(JsonField.of(value)) } + /** An enum containing [TaxProvider]'s known values. */ enum class Known { TAXJAR, } + /** + * An enum containing [TaxProvider]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [TaxProvider] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { TAXJAR, + /** + * An enum member indicating that [TaxProvider] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { TAXJAR -> Value.TAXJAR else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { TAXJAR -> Known.TAXJAR @@ -3914,7 +4085,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TaxId]. */ + class Builder internal constructor() { private var country: JsonField? = null private var type: JsonField? = null @@ -3975,6 +4147,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -4138,6 +4318,7 @@ constructor( @JvmStatic fun of(value: String) = Country(JsonField.of(value)) } + /** An enum containing [Country]'s known values. */ enum class Known { AD, AE, @@ -4219,6 +4400,15 @@ constructor( ZA, } + /** + * An enum containing [Country]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Country] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { AD, AE, @@ -4298,9 +4488,19 @@ constructor( VE, VN, ZA, + /** + * An enum member indicating that [Country] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { AD -> Value.AD @@ -4384,6 +4584,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { AD -> Known.AD @@ -4488,6 +4697,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -4637,6 +4854,7 @@ constructor( @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } + /** An enum containing [Type]'s known values. */ enum class Known { AD_NRT, AE_TRN, @@ -4711,6 +4929,15 @@ constructor( ZA_VAT, } + /** + * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Type] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { AD_NRT, AE_TRN, @@ -4783,9 +5010,17 @@ constructor( VE_RIF, VN_TIN, ZA_VAT, + /** An enum member indicating that [Type] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { AD_NRT -> Value.AD_NRT @@ -4862,6 +5097,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { AD_NRT -> Known.AD_NRT 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 015b20b1..20682b53 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 @@ -21,6 +21,7 @@ import com.withorb.api.core.JsonField import com.withorb.api.core.JsonMissing import com.withorb.api.core.JsonValue import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.getOrThrow import com.withorb.api.core.http.Headers @@ -39,12 +40,12 @@ import kotlin.jvm.optionals.getOrNull * are currently immutable. */ class CustomerUpdateParams -constructor( +private constructor( private val customerId: String, private val body: CustomerUpdateBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun customerId(): String = customerId @@ -403,11 +404,11 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getBody(): CustomerUpdateBody = body + @JvmSynthetic internal fun _body(): CustomerUpdateBody = body - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun getPathParam(index: Int): String { return when (index) { @@ -892,7 +893,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CustomerUpdateBody]. */ + class Builder internal constructor() { private var accountingSyncConfiguration: JsonField = JsonMissing.of() @@ -1210,9 +1212,32 @@ constructor( fun taxConfiguration(newAvalara: TaxConfiguration.NewAvalaraTaxConfiguration) = taxConfiguration(TaxConfiguration.ofNewAvalara(newAvalara)) + fun newAvalaraTaxConfiguration(taxExempt: Boolean) = + taxConfiguration( + TaxConfiguration.NewAvalaraTaxConfiguration.builder() + .taxProvider( + CustomerUpdateParams.TaxConfiguration.NewAvalaraTaxConfiguration + .TaxProvider + .AVALARA + ) + .taxExempt(taxExempt) + .build() + ) + fun taxConfiguration(newTaxJar: TaxConfiguration.NewTaxJarConfiguration) = taxConfiguration(TaxConfiguration.ofNewTaxJar(newTaxJar)) + fun newTaxJarTaxConfiguration(taxExempt: Boolean) = + taxConfiguration( + TaxConfiguration.NewTaxJarConfiguration.builder() + .taxProvider( + CustomerUpdateParams.TaxConfiguration.NewTaxJarConfiguration.TaxProvider + .TAXJAR + ) + .taxExempt(taxExempt) + .build() + ) + /** * Tax IDs are commonly required to be displayed on customer invoices, which are added * to the headers of invoices. @@ -1603,8 +1628,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [CustomerUpdateParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var customerId: String? = null private var body: CustomerUpdateBody.Builder = CustomerUpdateBody.builder() @@ -1893,10 +1919,18 @@ constructor( body.taxConfiguration(newAvalara) } + fun newAvalaraTaxConfiguration(taxExempt: Boolean) = apply { + body.newAvalaraTaxConfiguration(taxExempt) + } + fun taxConfiguration(newTaxJar: TaxConfiguration.NewTaxJarConfiguration) = apply { body.taxConfiguration(newTaxJar) } + fun newTaxJarTaxConfiguration(taxExempt: Boolean) = apply { + body.newTaxJarTaxConfiguration(taxExempt) + } + /** * Tax IDs are commonly required to be displayed on customer invoices, which are added to * the headers of invoices. @@ -2395,7 +2429,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AccountingSyncConfiguration]. */ + class Builder internal constructor() { private var accountingProviders: JsonField>? = null private var excluded: JsonField = JsonMissing.of() @@ -2520,7 +2555,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AccountingProvider]. */ + class Builder internal constructor() { private var externalProviderId: JsonField? = null private var providerType: JsonField? = null @@ -2692,7 +2728,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingAddress]. */ + class Builder internal constructor() { private var city: JsonField = JsonMissing.of() private var country: JsonField = JsonMissing.of() @@ -2832,7 +2869,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -2893,6 +2931,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -2910,6 +2956,7 @@ constructor( @JvmStatic fun of(value: String) = PaymentProvider(JsonField.of(value)) } + /** An enum containing [PaymentProvider]'s known values. */ enum class Known { QUICKBOOKS, BILL_COM, @@ -2918,15 +2965,35 @@ constructor( NETSUITE, } + /** + * An enum containing [PaymentProvider]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [PaymentProvider] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { QUICKBOOKS, BILL_COM, STRIPE_CHARGE, STRIPE_INVOICE, NETSUITE, + /** + * An enum member indicating that [PaymentProvider] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { QUICKBOOKS -> Value.QUICKBOOKS @@ -2937,6 +3004,14 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { QUICKBOOKS -> Known.QUICKBOOKS @@ -2999,7 +3074,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [ReportingConfiguration]. */ + class Builder internal constructor() { private var exempt: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -3138,7 +3214,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [ShippingAddress]. */ + class Builder internal constructor() { private var city: JsonField = JsonMissing.of() private var country: JsonField = JsonMissing.of() @@ -3325,18 +3402,32 @@ constructor( TaxConfiguration(newTaxJar = newTaxJar) } + /** + * An interface that defines how to map each variant of [TaxConfiguration] to a value of + * type [T]. + */ interface Visitor { fun visitNewAvalara(newAvalara: NewAvalaraTaxConfiguration): T fun visitNewTaxJar(newTaxJar: NewTaxJarConfiguration): T + /** + * Maps an unknown variant of [TaxConfiguration] to a value of type [T]. + * + * An instance of [TaxConfiguration] can contain an unknown variant if it was + * deserialized from data that doesn't match any known variant. For example, if the SDK + * is on an older version than the API, then the API may respond with new variants that + * the SDK is unaware of. + * + * @throws OrbInvalidDataException in the default implementation. + */ fun unknown(json: JsonValue?): T { throw OrbInvalidDataException("Unknown TaxConfiguration: $json") } } - class Deserializer : BaseDeserializer(TaxConfiguration::class) { + internal class Deserializer : BaseDeserializer(TaxConfiguration::class) { override fun ObjectCodec.deserialize(node: JsonNode): TaxConfiguration { val json = JsonValue.fromJsonNode(node) @@ -3366,7 +3457,7 @@ constructor( } } - class Serializer : BaseSerializer(TaxConfiguration::class) { + internal class Serializer : BaseSerializer(TaxConfiguration::class) { override fun serialize( value: TaxConfiguration, @@ -3442,7 +3533,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewAvalaraTaxConfiguration]. */ + class Builder internal constructor() { private var taxExempt: JsonField? = null private var taxProvider: JsonField? = null @@ -3515,6 +3607,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -3524,21 +3624,51 @@ constructor( @JvmStatic fun of(value: String) = TaxProvider(JsonField.of(value)) } + /** An enum containing [TaxProvider]'s known values. */ enum class Known { AVALARA, } + /** + * An enum containing [TaxProvider]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [TaxProvider] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { AVALARA, + /** + * An enum member indicating that [TaxProvider] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { AVALARA -> Value.AVALARA else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { AVALARA -> Known.AVALARA @@ -3627,7 +3757,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewTaxJarConfiguration]. */ + class Builder internal constructor() { private var taxExempt: JsonField? = null private var taxProvider: JsonField? = null @@ -3687,6 +3818,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -3696,21 +3835,51 @@ constructor( @JvmStatic fun of(value: String) = TaxProvider(JsonField.of(value)) } + /** An enum containing [TaxProvider]'s known values. */ enum class Known { TAXJAR, } + /** + * An enum containing [TaxProvider]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [TaxProvider] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { TAXJAR, + /** + * An enum member indicating that [TaxProvider] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { TAXJAR -> Value.TAXJAR else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { TAXJAR -> Known.TAXJAR @@ -3908,7 +4077,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TaxId]. */ + class Builder internal constructor() { private var country: JsonField? = null private var type: JsonField? = null @@ -3969,6 +4139,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -4132,6 +4310,7 @@ constructor( @JvmStatic fun of(value: String) = Country(JsonField.of(value)) } + /** An enum containing [Country]'s known values. */ enum class Known { AD, AE, @@ -4213,6 +4392,15 @@ constructor( ZA, } + /** + * An enum containing [Country]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Country] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { AD, AE, @@ -4292,9 +4480,19 @@ constructor( VE, VN, ZA, + /** + * An enum member indicating that [Country] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { AD -> Value.AD @@ -4378,6 +4576,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { AD -> Known.AD @@ -4482,6 +4689,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -4631,6 +4846,7 @@ constructor( @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } + /** An enum containing [Type]'s known values. */ enum class Known { AD_NRT, AE_TRN, @@ -4705,6 +4921,15 @@ constructor( ZA_VAT, } + /** + * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Type] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { AD_NRT, AE_TRN, @@ -4777,9 +5002,17 @@ constructor( VE_RIF, VN_TIN, ZA_VAT, + /** An enum member indicating that [Type] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { AD_NRT -> Value.AD_NRT @@ -4856,6 +5089,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { AD_NRT -> Known.AD_NRT diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/DimensionalPriceGroup.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/DimensionalPriceGroup.kt index b25a69d7..1b91e8ff 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/DimensionalPriceGroup.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/DimensionalPriceGroup.kt @@ -126,7 +126,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [DimensionalPriceGroup]. */ + class Builder internal constructor() { private var id: JsonField? = null private var billableMetricId: JsonField? = null @@ -287,7 +288,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/DimensionalPriceGroupCreateParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/DimensionalPriceGroupCreateParams.kt index d55198c4..fcb64384 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/DimensionalPriceGroupCreateParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/DimensionalPriceGroupCreateParams.kt @@ -11,6 +11,7 @@ import com.withorb.api.core.JsonField import com.withorb.api.core.JsonMissing import com.withorb.api.core.JsonValue import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -29,11 +30,11 @@ import java.util.Optional * per blue widget. */ class DimensionalPriceGroupCreateParams -constructor( +private constructor( private val body: DimensionalPriceGroupCreateBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun billableMetricId(): String = body.billableMetricId() @@ -74,11 +75,11 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getBody(): DimensionalPriceGroupCreateBody = body + @JvmSynthetic internal fun _body(): DimensionalPriceGroupCreateBody = body - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams @NoAutoDetect class DimensionalPriceGroupCreateBody @@ -170,7 +171,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [DimensionalPriceGroupCreateBody]. */ + class Builder internal constructor() { private var billableMetricId: JsonField? = null private var dimensions: JsonField>? = null @@ -314,8 +316,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [DimensionalPriceGroupCreateParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var body: DimensionalPriceGroupCreateBody.Builder = DimensionalPriceGroupCreateBody.builder() @@ -544,7 +547,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/DimensionalPriceGroupExternalDimensionalPriceGroupIdRetrieveParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/DimensionalPriceGroupExternalDimensionalPriceGroupIdRetrieveParams.kt index d790f716..5aba7ffd 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/DimensionalPriceGroupExternalDimensionalPriceGroupIdRetrieveParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/DimensionalPriceGroupExternalDimensionalPriceGroupIdRetrieveParams.kt @@ -3,6 +3,7 @@ package com.withorb.api.models import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -10,11 +11,11 @@ import java.util.Objects /** Fetch dimensional price group by external ID */ class DimensionalPriceGroupExternalDimensionalPriceGroupIdRetrieveParams -constructor( +private constructor( private val externalDimensionalPriceGroupId: String, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun externalDimensionalPriceGroupId(): String = externalDimensionalPriceGroupId @@ -22,9 +23,9 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun getPathParam(index: Int): String { return when (index) { @@ -40,8 +41,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [DimensionalPriceGroupExternalDimensionalPriceGroupIdRetrieveParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var externalDimensionalPriceGroupId: String? = null private var additionalHeaders: Headers.Builder = Headers.builder() 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 2dbc3100..be9c5734 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 @@ -185,8 +185,7 @@ private constructor( } } - class AutoPager - constructor( + class AutoPager( private val firstPage: DimensionalPriceGroupListPage, ) : Iterable { 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 17b52dd9..2bf6263d 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 @@ -188,8 +188,7 @@ private constructor( } } - class AutoPager - constructor( + class AutoPager( private val firstPage: DimensionalPriceGroupListPageAsync, ) { diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/DimensionalPriceGroupListParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/DimensionalPriceGroupListParams.kt index 62c04965..0d296071 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/DimensionalPriceGroupListParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/DimensionalPriceGroupListParams.kt @@ -3,6 +3,7 @@ package com.withorb.api.models import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams import java.util.Objects @@ -10,12 +11,12 @@ import java.util.Optional /** List dimensional price groups */ class DimensionalPriceGroupListParams -constructor( +private constructor( private val cursor: String?, private val limit: Long?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { /** * Cursor for pagination. This can be populated by the `next_cursor` value returned from the @@ -30,10 +31,9 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic - internal fun getQueryParams(): QueryParams { + override fun _queryParams(): QueryParams { val queryParams = QueryParams.builder() this.cursor?.let { queryParams.put("cursor", listOf(it.toString())) } this.limit?.let { queryParams.put("limit", listOf(it.toString())) } @@ -48,8 +48,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [DimensionalPriceGroupListParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var cursor: String? = null private var limit: Long? = null diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/DimensionalPriceGroupRetrieveParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/DimensionalPriceGroupRetrieveParams.kt index c8bb6f1f..89a6445c 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/DimensionalPriceGroupRetrieveParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/DimensionalPriceGroupRetrieveParams.kt @@ -3,6 +3,7 @@ package com.withorb.api.models import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -10,11 +11,11 @@ import java.util.Objects /** Fetch dimensional price group */ class DimensionalPriceGroupRetrieveParams -constructor( +private constructor( private val dimensionalPriceGroupId: String, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun dimensionalPriceGroupId(): String = dimensionalPriceGroupId @@ -22,9 +23,9 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun getPathParam(index: Int): String { return when (index) { @@ -40,8 +41,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [DimensionalPriceGroupRetrieveParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var dimensionalPriceGroupId: String? = null private var additionalHeaders: Headers.Builder = Headers.builder() diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/DimensionalPriceGroups.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/DimensionalPriceGroups.kt index 0f02fb6c..311c7eb5 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/DimensionalPriceGroups.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/DimensionalPriceGroups.kt @@ -63,7 +63,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [DimensionalPriceGroups]. */ + class Builder internal constructor() { private var data: JsonField>? = null private var paginationMetadata: JsonField? = null diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/Discount.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/Discount.kt index 1fe7434d..f7c37f0a 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/Discount.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/Discount.kt @@ -138,6 +138,7 @@ private constructor( @JvmStatic fun ofAmount(amount: AmountDiscount) = Discount(amount = amount) } + /** An interface that defines how to map each variant of [Discount] to a value of type [T]. */ interface Visitor { fun visitPercentage(percentage: PercentageDiscount): T @@ -148,12 +149,21 @@ private constructor( fun visitAmount(amount: AmountDiscount): T + /** + * Maps an unknown variant of [Discount] to a value of type [T]. + * + * An instance of [Discount] can contain an unknown variant if it was deserialized from data + * that doesn't match any known variant. For example, if the SDK is on an older version than + * the API, then the API may respond with new variants that the SDK is unaware of. + * + * @throws OrbInvalidDataException in the default implementation. + */ fun unknown(json: JsonValue?): T { throw OrbInvalidDataException("Unknown Discount: $json") } } - class Deserializer : BaseDeserializer(Discount::class) { + internal class Deserializer : BaseDeserializer(Discount::class) { override fun ObjectCodec.deserialize(node: JsonNode): Discount { val json = JsonValue.fromJsonNode(node) @@ -191,7 +201,7 @@ private constructor( } } - class Serializer : BaseSerializer(Discount::class) { + internal class Serializer : BaseSerializer(Discount::class) { override fun serialize( value: Discount, @@ -293,7 +303,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [UsageDiscount]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var discountType: JsonField? = null @@ -403,6 +414,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -412,21 +431,51 @@ private constructor( @JvmStatic fun of(value: String) = DiscountType(JsonField.of(value)) } + /** An enum containing [DiscountType]'s known values. */ enum class Known { USAGE, } + /** + * An enum containing [DiscountType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [DiscountType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { USAGE, + /** + * An enum member indicating that [DiscountType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { USAGE -> Value.USAGE else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { USAGE -> Known.USAGE diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/EvaluatePriceGroup.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/EvaluatePriceGroup.kt index d79423f6..b3294c5e 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/EvaluatePriceGroup.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/EvaluatePriceGroup.kt @@ -88,7 +88,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [EvaluatePriceGroup]. */ + class Builder internal constructor() { private var amount: JsonField? = null private var groupingValues: JsonField>? = null @@ -261,6 +262,10 @@ private constructor( @JvmStatic fun ofBool(bool: Boolean) = GroupingValue(bool = bool) } + /** + * An interface that defines how to map each variant of [GroupingValue] to a value of type + * [T]. + */ interface Visitor { fun visitString(string: String): T @@ -269,12 +274,22 @@ private constructor( fun visitBool(bool: Boolean): T + /** + * Maps an unknown variant of [GroupingValue] to a value of type [T]. + * + * An instance of [GroupingValue] can contain an unknown variant if it was deserialized + * from data that doesn't match any known variant. For example, if the SDK is on an + * older version than the API, then the API may respond with new variants that the SDK + * is unaware of. + * + * @throws OrbInvalidDataException in the default implementation. + */ fun unknown(json: JsonValue?): T { throw OrbInvalidDataException("Unknown GroupingValue: $json") } } - class Deserializer : BaseDeserializer(GroupingValue::class) { + internal class Deserializer : BaseDeserializer(GroupingValue::class) { override fun ObjectCodec.deserialize(node: JsonNode): GroupingValue { val json = JsonValue.fromJsonNode(node) @@ -293,7 +308,7 @@ private constructor( } } - class Serializer : BaseSerializer(GroupingValue::class) { + internal class Serializer : BaseSerializer(GroupingValue::class) { override fun serialize( value: GroupingValue, diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/EventBackfillCloseParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/EventBackfillCloseParams.kt index 13b52c63..76349e82 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/EventBackfillCloseParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/EventBackfillCloseParams.kt @@ -4,6 +4,7 @@ package com.withorb.api.models import com.withorb.api.core.JsonValue import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -17,12 +18,12 @@ import java.util.Optional * updates are complete, the backfill's status will transition to `reflected`. */ class EventBackfillCloseParams -constructor( +private constructor( private val backfillId: String, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, private val additionalBodyProperties: Map, -) { +) : Params { fun backfillId(): String = backfillId @@ -33,12 +34,12 @@ constructor( fun _additionalBodyProperties(): Map = additionalBodyProperties @JvmSynthetic - internal fun getBody(): Optional> = + internal fun _body(): Optional> = Optional.ofNullable(additionalBodyProperties.ifEmpty { null }) - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun getPathParam(index: Int): String { return when (index) { @@ -54,8 +55,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [EventBackfillCloseParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var backfillId: String? = null private var additionalHeaders: Headers.Builder = Headers.builder() 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 30ee516c..e8abeec2 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 @@ -177,7 +177,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [EventBackfillCloseResponse]. */ + class Builder internal constructor() { private var id: JsonField? = null private var closeTime: JsonField? = null @@ -352,6 +353,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -367,6 +376,7 @@ private constructor( @JvmStatic fun of(value: String) = Status(JsonField.of(value)) } + /** An enum containing [Status]'s known values. */ enum class Known { PENDING, REFLECTED, @@ -374,14 +384,31 @@ private constructor( REVERTED, } + /** + * An enum containing [Status]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Status] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PENDING, REFLECTED, PENDING_REVERT, REVERTED, + /** An enum member indicating that [Status] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { PENDING -> Value.PENDING @@ -391,6 +418,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { PENDING -> Known.PENDING 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 fd028924..b6d6cfe3 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 @@ -11,6 +11,7 @@ import com.withorb.api.core.JsonField import com.withorb.api.core.JsonMissing import com.withorb.api.core.JsonValue import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -51,11 +52,11 @@ import java.util.Optional * specific property values. */ class EventBackfillCreateParams -constructor( +private constructor( private val body: EventBackfillCreateBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { /** The (exclusive) end of the usage timeframe affected by this backfill. */ fun timeframeEnd(): OffsetDateTime = body.timeframeEnd() @@ -137,11 +138,11 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getBody(): EventBackfillCreateBody = body + @JvmSynthetic internal fun _body(): EventBackfillCreateBody = body - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams @NoAutoDetect class EventBackfillCreateBody @@ -293,7 +294,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [EventBackfillCreateBody]. */ + class Builder internal constructor() { private var timeframeEnd: JsonField? = null private var timeframeStart: JsonField? = null @@ -491,8 +493,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [EventBackfillCreateParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var body: EventBackfillCreateBody.Builder = EventBackfillCreateBody.builder() private var additionalHeaders: Headers.Builder = Headers.builder() 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 3fbf2e09..cfaf298f 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 @@ -177,7 +177,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [EventBackfillCreateResponse]. */ + class Builder internal constructor() { private var id: JsonField? = null private var closeTime: JsonField? = null @@ -352,6 +353,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -367,6 +376,7 @@ private constructor( @JvmStatic fun of(value: String) = Status(JsonField.of(value)) } + /** An enum containing [Status]'s known values. */ enum class Known { PENDING, REFLECTED, @@ -374,14 +384,31 @@ private constructor( REVERTED, } + /** + * An enum containing [Status]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Status] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PENDING, REFLECTED, PENDING_REVERT, REVERTED, + /** An enum member indicating that [Status] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { PENDING -> Value.PENDING @@ -391,6 +418,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { PENDING -> Known.PENDING diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/EventBackfillFetchParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/EventBackfillFetchParams.kt index 63554b8f..01cf9e45 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/EventBackfillFetchParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/EventBackfillFetchParams.kt @@ -3,6 +3,7 @@ package com.withorb.api.models import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -10,11 +11,11 @@ import java.util.Objects /** This endpoint is used to fetch a backfill given an identifier. */ class EventBackfillFetchParams -constructor( +private constructor( private val backfillId: String, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun backfillId(): String = backfillId @@ -22,9 +23,9 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun getPathParam(index: Int): String { return when (index) { @@ -40,8 +41,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [EventBackfillFetchParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var backfillId: String? = null private var additionalHeaders: Headers.Builder = Headers.builder() 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 21bfe0a7..e338cb83 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 @@ -177,7 +177,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [EventBackfillFetchResponse]. */ + class Builder internal constructor() { private var id: JsonField? = null private var closeTime: JsonField? = null @@ -352,6 +353,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -367,6 +376,7 @@ private constructor( @JvmStatic fun of(value: String) = Status(JsonField.of(value)) } + /** An enum containing [Status]'s known values. */ enum class Known { PENDING, REFLECTED, @@ -374,14 +384,31 @@ private constructor( REVERTED, } + /** + * An enum containing [Status]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Status] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PENDING, REFLECTED, PENDING_REVERT, REVERTED, + /** An enum member indicating that [Status] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { PENDING -> Value.PENDING @@ -391,6 +418,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { PENDING -> Known.PENDING 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 74aa608c..70998494 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 @@ -193,8 +193,7 @@ private constructor( } } - class AutoPager - constructor( + class AutoPager( private val firstPage: EventBackfillListPage, ) : Iterable { 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 b4d66d11..5877ad90 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 @@ -196,8 +196,7 @@ private constructor( } } - class AutoPager - constructor( + class AutoPager( private val firstPage: EventBackfillListPageAsync, ) { 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 5fae3935..c9a5ad6e 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 @@ -3,6 +3,7 @@ package com.withorb.api.models import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams import java.util.Objects @@ -17,12 +18,12 @@ import java.util.Optional * [Pagination-metadata schema](pagination). */ class EventBackfillListParams -constructor( +private constructor( private val cursor: String?, private val limit: Long?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { /** * Cursor for pagination. This can be populated by the `next_cursor` value returned from the @@ -37,10 +38,9 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic - internal fun getQueryParams(): QueryParams { + override fun _queryParams(): QueryParams { val queryParams = QueryParams.builder() this.cursor?.let { queryParams.put("cursor", listOf(it.toString())) } this.limit?.let { queryParams.put("limit", listOf(it.toString())) } @@ -55,8 +55,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [EventBackfillListParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var cursor: String? = null private var limit: Long? = null 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 0478f05a..6771bdfd 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 @@ -177,7 +177,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [EventBackfillListResponse]. */ + class Builder internal constructor() { private var id: JsonField? = null private var closeTime: JsonField? = null @@ -352,6 +353,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -367,6 +376,7 @@ private constructor( @JvmStatic fun of(value: String) = Status(JsonField.of(value)) } + /** An enum containing [Status]'s known values. */ enum class Known { PENDING, REFLECTED, @@ -374,14 +384,31 @@ private constructor( REVERTED, } + /** + * An enum containing [Status]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Status] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PENDING, REFLECTED, PENDING_REVERT, REVERTED, + /** An enum member indicating that [Status] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { PENDING -> Value.PENDING @@ -391,6 +418,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { PENDING -> Known.PENDING diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/EventBackfillRevertParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/EventBackfillRevertParams.kt index 6cddf5f8..78b01bb1 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/EventBackfillRevertParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/EventBackfillRevertParams.kt @@ -4,6 +4,7 @@ package com.withorb.api.models import com.withorb.api.core.JsonValue import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -20,12 +21,12 @@ import java.util.Optional * and it will immediately transition to `reverted`. */ class EventBackfillRevertParams -constructor( +private constructor( private val backfillId: String, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, private val additionalBodyProperties: Map, -) { +) : Params { fun backfillId(): String = backfillId @@ -36,12 +37,12 @@ constructor( fun _additionalBodyProperties(): Map = additionalBodyProperties @JvmSynthetic - internal fun getBody(): Optional> = + internal fun _body(): Optional> = Optional.ofNullable(additionalBodyProperties.ifEmpty { null }) - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun getPathParam(index: Int): String { return when (index) { @@ -57,8 +58,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [EventBackfillRevertParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var backfillId: String? = null private var additionalHeaders: Headers.Builder = Headers.builder() 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 57505f66..ba50df32 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 @@ -177,7 +177,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [EventBackfillRevertResponse]. */ + class Builder internal constructor() { private var id: JsonField? = null private var closeTime: JsonField? = null @@ -352,6 +353,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -367,6 +376,7 @@ private constructor( @JvmStatic fun of(value: String) = Status(JsonField.of(value)) } + /** An enum containing [Status]'s known values. */ enum class Known { PENDING, REFLECTED, @@ -374,14 +384,31 @@ private constructor( REVERTED, } + /** + * An enum containing [Status]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Status] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PENDING, REFLECTED, PENDING_REVERT, REVERTED, + /** An enum member indicating that [Status] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { PENDING -> Value.PENDING @@ -391,6 +418,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { PENDING -> Known.PENDING diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/EventDeprecateParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/EventDeprecateParams.kt index 24dfe9d4..ec34b581 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/EventDeprecateParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/EventDeprecateParams.kt @@ -4,6 +4,7 @@ package com.withorb.api.models import com.withorb.api.core.JsonValue import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -46,12 +47,12 @@ import java.util.Optional * endpoint. */ class EventDeprecateParams -constructor( +private constructor( private val eventId: String, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, private val additionalBodyProperties: Map, -) { +) : Params { fun eventId(): String = eventId @@ -62,12 +63,12 @@ constructor( fun _additionalBodyProperties(): Map = additionalBodyProperties @JvmSynthetic - internal fun getBody(): Optional> = + internal fun _body(): Optional> = Optional.ofNullable(additionalBodyProperties.ifEmpty { null }) - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun getPathParam(index: Int): String { return when (index) { @@ -83,8 +84,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [EventDeprecateParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var eventId: String? = null private var additionalHeaders: Headers.Builder = Headers.builder() diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/EventDeprecateResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/EventDeprecateResponse.kt index 19ed1f39..8082a7d3 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/EventDeprecateResponse.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/EventDeprecateResponse.kt @@ -54,7 +54,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [EventDeprecateResponse]. */ + class Builder internal constructor() { private var deprecated: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() 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 1a9430e7..b81d885a 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 @@ -11,6 +11,7 @@ import com.withorb.api.core.JsonField import com.withorb.api.core.JsonMissing import com.withorb.api.core.JsonValue import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -207,13 +208,13 @@ import java.util.Optional * ``` */ class EventIngestParams -constructor( +private constructor( private val backfillId: String?, private val debug: Boolean?, private val body: EventIngestBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { /** * If this ingestion request is part of a backfill, this parameter ties the ingested events to @@ -234,12 +235,11 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getBody(): EventIngestBody = body + @JvmSynthetic internal fun _body(): EventIngestBody = body - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic - internal fun getQueryParams(): QueryParams { + override fun _queryParams(): QueryParams { val queryParams = QueryParams.builder() this.backfillId?.let { queryParams.put("backfill_id", listOf(it.toString())) } this.debug?.let { queryParams.put("debug", listOf(it.toString())) } @@ -284,7 +284,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [EventIngestBody]. */ + class Builder internal constructor() { private var events: JsonField>? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -365,8 +366,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [EventIngestParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var backfillId: String? = null private var debug: Boolean? = null @@ -652,7 +654,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Event]. */ + class Builder internal constructor() { private var eventName: JsonField? = null private var idempotencyKey: JsonField? = null diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/EventIngestResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/EventIngestResponse.kt index 95460632..268822f5 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/EventIngestResponse.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/EventIngestResponse.kt @@ -78,7 +78,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [EventIngestResponse]. */ + class Builder internal constructor() { private var validationFailed: JsonField>? = null private var debug: JsonField = JsonMissing.of() @@ -221,7 +222,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [ValidationFailed]. */ + class Builder internal constructor() { private var idempotencyKey: JsonField? = null private var validationErrors: JsonField>? = null @@ -370,7 +372,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Debug]. */ + class Builder internal constructor() { private var duplicate: JsonField>? = null private var ingested: JsonField>? = null 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 ac654079..e84fc591 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 @@ -11,6 +11,7 @@ import com.withorb.api.core.JsonField import com.withorb.api.core.JsonMissing import com.withorb.api.core.JsonValue import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -35,11 +36,11 @@ import java.util.Optional * `data` instead. */ class EventSearchParams -constructor( +private constructor( private val body: EventSearchBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { /** * This is an explicit array of IDs to filter by. Note that an event's ID is the idempotency_key @@ -85,11 +86,11 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getBody(): EventSearchBody = body + @JvmSynthetic internal fun _body(): EventSearchBody = body - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams @NoAutoDetect class EventSearchBody @@ -178,7 +179,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [EventSearchBody]. */ + class Builder internal constructor() { private var eventIds: JsonField>? = null private var timeframeEnd: JsonField = JsonMissing.of() @@ -324,8 +326,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [EventSearchParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var body: EventSearchBody.Builder = EventSearchBody.builder() private var additionalHeaders: Headers.Builder = Headers.builder() 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 42d46455..ce219983 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 @@ -54,7 +54,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [EventSearchResponse]. */ + class Builder internal constructor() { private var data: JsonField>? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -237,7 +238,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Data]. */ + class Builder internal constructor() { private var id: JsonField? = null private var customerId: JsonField? = null diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/EventUpdateParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/EventUpdateParams.kt index 417fdbcb..511c070b 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/EventUpdateParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/EventUpdateParams.kt @@ -11,6 +11,7 @@ import com.withorb.api.core.JsonField import com.withorb.api.core.JsonMissing import com.withorb.api.core.JsonValue import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -60,12 +61,12 @@ import java.util.Optional * For higher volume updates, consider using the [event backfill](create-backfill) endpoint. */ class EventUpdateParams -constructor( +private constructor( private val eventId: String, private val body: EventUpdateBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun eventId(): String = eventId @@ -113,11 +114,11 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getBody(): EventUpdateBody = body + @JvmSynthetic internal fun _body(): EventUpdateBody = body - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun getPathParam(index: Int): String { return when (index) { @@ -220,7 +221,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [EventUpdateBody]. */ + class Builder internal constructor() { private var eventName: JsonField? = null private var properties: JsonValue? = null @@ -350,8 +352,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [EventUpdateParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var eventId: String? = null private var body: EventUpdateBody.Builder = EventUpdateBody.builder() diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/EventUpdateResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/EventUpdateResponse.kt index f083fbbb..095f4ebb 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/EventUpdateResponse.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/EventUpdateResponse.kt @@ -54,7 +54,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [EventUpdateResponse]. */ + class Builder internal constructor() { private var amended: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() 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 4357814f..c903c37f 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 @@ -3,6 +3,7 @@ package com.withorb.api.models import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -25,14 +26,14 @@ import java.util.Optional * end time, the response includes the hours the timestamp falls in. */ class EventVolumeListParams -constructor( +private constructor( private val timeframeStart: OffsetDateTime, private val cursor: String?, private val limit: Long?, private val timeframeEnd: OffsetDateTime?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { /** * The start of the timeframe, inclusive, in which to return event volume. All datetime values @@ -62,10 +63,9 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic - internal fun getQueryParams(): QueryParams { + override fun _queryParams(): QueryParams { val queryParams = QueryParams.builder() this.timeframeStart.let { queryParams.put( @@ -92,8 +92,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [EventVolumeListParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var timeframeStart: OffsetDateTime? = null private var cursor: String? = null diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/EventVolumes.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/EventVolumes.kt index 104aab3d..7d88039e 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/EventVolumes.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/EventVolumes.kt @@ -53,7 +53,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [EventVolumes]. */ + class Builder internal constructor() { private var data: JsonField>? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -172,7 +173,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Data]. */ + class Builder internal constructor() { private var count: JsonField? = null private var timeframeEnd: JsonField? = null 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 36b0a777..400a0a0c 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 @@ -802,7 +802,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Invoice]. */ + class Builder internal constructor() { private var id: JsonField? = null private var amountDue: JsonField? = null @@ -1354,6 +1355,14 @@ private constructor( fun addDiscount(trial: TrialDiscount) = addDiscount(InvoiceLevelDiscount.ofTrial(trial)) + fun addTrialDiscount(appliesToPriceIds: List) = + addDiscount( + TrialDiscount.builder() + .discountType(TrialDiscount.DiscountType.TRIAL) + .appliesToPriceIds(appliesToPriceIds) + .build() + ) + /** * When the invoice payment is due. The due date is null if the invoice is not yet * finalized. @@ -1938,7 +1947,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AutoCollection]. */ + class Builder internal constructor() { private var enabled: JsonField? = null private var nextAttemptAt: JsonField? = null @@ -2168,7 +2178,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingAddress]. */ + class Builder internal constructor() { private var city: JsonField? = null private var country: JsonField? = null @@ -2372,7 +2383,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CreditNote]. */ + class Builder internal constructor() { private var id: JsonField? = null private var creditNoteNumber: JsonField? = null @@ -2541,7 +2553,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Customer]. */ + class Builder internal constructor() { private var id: JsonField? = null private var externalCustomerId: JsonField? = null @@ -2754,7 +2767,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CustomerBalanceTransaction]. */ + class Builder internal constructor() { private var id: JsonField? = null private var action: JsonField? = null @@ -2907,6 +2921,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -2930,6 +2952,7 @@ private constructor( @JvmStatic fun of(value: String) = Action(JsonField.of(value)) } + /** An enum containing [Action]'s known values. */ enum class Known { APPLIED_TO_INVOICE, MANUAL_ADJUSTMENT, @@ -2941,6 +2964,15 @@ private constructor( OVERPAYMENT_REFUND, } + /** + * An enum containing [Action]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Action] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { APPLIED_TO_INVOICE, MANUAL_ADJUSTMENT, @@ -2950,9 +2982,19 @@ private constructor( CREDIT_NOTE_APPLIED, CREDIT_NOTE_VOIDED, OVERPAYMENT_REFUND, + /** + * An enum member indicating that [Action] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { APPLIED_TO_INVOICE -> Value.APPLIED_TO_INVOICE @@ -2966,6 +3008,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { APPLIED_TO_INVOICE -> Known.APPLIED_TO_INVOICE @@ -3033,7 +3084,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CreditNote]. */ + class Builder internal constructor() { private var id: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -3133,7 +3185,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InnerInvoice]. */ + class Builder internal constructor() { private var id: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -3200,6 +3253,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -3211,17 +3272,35 @@ private constructor( @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } + /** An enum containing [Type]'s known values. */ enum class Known { INCREMENT, DECREMENT, } + /** + * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Type] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { INCREMENT, DECREMENT, + /** An enum member indicating that [Type] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { INCREMENT -> Value.INCREMENT @@ -3229,6 +3308,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { INCREMENT -> Known.INCREMENT @@ -3426,7 +3514,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CustomerTaxId]. */ + class Builder internal constructor() { private var country: JsonField? = null private var type: JsonField? = null @@ -3487,6 +3576,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -3650,6 +3747,7 @@ private constructor( @JvmStatic fun of(value: String) = Country(JsonField.of(value)) } + /** An enum containing [Country]'s known values. */ enum class Known { AD, AE, @@ -3731,6 +3829,15 @@ private constructor( ZA, } + /** + * An enum containing [Country]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Country] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { AD, AE, @@ -3810,9 +3917,19 @@ private constructor( VE, VN, ZA, + /** + * An enum member indicating that [Country] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { AD -> Value.AD @@ -3896,6 +4013,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { AD -> Known.AD @@ -4000,6 +4126,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -4149,6 +4283,7 @@ private constructor( @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } + /** An enum containing [Type]'s known values. */ enum class Known { AD_NRT, AE_TRN, @@ -4223,6 +4358,15 @@ private constructor( ZA_VAT, } + /** + * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Type] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { AD_NRT, AE_TRN, @@ -4295,9 +4439,17 @@ private constructor( VE_RIF, VN_TIN, ZA_VAT, + /** An enum member indicating that [Type] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { AD_NRT -> Value.AD_NRT @@ -4374,6 +4526,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { AD_NRT -> Known.AD_NRT @@ -4489,6 +4650,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -4502,19 +4671,40 @@ private constructor( @JvmStatic fun of(value: String) = InvoiceSource(JsonField.of(value)) } + /** An enum containing [InvoiceSource]'s known values. */ enum class Known { SUBSCRIPTION, PARTIAL, ONE_OFF, } + /** + * An enum containing [InvoiceSource]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [InvoiceSource] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { SUBSCRIPTION, PARTIAL, ONE_OFF, + /** + * An enum member indicating that [InvoiceSource] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { SUBSCRIPTION -> Value.SUBSCRIPTION @@ -4523,6 +4713,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { SUBSCRIPTION -> Known.SUBSCRIPTION @@ -4551,9 +4749,18 @@ private constructor( @JsonCreator private constructor( @JsonProperty("id") @ExcludeMissing private val id: JsonField = JsonMissing.of(), + @JsonProperty("adjusted_subtotal") + @ExcludeMissing + private val adjustedSubtotal: JsonField = JsonMissing.of(), + @JsonProperty("adjustments") + @ExcludeMissing + private val adjustments: JsonField> = JsonMissing.of(), @JsonProperty("amount") @ExcludeMissing private val amount: JsonField = JsonMissing.of(), + @JsonProperty("credits_applied") + @ExcludeMissing + private val creditsApplied: JsonField = JsonMissing.of(), @JsonProperty("discount") @ExcludeMissing private val discount: JsonField = JsonMissing.of(), @@ -4578,6 +4785,9 @@ private constructor( @JsonProperty("name") @ExcludeMissing private val name: JsonField = JsonMissing.of(), + @JsonProperty("partially_invoiced_amount") + @ExcludeMissing + private val partiallyInvoicedAmount: JsonField = JsonMissing.of(), @JsonProperty("price") @ExcludeMissing private val price: JsonField = JsonMissing.of(), @@ -4603,9 +4813,21 @@ private constructor( /** A unique ID for this line item. */ fun id(): String = id.getRequired("id") + /** + * The line amount after any adjustments, before overage conversion, credits and partial + * invoicing. + */ + fun adjustedSubtotal(): String = adjustedSubtotal.getRequired("adjusted_subtotal") + + /** All adjustments applied to the line item. */ + fun adjustments(): List = adjustments.getRequired("adjustments") + /** The final amount after any discounts or minimums. */ fun amount(): String = amount.getRequired("amount") + /** The number of credits used */ + fun creditsApplied(): String = creditsApplied.getRequired("credits_applied") + fun discount(): Optional = Optional.ofNullable(discount.getNullable("discount")) /** The end date of the range of time applied for this line item's price. */ @@ -4618,19 +4840,31 @@ private constructor( */ fun grouping(): Optional = Optional.ofNullable(grouping.getNullable("grouping")) + /** This field is deprecated in favor of `adjustments`. */ + @Deprecated("deprecated") fun maximum(): Optional = Optional.ofNullable(maximum.getNullable("maximum")) + /** This field is deprecated in favor of `adjustments`. */ + @Deprecated("deprecated") fun maximumAmount(): Optional = Optional.ofNullable(maximumAmount.getNullable("maximum_amount")) + /** This field is deprecated in favor of `adjustments`. */ + @Deprecated("deprecated") fun minimum(): Optional = Optional.ofNullable(minimum.getNullable("minimum")) + /** This field is deprecated in favor of `adjustments`. */ + @Deprecated("deprecated") fun minimumAmount(): Optional = Optional.ofNullable(minimumAmount.getNullable("minimum_amount")) /** The name of the price associated with this line item. */ fun name(): String = name.getRequired("name") + /** Any amount applied from a partial invoice */ + fun partiallyInvoicedAmount(): String = + partiallyInvoicedAmount.getRequired("partially_invoiced_amount") + /** * 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 @@ -4668,9 +4902,27 @@ private constructor( /** A unique ID for this line item. */ @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + /** + * The line amount after any adjustments, before overage conversion, credits and partial + * invoicing. + */ + @JsonProperty("adjusted_subtotal") + @ExcludeMissing + fun _adjustedSubtotal(): JsonField = adjustedSubtotal + + /** All adjustments applied to the line item. */ + @JsonProperty("adjustments") + @ExcludeMissing + fun _adjustments(): JsonField> = adjustments + /** The final amount after any discounts or minimums. */ @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount + /** The number of credits used */ + @JsonProperty("credits_applied") + @ExcludeMissing + fun _creditsApplied(): JsonField = creditsApplied + @JsonProperty("discount") @ExcludeMissing fun _discount(): JsonField = discount /** The end date of the range of time applied for this line item's price. */ @@ -4685,14 +4937,26 @@ private constructor( */ @JsonProperty("grouping") @ExcludeMissing fun _grouping(): JsonField = grouping - @JsonProperty("maximum") @ExcludeMissing fun _maximum(): JsonField = maximum + /** This field is deprecated in favor of `adjustments`. */ + @Deprecated("deprecated") + @JsonProperty("maximum") + @ExcludeMissing + fun _maximum(): JsonField = maximum + /** This field is deprecated in favor of `adjustments`. */ + @Deprecated("deprecated") @JsonProperty("maximum_amount") @ExcludeMissing fun _maximumAmount(): JsonField = maximumAmount - @JsonProperty("minimum") @ExcludeMissing fun _minimum(): JsonField = minimum + /** This field is deprecated in favor of `adjustments`. */ + @Deprecated("deprecated") + @JsonProperty("minimum") + @ExcludeMissing + fun _minimum(): JsonField = minimum + /** This field is deprecated in favor of `adjustments`. */ + @Deprecated("deprecated") @JsonProperty("minimum_amount") @ExcludeMissing fun _minimumAmount(): JsonField = minimumAmount @@ -4700,6 +4964,11 @@ private constructor( /** The name of the price associated with this line item. */ @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + /** Any amount applied from a partial invoice */ + @JsonProperty("partially_invoiced_amount") + @ExcludeMissing + fun _partiallyInvoicedAmount(): JsonField = partiallyInvoicedAmount + /** * 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 @@ -4752,7 +5021,10 @@ private constructor( } id() + adjustedSubtotal() + adjustments().forEach { it.validate() } amount() + creditsApplied() discount().ifPresent { it.validate() } endDate() grouping() @@ -4761,6 +5033,7 @@ private constructor( minimum().ifPresent { it.validate() } minimumAmount() name() + partiallyInvoicedAmount() price().ifPresent { it.validate() } quantity() startDate() @@ -4777,10 +5050,14 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [LineItem]. */ + class Builder internal constructor() { private var id: JsonField? = null + private var adjustedSubtotal: JsonField? = null + private var adjustments: JsonField>? = null private var amount: JsonField? = null + private var creditsApplied: JsonField? = null private var discount: JsonField? = null private var endDate: JsonField? = null private var grouping: JsonField? = null @@ -4789,6 +5066,7 @@ private constructor( private var minimum: JsonField? = null private var minimumAmount: JsonField? = null private var name: JsonField? = null + private var partiallyInvoicedAmount: JsonField? = null private var price: JsonField? = null private var quantity: JsonField? = null private var startDate: JsonField? = null @@ -4800,7 +5078,10 @@ private constructor( @JvmSynthetic internal fun from(lineItem: LineItem) = apply { id = lineItem.id + adjustedSubtotal = lineItem.adjustedSubtotal + adjustments = lineItem.adjustments.map { it.toMutableList() } amount = lineItem.amount + creditsApplied = lineItem.creditsApplied discount = lineItem.discount endDate = lineItem.endDate grouping = lineItem.grouping @@ -4809,6 +5090,7 @@ private constructor( minimum = lineItem.minimum minimumAmount = lineItem.minimumAmount name = lineItem.name + partiallyInvoicedAmount = lineItem.partiallyInvoicedAmount price = lineItem.price quantity = lineItem.quantity startDate = lineItem.startDate @@ -4824,12 +5106,78 @@ private constructor( /** A unique ID for this line item. */ fun id(id: JsonField) = apply { this.id = id } + /** + * The line amount after any adjustments, before overage conversion, credits and partial + * invoicing. + */ + fun adjustedSubtotal(adjustedSubtotal: String) = + adjustedSubtotal(JsonField.of(adjustedSubtotal)) + + /** + * The line amount after any adjustments, before overage conversion, credits and partial + * invoicing. + */ + fun adjustedSubtotal(adjustedSubtotal: JsonField) = apply { + this.adjustedSubtotal = adjustedSubtotal + } + + /** All adjustments applied to the line item. */ + fun adjustments(adjustments: List) = adjustments(JsonField.of(adjustments)) + + /** All adjustments applied to the line item. */ + fun adjustments(adjustments: JsonField>) = apply { + this.adjustments = adjustments.map { it.toMutableList() } + } + + /** All adjustments applied to the line item. */ + fun addAdjustment(adjustment: Adjustment) = apply { + adjustments = + (adjustments ?: JsonField.of(mutableListOf())).apply { + asKnown() + .orElseThrow { + IllegalStateException( + "Field was set to non-list type: ${javaClass.simpleName}" + ) + } + .add(adjustment) + } + } + + /** All adjustments applied to the line item. */ + fun addAdjustment(amountDiscount: Adjustment.AmountDiscountAdjustment) = + addAdjustment(Adjustment.ofAmountDiscount(amountDiscount)) + + /** All adjustments applied to the line item. */ + fun addAdjustment(percentageDiscount: Adjustment.PercentageDiscountAdjustment) = + addAdjustment(Adjustment.ofPercentageDiscount(percentageDiscount)) + + /** All adjustments applied to the line item. */ + fun addAdjustment(usageDiscount: Adjustment.UsageDiscountAdjustment) = + addAdjustment(Adjustment.ofUsageDiscount(usageDiscount)) + + /** All adjustments applied to the line item. */ + fun addAdjustment(minimum: Adjustment.MinimumAdjustment) = + addAdjustment(Adjustment.ofMinimum(minimum)) + + /** All adjustments applied to the line item. */ + fun addAdjustment(maximum: Adjustment.MaximumAdjustment) = + addAdjustment(Adjustment.ofMaximum(maximum)) + /** The final amount after any discounts or minimums. */ fun amount(amount: String) = amount(JsonField.of(amount)) /** The final amount after any discounts or minimums. */ fun amount(amount: JsonField) = apply { this.amount = amount } + /** The number of credits used */ + fun creditsApplied(creditsApplied: String) = + creditsApplied(JsonField.of(creditsApplied)) + + /** The number of credits used */ + fun creditsApplied(creditsApplied: JsonField) = apply { + this.creditsApplied = creditsApplied + } + fun discount(discount: Discount?) = discount(JsonField.ofNullable(discount)) fun discount(discount: Optional) = discount(discount.orElse(null)) @@ -4841,6 +5189,14 @@ private constructor( fun discount(trial: TrialDiscount) = discount(Discount.ofTrial(trial)) + fun trialDiscount(appliesToPriceIds: List) = + discount( + TrialDiscount.builder() + .discountType(TrialDiscount.DiscountType.TRIAL) + .appliesToPriceIds(appliesToPriceIds) + .build() + ) + fun discount(usage: Discount.UsageDiscount) = discount(Discount.ofUsage(usage)) fun discount(amount: AmountDiscount) = discount(Discount.ofAmount(amount)) @@ -4872,34 +5228,58 @@ private constructor( */ fun grouping(grouping: JsonField) = apply { this.grouping = grouping } + /** This field is deprecated in favor of `adjustments`. */ + @Deprecated("deprecated") fun maximum(maximum: Maximum?) = maximum(JsonField.ofNullable(maximum)) + /** This field is deprecated in favor of `adjustments`. */ + @Deprecated("deprecated") fun maximum(maximum: Optional) = maximum(maximum.orElse(null)) + /** This field is deprecated in favor of `adjustments`. */ + @Deprecated("deprecated") fun maximum(maximum: JsonField) = apply { this.maximum = maximum } + /** This field is deprecated in favor of `adjustments`. */ + @Deprecated("deprecated") fun maximumAmount(maximumAmount: String?) = maximumAmount(JsonField.ofNullable(maximumAmount)) + /** This field is deprecated in favor of `adjustments`. */ + @Deprecated("deprecated") fun maximumAmount(maximumAmount: Optional) = maximumAmount(maximumAmount.orElse(null)) + /** This field is deprecated in favor of `adjustments`. */ + @Deprecated("deprecated") fun maximumAmount(maximumAmount: JsonField) = apply { this.maximumAmount = maximumAmount } + /** This field is deprecated in favor of `adjustments`. */ + @Deprecated("deprecated") fun minimum(minimum: Minimum?) = minimum(JsonField.ofNullable(minimum)) + /** This field is deprecated in favor of `adjustments`. */ + @Deprecated("deprecated") fun minimum(minimum: Optional) = minimum(minimum.orElse(null)) + /** This field is deprecated in favor of `adjustments`. */ + @Deprecated("deprecated") fun minimum(minimum: JsonField) = apply { this.minimum = minimum } + /** This field is deprecated in favor of `adjustments`. */ + @Deprecated("deprecated") fun minimumAmount(minimumAmount: String?) = minimumAmount(JsonField.ofNullable(minimumAmount)) + /** This field is deprecated in favor of `adjustments`. */ + @Deprecated("deprecated") fun minimumAmount(minimumAmount: Optional) = minimumAmount(minimumAmount.orElse(null)) + /** This field is deprecated in favor of `adjustments`. */ + @Deprecated("deprecated") fun minimumAmount(minimumAmount: JsonField) = apply { this.minimumAmount = minimumAmount } @@ -4910,6 +5290,15 @@ private constructor( /** The name of the price associated with this line item. */ fun name(name: JsonField) = apply { this.name = name } + /** Any amount applied from a partial invoice */ + fun partiallyInvoicedAmount(partiallyInvoicedAmount: String) = + partiallyInvoicedAmount(JsonField.of(partiallyInvoicedAmount)) + + /** Any amount applied from a partial invoice */ + fun partiallyInvoicedAmount(partiallyInvoicedAmount: JsonField) = apply { + this.partiallyInvoicedAmount = partiallyInvoicedAmount + } + /** * 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 @@ -5319,6 +5708,36 @@ private constructor( fun price(maxGroupTieredPackage: Price.MaxGroupTieredPackagePrice) = price(Price.ofMaxGroupTieredPackage(maxGroupTieredPackage)) + /** + * The Price resource represents a price that can be billed on a subscription, resulting + * in a charge on an invoice in the form of an invoice line item. Prices take a quantity + * and determine an amount to bill. + * + * Orb supports a few different pricing models out of the box. Each of these models is + * serialized differently in a given Price object. The model_type field determines the + * key for the configuration object that is present. + * + * For more on the types of prices, see + * [the core concepts documentation](/core-concepts#plan-and-price) + */ + fun price(scalableMatrixWithUnitPricing: Price.ScalableMatrixWithUnitPricingPrice) = + price(Price.ofScalableMatrixWithUnitPricing(scalableMatrixWithUnitPricing)) + + /** + * The Price resource represents a price that can be billed on a subscription, resulting + * in a charge on an invoice in the form of an invoice line item. Prices take a quantity + * and determine an amount to bill. + * + * Orb supports a few different pricing models out of the box. Each of these models is + * serialized differently in a given Price object. The model_type field determines the + * key for the configuration object that is present. + * + * For more on the types of prices, see + * [the core concepts documentation](/core-concepts#plan-and-price) + */ + fun price(scalableMatrixWithTieredPricing: Price.ScalableMatrixWithTieredPricingPrice) = + price(Price.ofScalableMatrixWithTieredPricing(scalableMatrixWithTieredPricing)) + fun quantity(quantity: Double) = quantity(JsonField.of(quantity)) fun quantity(quantity: JsonField) = apply { this.quantity = quantity } @@ -5443,7 +5862,10 @@ private constructor( fun build(): LineItem = LineItem( checkRequired("id", id), + checkRequired("adjustedSubtotal", adjustedSubtotal), + checkRequired("adjustments", adjustments).map { it.toImmutable() }, checkRequired("amount", amount), + checkRequired("creditsApplied", creditsApplied), checkRequired("discount", discount), checkRequired("endDate", endDate), checkRequired("grouping", grouping), @@ -5452,6 +5874,7 @@ private constructor( checkRequired("minimum", minimum), checkRequired("minimumAmount", minimumAmount), checkRequired("name", name), + checkRequired("partiallyInvoicedAmount", partiallyInvoicedAmount), checkRequired("price", price), checkRequired("quantity", quantity), checkRequired("startDate", startDate), @@ -5462,81 +5885,2264 @@ private constructor( ) } - @NoAutoDetect - class Maximum - @JsonCreator + @JsonDeserialize(using = Adjustment.Deserializer::class) + @JsonSerialize(using = Adjustment.Serializer::class) + class Adjustment 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(), + private val amountDiscount: AmountDiscountAdjustment? = null, + private val percentageDiscount: PercentageDiscountAdjustment? = null, + private val usageDiscount: UsageDiscountAdjustment? = null, + private val minimum: MinimumAdjustment? = null, + private val maximum: MaximumAdjustment? = null, + private val _json: JsonValue? = null, ) { - /** - * 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") + fun amountDiscount(): Optional = + Optional.ofNullable(amountDiscount) - /** Maximum amount applied */ - fun maximumAmount(): String = maximumAmount.getRequired("maximum_amount") + fun percentageDiscount(): Optional = + Optional.ofNullable(percentageDiscount) - /** - * 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 + fun usageDiscount(): Optional = + Optional.ofNullable(usageDiscount) - /** Maximum amount applied */ - @JsonProperty("maximum_amount") - @ExcludeMissing - fun _maximumAmount(): JsonField = maximumAmount + fun minimum(): Optional = Optional.ofNullable(minimum) - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = additionalProperties + fun maximum(): Optional = Optional.ofNullable(maximum) + + fun isAmountDiscount(): Boolean = amountDiscount != null + + fun isPercentageDiscount(): Boolean = percentageDiscount != null + + fun isUsageDiscount(): Boolean = usageDiscount != null + + fun isMinimum(): Boolean = minimum != null + + fun isMaximum(): Boolean = maximum != null + + fun asAmountDiscount(): AmountDiscountAdjustment = + amountDiscount.getOrThrow("amountDiscount") + + fun asPercentageDiscount(): PercentageDiscountAdjustment = + percentageDiscount.getOrThrow("percentageDiscount") + + fun asUsageDiscount(): UsageDiscountAdjustment = + usageDiscount.getOrThrow("usageDiscount") + + fun asMinimum(): MinimumAdjustment = minimum.getOrThrow("minimum") + + fun asMaximum(): MaximumAdjustment = maximum.getOrThrow("maximum") + + fun _json(): Optional = Optional.ofNullable(_json) + + fun accept(visitor: Visitor): T { + return when { + amountDiscount != null -> visitor.visitAmountDiscount(amountDiscount) + percentageDiscount != null -> + visitor.visitPercentageDiscount(percentageDiscount) + usageDiscount != null -> visitor.visitUsageDiscount(usageDiscount) + minimum != null -> visitor.visitMinimum(minimum) + maximum != null -> visitor.visitMaximum(maximum) + else -> visitor.unknown(_json) + } + } private var validated: Boolean = false - fun validate(): Maximum = apply { + fun validate(): Adjustment = apply { if (validated) { return@apply } - appliesToPriceIds() - maximumAmount() + accept( + object : Visitor { + override fun visitAmountDiscount(amountDiscount: AmountDiscountAdjustment) { + amountDiscount.validate() + } + + override fun visitPercentageDiscount( + percentageDiscount: PercentageDiscountAdjustment + ) { + percentageDiscount.validate() + } + + override fun visitUsageDiscount(usageDiscount: UsageDiscountAdjustment) { + usageDiscount.validate() + } + + override fun visitMinimum(minimum: MinimumAdjustment) { + minimum.validate() + } + + override fun visitMaximum(maximum: MaximumAdjustment) { + maximum.validate() + } + } + ) validated = true } - fun toBuilder() = Builder().from(this) + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Adjustment && amountDiscount == other.amountDiscount && percentageDiscount == other.percentageDiscount && usageDiscount == other.usageDiscount && minimum == other.minimum && maximum == other.maximum /* spotless:on */ + } + + override fun hashCode(): Int = /* spotless:off */ Objects.hash(amountDiscount, percentageDiscount, usageDiscount, minimum, maximum) /* spotless:on */ + + override fun toString(): String = + when { + amountDiscount != null -> "Adjustment{amountDiscount=$amountDiscount}" + percentageDiscount != null -> + "Adjustment{percentageDiscount=$percentageDiscount}" + usageDiscount != null -> "Adjustment{usageDiscount=$usageDiscount}" + minimum != null -> "Adjustment{minimum=$minimum}" + maximum != null -> "Adjustment{maximum=$maximum}" + _json != null -> "Adjustment{_unknown=$_json}" + else -> throw IllegalStateException("Invalid Adjustment") + } companion object { - @JvmStatic fun builder() = Builder() - } + @JvmStatic + fun ofAmountDiscount(amountDiscount: AmountDiscountAdjustment) = + Adjustment(amountDiscount = amountDiscount) - class Builder { + @JvmStatic + fun ofPercentageDiscount(percentageDiscount: PercentageDiscountAdjustment) = + Adjustment(percentageDiscount = percentageDiscount) - private var appliesToPriceIds: JsonField>? = null - private var maximumAmount: JsonField? = null - private var additionalProperties: MutableMap = mutableMapOf() + @JvmStatic + fun ofUsageDiscount(usageDiscount: UsageDiscountAdjustment) = + Adjustment(usageDiscount = usageDiscount) - @JvmSynthetic - internal fun from(maximum: Maximum) = apply { - appliesToPriceIds = maximum.appliesToPriceIds.map { it.toMutableList() } - maximumAmount = maximum.maximumAmount - additionalProperties = maximum.additionalProperties.toMutableMap() - } + @JvmStatic fun ofMinimum(minimum: MinimumAdjustment) = Adjustment(minimum = minimum) - /** - * List of price_ids that this maximum amount applies to. For plan/plan phase + @JvmStatic fun ofMaximum(maximum: MaximumAdjustment) = Adjustment(maximum = maximum) + } + + /** + * An interface that defines how to map each variant of [Adjustment] to a value of type + * [T]. + */ + interface Visitor { + + fun visitAmountDiscount(amountDiscount: AmountDiscountAdjustment): T + + fun visitPercentageDiscount(percentageDiscount: PercentageDiscountAdjustment): T + + fun visitUsageDiscount(usageDiscount: UsageDiscountAdjustment): T + + fun visitMinimum(minimum: MinimumAdjustment): T + + fun visitMaximum(maximum: MaximumAdjustment): T + + /** + * Maps an unknown variant of [Adjustment] to a value of type [T]. + * + * An instance of [Adjustment] can contain an unknown variant if it was deserialized + * from data that doesn't match any known variant. For example, if the SDK is on an + * older version than the API, then the API may respond with new variants that the + * SDK is unaware of. + * + * @throws OrbInvalidDataException in the default implementation. + */ + fun unknown(json: JsonValue?): T { + throw OrbInvalidDataException("Unknown Adjustment: $json") + } + } + + internal class Deserializer : BaseDeserializer(Adjustment::class) { + + override fun ObjectCodec.deserialize(node: JsonNode): Adjustment { + val json = JsonValue.fromJsonNode(node) + val adjustmentType = + json.asObject().getOrNull()?.get("adjustment_type")?.asString()?.getOrNull() + + when (adjustmentType) { + "amount_discount" -> { + tryDeserialize(node, jacksonTypeRef()) { + it.validate() + } + ?.let { + return Adjustment(amountDiscount = it, _json = json) + } + } + "percentage_discount" -> { + tryDeserialize(node, jacksonTypeRef()) { + it.validate() + } + ?.let { + return Adjustment(percentageDiscount = it, _json = json) + } + } + "usage_discount" -> { + tryDeserialize(node, jacksonTypeRef()) { + it.validate() + } + ?.let { + return Adjustment(usageDiscount = it, _json = json) + } + } + "minimum" -> { + tryDeserialize(node, jacksonTypeRef()) { + it.validate() + } + ?.let { + return Adjustment(minimum = it, _json = json) + } + } + "maximum" -> { + tryDeserialize(node, jacksonTypeRef()) { + it.validate() + } + ?.let { + return Adjustment(maximum = it, _json = json) + } + } + } + + return Adjustment(_json = json) + } + } + + internal class Serializer : BaseSerializer(Adjustment::class) { + + override fun serialize( + value: Adjustment, + generator: JsonGenerator, + provider: SerializerProvider + ) { + when { + value.amountDiscount != null -> generator.writeObject(value.amountDiscount) + value.percentageDiscount != null -> + generator.writeObject(value.percentageDiscount) + value.usageDiscount != null -> generator.writeObject(value.usageDiscount) + value.minimum != null -> generator.writeObject(value.minimum) + value.maximum != null -> generator.writeObject(value.maximum) + value._json != null -> generator.writeObject(value._json) + else -> throw IllegalStateException("Invalid Adjustment") + } + } + } + + @NoAutoDetect + class AmountDiscountAdjustment + @JsonCreator + private constructor( + @JsonProperty("id") + @ExcludeMissing + private val id: JsonField = JsonMissing.of(), + @JsonProperty("adjustment_type") + @ExcludeMissing + private val adjustmentType: JsonField = JsonMissing.of(), + @JsonProperty("amount_discount") + @ExcludeMissing + private val amountDiscount: JsonField = JsonMissing.of(), + @JsonProperty("applies_to_price_ids") + @ExcludeMissing + private val appliesToPriceIds: JsonField> = JsonMissing.of(), + @JsonProperty("is_invoice_level") + @ExcludeMissing + private val isInvoiceLevel: JsonField = JsonMissing.of(), + @JsonProperty("plan_phase_order") + @ExcludeMissing + private val planPhaseOrder: JsonField = JsonMissing.of(), + @JsonProperty("reason") + @ExcludeMissing + private val reason: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { + + fun id(): String = id.getRequired("id") + + fun adjustmentType(): AdjustmentType = adjustmentType.getRequired("adjustment_type") + + /** + * The amount by which to discount the prices this adjustment applies to in a given + * billing period. + */ + fun amountDiscount(): String = amountDiscount.getRequired("amount_discount") + + /** The price IDs that this adjustment applies to. */ + fun appliesToPriceIds(): List = + appliesToPriceIds.getRequired("applies_to_price_ids") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + + /** The reason for the adjustment. */ + fun reason(): Optional = Optional.ofNullable(reason.getNullable("reason")) + + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + @JsonProperty("adjustment_type") + @ExcludeMissing + fun _adjustmentType(): JsonField = adjustmentType + + /** + * The amount by which to discount the prices this adjustment applies to in a given + * billing period. + */ + @JsonProperty("amount_discount") + @ExcludeMissing + fun _amountDiscount(): JsonField = amountDiscount + + /** The price IDs that this adjustment applies to. */ + @JsonProperty("applies_to_price_ids") + @ExcludeMissing + fun _appliesToPriceIds(): JsonField> = appliesToPriceIds + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel(): JsonField = isInvoiceLevel + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun _planPhaseOrder(): JsonField = planPhaseOrder + + /** The reason for the adjustment. */ + @JsonProperty("reason") @ExcludeMissing fun _reason(): JsonField = reason + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): AmountDiscountAdjustment = apply { + if (validated) { + return@apply + } + + id() + adjustmentType() + amountDiscount() + appliesToPriceIds() + isInvoiceLevel() + planPhaseOrder() + reason() + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + /** A builder for [AmountDiscountAdjustment]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var adjustmentType: JsonField? = null + private var amountDiscount: JsonField? = null + private var appliesToPriceIds: JsonField>? = null + private var isInvoiceLevel: JsonField? = null + private var planPhaseOrder: JsonField? = null + private var reason: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(amountDiscountAdjustment: AmountDiscountAdjustment) = apply { + id = amountDiscountAdjustment.id + adjustmentType = amountDiscountAdjustment.adjustmentType + amountDiscount = amountDiscountAdjustment.amountDiscount + appliesToPriceIds = + amountDiscountAdjustment.appliesToPriceIds.map { it.toMutableList() } + isInvoiceLevel = amountDiscountAdjustment.isInvoiceLevel + planPhaseOrder = amountDiscountAdjustment.planPhaseOrder + reason = amountDiscountAdjustment.reason + additionalProperties = + amountDiscountAdjustment.additionalProperties.toMutableMap() + } + + fun id(id: String) = id(JsonField.of(id)) + + fun id(id: JsonField) = apply { this.id = id } + + fun adjustmentType(adjustmentType: AdjustmentType) = + adjustmentType(JsonField.of(adjustmentType)) + + fun adjustmentType(adjustmentType: JsonField) = apply { + this.adjustmentType = adjustmentType + } + + /** + * The amount by which to discount the prices this adjustment applies to in a + * given billing period. + */ + fun amountDiscount(amountDiscount: String) = + amountDiscount(JsonField.of(amountDiscount)) + + /** + * The amount by which to discount the prices this adjustment applies to in a + * given billing period. + */ + fun amountDiscount(amountDiscount: JsonField) = apply { + this.amountDiscount = amountDiscount + } + + /** The price IDs that this adjustment applies to. */ + fun appliesToPriceIds(appliesToPriceIds: List) = + appliesToPriceIds(JsonField.of(appliesToPriceIds)) + + /** The price IDs that this adjustment applies to. */ + fun appliesToPriceIds(appliesToPriceIds: JsonField>) = apply { + this.appliesToPriceIds = appliesToPriceIds.map { it.toMutableList() } + } + + /** The price IDs that this adjustment applies to. */ + 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) + } + } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long?) = + planPhaseOrder(JsonField.ofNullable(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = + planPhaseOrder(planPhaseOrder as Long?) + + /** The plan phase in which this adjustment is active. */ + @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 + fun planPhaseOrder(planPhaseOrder: Optional) = + planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + + /** The reason for the adjustment. */ + fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) + + /** The reason for the adjustment. */ + fun reason(reason: Optional) = reason(reason.orElse(null)) + + /** The reason for the adjustment. */ + fun reason(reason: JsonField) = apply { this.reason = reason } + + 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(): AmountDiscountAdjustment = + AmountDiscountAdjustment( + checkRequired("id", id), + checkRequired("adjustmentType", adjustmentType), + checkRequired("amountDiscount", amountDiscount), + checkRequired("appliesToPriceIds", appliesToPriceIds).map { + it.toImmutable() + }, + checkRequired("isInvoiceLevel", isInvoiceLevel), + checkRequired("planPhaseOrder", planPhaseOrder), + checkRequired("reason", reason), + additionalProperties.toImmutable(), + ) + } + + class AdjustmentType + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue + fun _value(): JsonField = value + + companion object { + + @JvmField val AMOUNT_DISCOUNT = of("amount_discount") + + @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) + } + + /** An enum containing [AdjustmentType]'s known values. */ + enum class Known { + AMOUNT_DISCOUNT, + } + + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + AMOUNT_DISCOUNT, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + AMOUNT_DISCOUNT -> Value.AMOUNT_DISCOUNT + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ + fun known(): Known = + when (this) { + AMOUNT_DISCOUNT -> Known.AMOUNT_DISCOUNT + else -> throw OrbInvalidDataException("Unknown AdjustmentType: $value") + } + + fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is AdjustmentType && 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 AmountDiscountAdjustment && id == other.id && adjustmentType == other.adjustmentType && amountDiscount == other.amountDiscount && appliesToPriceIds == other.appliesToPriceIds && isInvoiceLevel == other.isInvoiceLevel && planPhaseOrder == other.planPhaseOrder && reason == other.reason && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(id, adjustmentType, amountDiscount, appliesToPriceIds, isInvoiceLevel, planPhaseOrder, reason, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "AmountDiscountAdjustment{id=$id, adjustmentType=$adjustmentType, amountDiscount=$amountDiscount, appliesToPriceIds=$appliesToPriceIds, isInvoiceLevel=$isInvoiceLevel, planPhaseOrder=$planPhaseOrder, reason=$reason, additionalProperties=$additionalProperties}" + } + + @NoAutoDetect + class PercentageDiscountAdjustment + @JsonCreator + private constructor( + @JsonProperty("id") + @ExcludeMissing + private val id: JsonField = JsonMissing.of(), + @JsonProperty("adjustment_type") + @ExcludeMissing + private val adjustmentType: JsonField = JsonMissing.of(), + @JsonProperty("applies_to_price_ids") + @ExcludeMissing + private val appliesToPriceIds: JsonField> = JsonMissing.of(), + @JsonProperty("is_invoice_level") + @ExcludeMissing + private val isInvoiceLevel: JsonField = JsonMissing.of(), + @JsonProperty("percentage_discount") + @ExcludeMissing + private val percentageDiscount: JsonField = JsonMissing.of(), + @JsonProperty("plan_phase_order") + @ExcludeMissing + private val planPhaseOrder: JsonField = JsonMissing.of(), + @JsonProperty("reason") + @ExcludeMissing + private val reason: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { + + fun id(): String = id.getRequired("id") + + fun adjustmentType(): AdjustmentType = adjustmentType.getRequired("adjustment_type") + + /** The price IDs that this adjustment applies to. */ + fun appliesToPriceIds(): List = + appliesToPriceIds.getRequired("applies_to_price_ids") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** + * The percentage (as a value between 0 and 1) by which to discount the price + * intervals this adjustment applies to in a given billing period. + */ + fun percentageDiscount(): Double = + percentageDiscount.getRequired("percentage_discount") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + + /** The reason for the adjustment. */ + fun reason(): Optional = Optional.ofNullable(reason.getNullable("reason")) + + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + @JsonProperty("adjustment_type") + @ExcludeMissing + fun _adjustmentType(): JsonField = adjustmentType + + /** The price IDs that this adjustment applies to. */ + @JsonProperty("applies_to_price_ids") + @ExcludeMissing + fun _appliesToPriceIds(): JsonField> = appliesToPriceIds + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel(): JsonField = isInvoiceLevel + + /** + * The percentage (as a value between 0 and 1) by which to discount the price + * intervals this adjustment applies to in a given billing period. + */ + @JsonProperty("percentage_discount") + @ExcludeMissing + fun _percentageDiscount(): JsonField = percentageDiscount + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun _planPhaseOrder(): JsonField = planPhaseOrder + + /** The reason for the adjustment. */ + @JsonProperty("reason") @ExcludeMissing fun _reason(): JsonField = reason + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): PercentageDiscountAdjustment = apply { + if (validated) { + return@apply + } + + id() + adjustmentType() + appliesToPriceIds() + isInvoiceLevel() + percentageDiscount() + planPhaseOrder() + reason() + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + /** A builder for [PercentageDiscountAdjustment]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var adjustmentType: JsonField? = null + private var appliesToPriceIds: JsonField>? = null + private var isInvoiceLevel: JsonField? = null + private var percentageDiscount: JsonField? = null + private var planPhaseOrder: JsonField? = null + private var reason: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(percentageDiscountAdjustment: PercentageDiscountAdjustment) = + apply { + id = percentageDiscountAdjustment.id + adjustmentType = percentageDiscountAdjustment.adjustmentType + appliesToPriceIds = + percentageDiscountAdjustment.appliesToPriceIds.map { + it.toMutableList() + } + isInvoiceLevel = percentageDiscountAdjustment.isInvoiceLevel + percentageDiscount = percentageDiscountAdjustment.percentageDiscount + planPhaseOrder = percentageDiscountAdjustment.planPhaseOrder + reason = percentageDiscountAdjustment.reason + additionalProperties = + percentageDiscountAdjustment.additionalProperties.toMutableMap() + } + + fun id(id: String) = id(JsonField.of(id)) + + fun id(id: JsonField) = apply { this.id = id } + + fun adjustmentType(adjustmentType: AdjustmentType) = + adjustmentType(JsonField.of(adjustmentType)) + + fun adjustmentType(adjustmentType: JsonField) = apply { + this.adjustmentType = adjustmentType + } + + /** The price IDs that this adjustment applies to. */ + fun appliesToPriceIds(appliesToPriceIds: List) = + appliesToPriceIds(JsonField.of(appliesToPriceIds)) + + /** The price IDs that this adjustment applies to. */ + fun appliesToPriceIds(appliesToPriceIds: JsonField>) = apply { + this.appliesToPriceIds = appliesToPriceIds.map { it.toMutableList() } + } + + /** The price IDs that this adjustment applies to. */ + 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) + } + } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** + * The percentage (as a value between 0 and 1) by which to discount the price + * intervals this adjustment applies to in a given billing period. + */ + fun percentageDiscount(percentageDiscount: Double) = + percentageDiscount(JsonField.of(percentageDiscount)) + + /** + * The percentage (as a value between 0 and 1) by which to discount the price + * intervals this adjustment applies to in a given billing period. + */ + fun percentageDiscount(percentageDiscount: JsonField) = apply { + this.percentageDiscount = percentageDiscount + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long?) = + planPhaseOrder(JsonField.ofNullable(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = + planPhaseOrder(planPhaseOrder as Long?) + + /** The plan phase in which this adjustment is active. */ + @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 + fun planPhaseOrder(planPhaseOrder: Optional) = + planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + + /** The reason for the adjustment. */ + fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) + + /** The reason for the adjustment. */ + fun reason(reason: Optional) = reason(reason.orElse(null)) + + /** The reason for the adjustment. */ + fun reason(reason: JsonField) = apply { this.reason = reason } + + 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(): PercentageDiscountAdjustment = + PercentageDiscountAdjustment( + checkRequired("id", id), + checkRequired("adjustmentType", adjustmentType), + checkRequired("appliesToPriceIds", appliesToPriceIds).map { + it.toImmutable() + }, + checkRequired("isInvoiceLevel", isInvoiceLevel), + checkRequired("percentageDiscount", percentageDiscount), + checkRequired("planPhaseOrder", planPhaseOrder), + checkRequired("reason", reason), + additionalProperties.toImmutable(), + ) + } + + class AdjustmentType + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue + fun _value(): JsonField = value + + companion object { + + @JvmField val PERCENTAGE_DISCOUNT = of("percentage_discount") + + @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) + } + + /** An enum containing [AdjustmentType]'s known values. */ + enum class Known { + PERCENTAGE_DISCOUNT, + } + + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + PERCENTAGE_DISCOUNT, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + PERCENTAGE_DISCOUNT -> Value.PERCENTAGE_DISCOUNT + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ + fun known(): Known = + when (this) { + PERCENTAGE_DISCOUNT -> Known.PERCENTAGE_DISCOUNT + else -> throw OrbInvalidDataException("Unknown AdjustmentType: $value") + } + + fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is AdjustmentType && 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 PercentageDiscountAdjustment && id == other.id && adjustmentType == other.adjustmentType && appliesToPriceIds == other.appliesToPriceIds && isInvoiceLevel == other.isInvoiceLevel && percentageDiscount == other.percentageDiscount && planPhaseOrder == other.planPhaseOrder && reason == other.reason && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(id, adjustmentType, appliesToPriceIds, isInvoiceLevel, percentageDiscount, planPhaseOrder, reason, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "PercentageDiscountAdjustment{id=$id, adjustmentType=$adjustmentType, appliesToPriceIds=$appliesToPriceIds, isInvoiceLevel=$isInvoiceLevel, percentageDiscount=$percentageDiscount, planPhaseOrder=$planPhaseOrder, reason=$reason, additionalProperties=$additionalProperties}" + } + + @NoAutoDetect + class UsageDiscountAdjustment + @JsonCreator + private constructor( + @JsonProperty("id") + @ExcludeMissing + private val id: JsonField = JsonMissing.of(), + @JsonProperty("adjustment_type") + @ExcludeMissing + private val adjustmentType: JsonField = JsonMissing.of(), + @JsonProperty("applies_to_price_ids") + @ExcludeMissing + private val appliesToPriceIds: JsonField> = JsonMissing.of(), + @JsonProperty("is_invoice_level") + @ExcludeMissing + private val isInvoiceLevel: JsonField = JsonMissing.of(), + @JsonProperty("plan_phase_order") + @ExcludeMissing + private val planPhaseOrder: JsonField = JsonMissing.of(), + @JsonProperty("reason") + @ExcludeMissing + private val reason: JsonField = JsonMissing.of(), + @JsonProperty("usage_discount") + @ExcludeMissing + private val usageDiscount: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { + + fun id(): String = id.getRequired("id") + + fun adjustmentType(): AdjustmentType = adjustmentType.getRequired("adjustment_type") + + /** The price IDs that this adjustment applies to. */ + fun appliesToPriceIds(): List = + appliesToPriceIds.getRequired("applies_to_price_ids") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + + /** The reason for the adjustment. */ + fun reason(): Optional = Optional.ofNullable(reason.getNullable("reason")) + + /** + * The number of usage units by which to discount the price this adjustment applies + * to in a given billing period. + */ + fun usageDiscount(): Double = usageDiscount.getRequired("usage_discount") + + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + @JsonProperty("adjustment_type") + @ExcludeMissing + fun _adjustmentType(): JsonField = adjustmentType + + /** The price IDs that this adjustment applies to. */ + @JsonProperty("applies_to_price_ids") + @ExcludeMissing + fun _appliesToPriceIds(): JsonField> = appliesToPriceIds + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel(): JsonField = isInvoiceLevel + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun _planPhaseOrder(): JsonField = planPhaseOrder + + /** The reason for the adjustment. */ + @JsonProperty("reason") @ExcludeMissing fun _reason(): JsonField = reason + + /** + * The number of usage units by which to discount the price this adjustment applies + * to in a given billing period. + */ + @JsonProperty("usage_discount") + @ExcludeMissing + fun _usageDiscount(): JsonField = usageDiscount + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): UsageDiscountAdjustment = apply { + if (validated) { + return@apply + } + + id() + adjustmentType() + appliesToPriceIds() + isInvoiceLevel() + planPhaseOrder() + reason() + usageDiscount() + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + /** A builder for [UsageDiscountAdjustment]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var adjustmentType: JsonField? = null + private var appliesToPriceIds: JsonField>? = null + private var isInvoiceLevel: JsonField? = null + private var planPhaseOrder: JsonField? = null + private var reason: JsonField? = null + private var usageDiscount: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(usageDiscountAdjustment: UsageDiscountAdjustment) = apply { + id = usageDiscountAdjustment.id + adjustmentType = usageDiscountAdjustment.adjustmentType + appliesToPriceIds = + usageDiscountAdjustment.appliesToPriceIds.map { it.toMutableList() } + isInvoiceLevel = usageDiscountAdjustment.isInvoiceLevel + planPhaseOrder = usageDiscountAdjustment.planPhaseOrder + reason = usageDiscountAdjustment.reason + usageDiscount = usageDiscountAdjustment.usageDiscount + additionalProperties = + usageDiscountAdjustment.additionalProperties.toMutableMap() + } + + fun id(id: String) = id(JsonField.of(id)) + + fun id(id: JsonField) = apply { this.id = id } + + fun adjustmentType(adjustmentType: AdjustmentType) = + adjustmentType(JsonField.of(adjustmentType)) + + fun adjustmentType(adjustmentType: JsonField) = apply { + this.adjustmentType = adjustmentType + } + + /** The price IDs that this adjustment applies to. */ + fun appliesToPriceIds(appliesToPriceIds: List) = + appliesToPriceIds(JsonField.of(appliesToPriceIds)) + + /** The price IDs that this adjustment applies to. */ + fun appliesToPriceIds(appliesToPriceIds: JsonField>) = apply { + this.appliesToPriceIds = appliesToPriceIds.map { it.toMutableList() } + } + + /** The price IDs that this adjustment applies to. */ + 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) + } + } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long?) = + planPhaseOrder(JsonField.ofNullable(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = + planPhaseOrder(planPhaseOrder as Long?) + + /** The plan phase in which this adjustment is active. */ + @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 + fun planPhaseOrder(planPhaseOrder: Optional) = + planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + + /** The reason for the adjustment. */ + fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) + + /** The reason for the adjustment. */ + fun reason(reason: Optional) = reason(reason.orElse(null)) + + /** The reason for the adjustment. */ + fun reason(reason: JsonField) = apply { this.reason = reason } + + /** + * The number of usage units by which to discount the price this adjustment + * applies to in a given billing period. + */ + fun usageDiscount(usageDiscount: Double) = + usageDiscount(JsonField.of(usageDiscount)) + + /** + * The number of usage units by which to discount the price this adjustment + * applies to in a given billing period. + */ + fun usageDiscount(usageDiscount: JsonField) = apply { + this.usageDiscount = usageDiscount + } + + 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(): UsageDiscountAdjustment = + UsageDiscountAdjustment( + checkRequired("id", id), + checkRequired("adjustmentType", adjustmentType), + checkRequired("appliesToPriceIds", appliesToPriceIds).map { + it.toImmutable() + }, + checkRequired("isInvoiceLevel", isInvoiceLevel), + checkRequired("planPhaseOrder", planPhaseOrder), + checkRequired("reason", reason), + checkRequired("usageDiscount", usageDiscount), + additionalProperties.toImmutable(), + ) + } + + class AdjustmentType + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue + fun _value(): JsonField = value + + companion object { + + @JvmField val USAGE_DISCOUNT = of("usage_discount") + + @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) + } + + /** An enum containing [AdjustmentType]'s known values. */ + enum class Known { + USAGE_DISCOUNT, + } + + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + USAGE_DISCOUNT, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + USAGE_DISCOUNT -> Value.USAGE_DISCOUNT + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ + fun known(): Known = + when (this) { + USAGE_DISCOUNT -> Known.USAGE_DISCOUNT + else -> throw OrbInvalidDataException("Unknown AdjustmentType: $value") + } + + fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is AdjustmentType && 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 UsageDiscountAdjustment && id == other.id && adjustmentType == other.adjustmentType && appliesToPriceIds == other.appliesToPriceIds && isInvoiceLevel == other.isInvoiceLevel && planPhaseOrder == other.planPhaseOrder && reason == other.reason && usageDiscount == other.usageDiscount && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(id, adjustmentType, appliesToPriceIds, isInvoiceLevel, planPhaseOrder, reason, usageDiscount, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "UsageDiscountAdjustment{id=$id, adjustmentType=$adjustmentType, appliesToPriceIds=$appliesToPriceIds, isInvoiceLevel=$isInvoiceLevel, planPhaseOrder=$planPhaseOrder, reason=$reason, usageDiscount=$usageDiscount, additionalProperties=$additionalProperties}" + } + + @NoAutoDetect + class MinimumAdjustment + @JsonCreator + private constructor( + @JsonProperty("id") + @ExcludeMissing + private val id: JsonField = JsonMissing.of(), + @JsonProperty("adjustment_type") + @ExcludeMissing + private val adjustmentType: JsonField = JsonMissing.of(), + @JsonProperty("applies_to_price_ids") + @ExcludeMissing + private val appliesToPriceIds: JsonField> = JsonMissing.of(), + @JsonProperty("is_invoice_level") + @ExcludeMissing + private val isInvoiceLevel: JsonField = JsonMissing.of(), + @JsonProperty("item_id") + @ExcludeMissing + private val itemId: JsonField = JsonMissing.of(), + @JsonProperty("minimum_amount") + @ExcludeMissing + private val minimumAmount: JsonField = JsonMissing.of(), + @JsonProperty("plan_phase_order") + @ExcludeMissing + private val planPhaseOrder: JsonField = JsonMissing.of(), + @JsonProperty("reason") + @ExcludeMissing + private val reason: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { + + fun id(): String = id.getRequired("id") + + fun adjustmentType(): AdjustmentType = adjustmentType.getRequired("adjustment_type") + + /** The price IDs that this adjustment applies to. */ + fun appliesToPriceIds(): List = + appliesToPriceIds.getRequired("applies_to_price_ids") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** The item ID that revenue from this minimum will be attributed to. */ + fun itemId(): String = itemId.getRequired("item_id") + + /** + * The minimum amount to charge in a given billing period for the prices this + * adjustment applies to. + */ + fun minimumAmount(): String = minimumAmount.getRequired("minimum_amount") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + + /** The reason for the adjustment. */ + fun reason(): Optional = Optional.ofNullable(reason.getNullable("reason")) + + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + @JsonProperty("adjustment_type") + @ExcludeMissing + fun _adjustmentType(): JsonField = adjustmentType + + /** The price IDs that this adjustment applies to. */ + @JsonProperty("applies_to_price_ids") + @ExcludeMissing + fun _appliesToPriceIds(): JsonField> = appliesToPriceIds + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel(): JsonField = isInvoiceLevel + + /** The item ID that revenue from this minimum will be attributed to. */ + @JsonProperty("item_id") @ExcludeMissing fun _itemId(): JsonField = itemId + + /** + * The minimum amount to charge in a given billing period for the prices this + * adjustment applies to. + */ + @JsonProperty("minimum_amount") + @ExcludeMissing + fun _minimumAmount(): JsonField = minimumAmount + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun _planPhaseOrder(): JsonField = planPhaseOrder + + /** The reason for the adjustment. */ + @JsonProperty("reason") @ExcludeMissing fun _reason(): JsonField = reason + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): MinimumAdjustment = apply { + if (validated) { + return@apply + } + + id() + adjustmentType() + appliesToPriceIds() + isInvoiceLevel() + itemId() + minimumAmount() + planPhaseOrder() + reason() + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + /** A builder for [MinimumAdjustment]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var adjustmentType: JsonField? = null + private var appliesToPriceIds: JsonField>? = null + private var isInvoiceLevel: JsonField? = null + private var itemId: JsonField? = null + private var minimumAmount: JsonField? = null + private var planPhaseOrder: JsonField? = null + private var reason: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(minimumAdjustment: MinimumAdjustment) = apply { + id = minimumAdjustment.id + adjustmentType = minimumAdjustment.adjustmentType + appliesToPriceIds = + minimumAdjustment.appliesToPriceIds.map { it.toMutableList() } + isInvoiceLevel = minimumAdjustment.isInvoiceLevel + itemId = minimumAdjustment.itemId + minimumAmount = minimumAdjustment.minimumAmount + planPhaseOrder = minimumAdjustment.planPhaseOrder + reason = minimumAdjustment.reason + additionalProperties = minimumAdjustment.additionalProperties.toMutableMap() + } + + fun id(id: String) = id(JsonField.of(id)) + + fun id(id: JsonField) = apply { this.id = id } + + fun adjustmentType(adjustmentType: AdjustmentType) = + adjustmentType(JsonField.of(adjustmentType)) + + fun adjustmentType(adjustmentType: JsonField) = apply { + this.adjustmentType = adjustmentType + } + + /** The price IDs that this adjustment applies to. */ + fun appliesToPriceIds(appliesToPriceIds: List) = + appliesToPriceIds(JsonField.of(appliesToPriceIds)) + + /** The price IDs that this adjustment applies to. */ + fun appliesToPriceIds(appliesToPriceIds: JsonField>) = apply { + this.appliesToPriceIds = appliesToPriceIds.map { it.toMutableList() } + } + + /** The price IDs that this adjustment applies to. */ + 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) + } + } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** The item ID that revenue from this minimum will be attributed to. */ + fun itemId(itemId: String) = itemId(JsonField.of(itemId)) + + /** The item ID that revenue from this minimum will be attributed to. */ + fun itemId(itemId: JsonField) = apply { this.itemId = itemId } + + /** + * The minimum amount to charge in a given billing period for the prices this + * adjustment applies to. + */ + fun minimumAmount(minimumAmount: String) = + minimumAmount(JsonField.of(minimumAmount)) + + /** + * The minimum amount to charge in a given billing period for the prices this + * adjustment applies to. + */ + fun minimumAmount(minimumAmount: JsonField) = apply { + this.minimumAmount = minimumAmount + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long?) = + planPhaseOrder(JsonField.ofNullable(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = + planPhaseOrder(planPhaseOrder as Long?) + + /** The plan phase in which this adjustment is active. */ + @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 + fun planPhaseOrder(planPhaseOrder: Optional) = + planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + + /** The reason for the adjustment. */ + fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) + + /** The reason for the adjustment. */ + fun reason(reason: Optional) = reason(reason.orElse(null)) + + /** The reason for the adjustment. */ + fun reason(reason: JsonField) = apply { this.reason = reason } + + 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(): MinimumAdjustment = + MinimumAdjustment( + checkRequired("id", id), + checkRequired("adjustmentType", adjustmentType), + checkRequired("appliesToPriceIds", appliesToPriceIds).map { + it.toImmutable() + }, + checkRequired("isInvoiceLevel", isInvoiceLevel), + checkRequired("itemId", itemId), + checkRequired("minimumAmount", minimumAmount), + checkRequired("planPhaseOrder", planPhaseOrder), + checkRequired("reason", reason), + additionalProperties.toImmutable(), + ) + } + + class AdjustmentType + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue + fun _value(): JsonField = value + + companion object { + + @JvmField val MINIMUM = of("minimum") + + @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) + } + + /** An enum containing [AdjustmentType]'s known values. */ + enum class Known { + MINIMUM, + } + + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + MINIMUM, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + MINIMUM -> Value.MINIMUM + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ + fun known(): Known = + when (this) { + MINIMUM -> Known.MINIMUM + else -> throw OrbInvalidDataException("Unknown AdjustmentType: $value") + } + + fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is AdjustmentType && 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 MinimumAdjustment && id == other.id && adjustmentType == other.adjustmentType && appliesToPriceIds == other.appliesToPriceIds && isInvoiceLevel == other.isInvoiceLevel && itemId == other.itemId && minimumAmount == other.minimumAmount && planPhaseOrder == other.planPhaseOrder && reason == other.reason && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(id, adjustmentType, appliesToPriceIds, isInvoiceLevel, itemId, minimumAmount, planPhaseOrder, reason, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "MinimumAdjustment{id=$id, adjustmentType=$adjustmentType, appliesToPriceIds=$appliesToPriceIds, isInvoiceLevel=$isInvoiceLevel, itemId=$itemId, minimumAmount=$minimumAmount, planPhaseOrder=$planPhaseOrder, reason=$reason, additionalProperties=$additionalProperties}" + } + + @NoAutoDetect + class MaximumAdjustment + @JsonCreator + private constructor( + @JsonProperty("id") + @ExcludeMissing + private val id: JsonField = JsonMissing.of(), + @JsonProperty("adjustment_type") + @ExcludeMissing + private val adjustmentType: JsonField = JsonMissing.of(), + @JsonProperty("applies_to_price_ids") + @ExcludeMissing + private val appliesToPriceIds: JsonField> = JsonMissing.of(), + @JsonProperty("is_invoice_level") + @ExcludeMissing + private val isInvoiceLevel: JsonField = JsonMissing.of(), + @JsonProperty("maximum_amount") + @ExcludeMissing + private val maximumAmount: JsonField = JsonMissing.of(), + @JsonProperty("plan_phase_order") + @ExcludeMissing + private val planPhaseOrder: JsonField = JsonMissing.of(), + @JsonProperty("reason") + @ExcludeMissing + private val reason: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { + + fun id(): String = id.getRequired("id") + + fun adjustmentType(): AdjustmentType = adjustmentType.getRequired("adjustment_type") + + /** The price IDs that this adjustment applies to. */ + fun appliesToPriceIds(): List = + appliesToPriceIds.getRequired("applies_to_price_ids") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** + * The maximum amount to charge in a given billing period for the prices this + * adjustment applies to. + */ + fun maximumAmount(): String = maximumAmount.getRequired("maximum_amount") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + + /** The reason for the adjustment. */ + fun reason(): Optional = Optional.ofNullable(reason.getNullable("reason")) + + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + @JsonProperty("adjustment_type") + @ExcludeMissing + fun _adjustmentType(): JsonField = adjustmentType + + /** The price IDs that this adjustment applies to. */ + @JsonProperty("applies_to_price_ids") + @ExcludeMissing + fun _appliesToPriceIds(): JsonField> = appliesToPriceIds + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel(): JsonField = isInvoiceLevel + + /** + * The maximum amount to charge in a given billing period for the prices this + * adjustment applies to. + */ + @JsonProperty("maximum_amount") + @ExcludeMissing + fun _maximumAmount(): JsonField = maximumAmount + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun _planPhaseOrder(): JsonField = planPhaseOrder + + /** The reason for the adjustment. */ + @JsonProperty("reason") @ExcludeMissing fun _reason(): JsonField = reason + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): MaximumAdjustment = apply { + if (validated) { + return@apply + } + + id() + adjustmentType() + appliesToPriceIds() + isInvoiceLevel() + maximumAmount() + planPhaseOrder() + reason() + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + /** A builder for [MaximumAdjustment]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var adjustmentType: JsonField? = null + private var appliesToPriceIds: JsonField>? = null + private var isInvoiceLevel: JsonField? = null + private var maximumAmount: JsonField? = null + private var planPhaseOrder: JsonField? = null + private var reason: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(maximumAdjustment: MaximumAdjustment) = apply { + id = maximumAdjustment.id + adjustmentType = maximumAdjustment.adjustmentType + appliesToPriceIds = + maximumAdjustment.appliesToPriceIds.map { it.toMutableList() } + isInvoiceLevel = maximumAdjustment.isInvoiceLevel + maximumAmount = maximumAdjustment.maximumAmount + planPhaseOrder = maximumAdjustment.planPhaseOrder + reason = maximumAdjustment.reason + additionalProperties = maximumAdjustment.additionalProperties.toMutableMap() + } + + fun id(id: String) = id(JsonField.of(id)) + + fun id(id: JsonField) = apply { this.id = id } + + fun adjustmentType(adjustmentType: AdjustmentType) = + adjustmentType(JsonField.of(adjustmentType)) + + fun adjustmentType(adjustmentType: JsonField) = apply { + this.adjustmentType = adjustmentType + } + + /** The price IDs that this adjustment applies to. */ + fun appliesToPriceIds(appliesToPriceIds: List) = + appliesToPriceIds(JsonField.of(appliesToPriceIds)) + + /** The price IDs that this adjustment applies to. */ + fun appliesToPriceIds(appliesToPriceIds: JsonField>) = apply { + this.appliesToPriceIds = appliesToPriceIds.map { it.toMutableList() } + } + + /** The price IDs that this adjustment applies to. */ + 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) + } + } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** + * The maximum amount to charge in a given billing period for the prices this + * adjustment applies to. + */ + fun maximumAmount(maximumAmount: String) = + maximumAmount(JsonField.of(maximumAmount)) + + /** + * The maximum amount to charge in a given billing period for the prices this + * adjustment applies to. + */ + fun maximumAmount(maximumAmount: JsonField) = apply { + this.maximumAmount = maximumAmount + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long?) = + planPhaseOrder(JsonField.ofNullable(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = + planPhaseOrder(planPhaseOrder as Long?) + + /** The plan phase in which this adjustment is active. */ + @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 + fun planPhaseOrder(planPhaseOrder: Optional) = + planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + + /** The reason for the adjustment. */ + fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) + + /** The reason for the adjustment. */ + fun reason(reason: Optional) = reason(reason.orElse(null)) + + /** The reason for the adjustment. */ + fun reason(reason: JsonField) = apply { this.reason = reason } + + 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(): MaximumAdjustment = + MaximumAdjustment( + checkRequired("id", id), + checkRequired("adjustmentType", adjustmentType), + checkRequired("appliesToPriceIds", appliesToPriceIds).map { + it.toImmutable() + }, + checkRequired("isInvoiceLevel", isInvoiceLevel), + checkRequired("maximumAmount", maximumAmount), + checkRequired("planPhaseOrder", planPhaseOrder), + checkRequired("reason", reason), + additionalProperties.toImmutable(), + ) + } + + class AdjustmentType + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue + fun _value(): JsonField = value + + companion object { + + @JvmField val MAXIMUM = of("maximum") + + @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) + } + + /** An enum containing [AdjustmentType]'s known values. */ + enum class Known { + MAXIMUM, + } + + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + MAXIMUM, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + MAXIMUM -> Value.MAXIMUM + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ + fun known(): Known = + when (this) { + MAXIMUM -> Known.MAXIMUM + else -> throw OrbInvalidDataException("Unknown AdjustmentType: $value") + } + + fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is AdjustmentType && 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 MaximumAdjustment && id == other.id && adjustmentType == other.adjustmentType && appliesToPriceIds == other.appliesToPriceIds && isInvoiceLevel == other.isInvoiceLevel && maximumAmount == other.maximumAmount && planPhaseOrder == other.planPhaseOrder && reason == other.reason && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(id, adjustmentType, appliesToPriceIds, isInvoiceLevel, maximumAmount, planPhaseOrder, reason, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "MaximumAdjustment{id=$id, adjustmentType=$adjustmentType, appliesToPriceIds=$appliesToPriceIds, isInvoiceLevel=$isInvoiceLevel, maximumAmount=$maximumAmount, planPhaseOrder=$planPhaseOrder, reason=$reason, additionalProperties=$additionalProperties}" + } + } + + /** This field is deprecated in favor of `adjustments`. */ + @Deprecated("deprecated") + @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() + } + + /** A builder for [Maximum]. */ + class Builder internal constructor() { + + 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) = @@ -5626,6 +8232,8 @@ private constructor( "Maximum{appliesToPriceIds=$appliesToPriceIds, maximumAmount=$maximumAmount, additionalProperties=$additionalProperties}" } + /** This field is deprecated in favor of `adjustments`. */ + @Deprecated("deprecated") @NoAutoDetect class Minimum @JsonCreator @@ -5686,7 +8294,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Minimum]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var minimumAmount: JsonField? = null @@ -5882,6 +8491,10 @@ private constructor( @JvmStatic fun ofOther(other: OtherSubLineItem) = SubLineItem(other = other) } + /** + * An interface that defines how to map each variant of [SubLineItem] to a value of type + * [T]. + */ interface Visitor { fun visitMatrix(matrix: MatrixSubLineItem): T @@ -5890,12 +8503,22 @@ private constructor( fun visitOther(other: OtherSubLineItem): T + /** + * Maps an unknown variant of [SubLineItem] to a value of type [T]. + * + * An instance of [SubLineItem] can contain an unknown variant if it was + * deserialized from data that doesn't match any known variant. For example, if the + * SDK is on an older version than the API, then the API may respond with new + * variants that the SDK is unaware of. + * + * @throws OrbInvalidDataException in the default implementation. + */ fun unknown(json: JsonValue?): T { throw OrbInvalidDataException("Unknown SubLineItem: $json") } } - class Deserializer : BaseDeserializer(SubLineItem::class) { + internal class Deserializer : BaseDeserializer(SubLineItem::class) { override fun ObjectCodec.deserialize(node: JsonNode): SubLineItem { val json = JsonValue.fromJsonNode(node) @@ -5932,7 +8555,7 @@ private constructor( } } - class Serializer : BaseSerializer(SubLineItem::class) { + internal class Serializer : BaseSerializer(SubLineItem::class) { override fun serialize( value: SubLineItem, @@ -6035,7 +8658,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MatrixSubLineItem]. */ + class Builder internal constructor() { private var amount: JsonField? = null private var grouping: JsonField? = null @@ -6168,7 +8792,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Grouping]. */ + class Builder internal constructor() { private var key: JsonField? = null private var value: JsonField? = null @@ -6285,7 +8910,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MatrixConfig]. */ + class Builder internal constructor() { private var dimensionValues: JsonField>? = null private var additionalProperties: MutableMap = @@ -6376,6 +9002,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -6386,21 +9020,51 @@ private constructor( @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } + /** An enum containing [Type]'s known values. */ enum class Known { MATRIX, } + /** + * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Type] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { MATRIX, + /** + * An enum member indicating that [Type] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { MATRIX -> Value.MATRIX else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { MATRIX -> Known.MATRIX @@ -6526,7 +9190,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TierSubLineItem]. */ + class Builder internal constructor() { private var amount: JsonField? = null private var grouping: JsonField? = null @@ -6658,7 +9323,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Grouping]. */ + class Builder internal constructor() { private var key: JsonField? = null private var value: JsonField? = null @@ -6793,7 +9459,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TierConfig]. */ + class Builder internal constructor() { private var firstUnit: JsonField? = null private var lastUnit: JsonField? = null @@ -6890,6 +9557,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -6900,21 +9575,51 @@ private constructor( @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } + /** An enum containing [Type]'s known values. */ enum class Known { TIER, } + /** + * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Type] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { TIER, + /** + * An enum member indicating that [Type] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { TIER -> Value.TIER else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { TIER -> Known.TIER @@ -7030,7 +9735,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [OtherSubLineItem]. */ + class Builder internal constructor() { private var amount: JsonField? = null private var grouping: JsonField? = null @@ -7153,7 +9859,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Grouping]. */ + class Builder internal constructor() { private var key: JsonField? = null private var value: JsonField? = null @@ -7234,6 +9941,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -7244,21 +9959,51 @@ private constructor( @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } + /** An enum containing [Type]'s known values. */ enum class Known { NULL, } + /** + * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Type] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { NULL, + /** + * An enum member indicating that [Type] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { NULL -> Value.NULL else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { NULL -> Known.NULL @@ -7364,7 +10109,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TaxAmount]. */ + class Builder internal constructor() { private var amount: JsonField? = null private var taxRateDescription: JsonField? = null @@ -7461,17 +10207,17 @@ private constructor( return true } - return /* spotless:off */ other is LineItem && id == other.id && amount == other.amount && discount == other.discount && endDate == other.endDate && grouping == other.grouping && maximum == other.maximum && maximumAmount == other.maximumAmount && minimum == other.minimum && minimumAmount == other.minimumAmount && name == other.name && price == other.price && quantity == other.quantity && startDate == other.startDate && subLineItems == other.subLineItems && subtotal == other.subtotal && taxAmounts == other.taxAmounts && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is LineItem && id == other.id && adjustedSubtotal == other.adjustedSubtotal && adjustments == other.adjustments && amount == other.amount && creditsApplied == other.creditsApplied && discount == other.discount && endDate == other.endDate && grouping == other.grouping && maximum == other.maximum && maximumAmount == other.maximumAmount && minimum == other.minimum && minimumAmount == other.minimumAmount && name == other.name && partiallyInvoicedAmount == other.partiallyInvoicedAmount && price == other.price && quantity == other.quantity && startDate == other.startDate && subLineItems == other.subLineItems && subtotal == other.subtotal && taxAmounts == other.taxAmounts && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, amount, discount, endDate, grouping, maximum, maximumAmount, minimum, minimumAmount, name, price, quantity, startDate, subLineItems, subtotal, taxAmounts, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, adjustedSubtotal, adjustments, amount, creditsApplied, discount, endDate, grouping, maximum, maximumAmount, minimum, minimumAmount, name, partiallyInvoicedAmount, price, quantity, startDate, subLineItems, subtotal, taxAmounts, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "LineItem{id=$id, amount=$amount, discount=$discount, endDate=$endDate, grouping=$grouping, maximum=$maximum, maximumAmount=$maximumAmount, minimum=$minimum, minimumAmount=$minimumAmount, name=$name, price=$price, quantity=$quantity, startDate=$startDate, subLineItems=$subLineItems, subtotal=$subtotal, taxAmounts=$taxAmounts, additionalProperties=$additionalProperties}" + "LineItem{id=$id, adjustedSubtotal=$adjustedSubtotal, adjustments=$adjustments, amount=$amount, creditsApplied=$creditsApplied, discount=$discount, endDate=$endDate, grouping=$grouping, maximum=$maximum, maximumAmount=$maximumAmount, minimum=$minimum, minimumAmount=$minimumAmount, name=$name, partiallyInvoicedAmount=$partiallyInvoicedAmount, price=$price, quantity=$quantity, startDate=$startDate, subLineItems=$subLineItems, subtotal=$subtotal, taxAmounts=$taxAmounts, additionalProperties=$additionalProperties}" } @NoAutoDetect @@ -7534,7 +10280,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Maximum]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var maximumAmount: JsonField? = null @@ -7666,7 +10413,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -7774,7 +10522,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Minimum]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var minimumAmount: JsonField? = null @@ -7967,7 +10716,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [PaymentAttempt]. */ + class Builder internal constructor() { private var id: JsonField? = null private var amount: JsonField? = null @@ -8078,6 +10828,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -8087,21 +10845,51 @@ private constructor( @JvmStatic fun of(value: String) = PaymentProvider(JsonField.of(value)) } + /** An enum containing [PaymentProvider]'s known values. */ enum class Known { STRIPE, } + /** + * An enum containing [PaymentProvider]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [PaymentProvider] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { STRIPE, + /** + * An enum member indicating that [PaymentProvider] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { STRIPE -> Value.STRIPE else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { STRIPE -> Known.STRIPE @@ -8221,7 +11009,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [ShippingAddress]. */ + class Builder internal constructor() { private var city: JsonField? = null private var country: JsonField? = null @@ -8333,6 +11122,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -8350,6 +11147,7 @@ private constructor( @JvmStatic fun of(value: String) = Status(JsonField.of(value)) } + /** An enum containing [Status]'s known values. */ enum class Known { ISSUED, PAID, @@ -8358,15 +11156,32 @@ private constructor( DRAFT, } + /** + * An enum containing [Status]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Status] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ISSUED, PAID, SYNCED, VOID, DRAFT, + /** An enum member indicating that [Status] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { ISSUED -> Value.ISSUED @@ -8377,6 +11192,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { ISSUED -> Known.ISSUED @@ -8437,7 +11260,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Subscription]. */ + class Builder internal constructor() { private var id: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceCreateParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceCreateParams.kt index e08b2082..c727016d 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceCreateParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceCreateParams.kt @@ -12,6 +12,7 @@ import com.withorb.api.core.JsonField import com.withorb.api.core.JsonMissing import com.withorb.api.core.JsonValue import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -25,11 +26,11 @@ import java.util.Optional /** This endpoint is used to create a one-off invoice for a customer. */ class InvoiceCreateParams -constructor( +private constructor( private val body: InvoiceCreateBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { /** An ISO 4217 currency string. Must be the same as the customer's currency if it is set. */ fun currency(): String = body.currency() @@ -135,11 +136,11 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getBody(): InvoiceCreateBody = body + @JvmSynthetic internal fun _body(): InvoiceCreateBody = body - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams @NoAutoDetect class InvoiceCreateBody @@ -325,7 +326,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoiceCreateBody]. */ + class Builder internal constructor() { private var currency: JsonField? = null private var invoiceDate: JsonField? = null @@ -449,6 +451,15 @@ constructor( /** An optional discount to attach to the invoice. */ fun discount(trial: TrialDiscount) = discount(Discount.ofTrial(trial)) + /** An optional discount to attach to the invoice. */ + fun trialDiscount(appliesToPriceIds: List) = + discount( + TrialDiscount.builder() + .discountType(TrialDiscount.DiscountType.TRIAL) + .appliesToPriceIds(appliesToPriceIds) + .build() + ) + /** An optional discount to attach to the invoice. */ fun discount(usage: Discount.UsageDiscount) = discount(Discount.ofUsage(usage)) @@ -581,8 +592,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [InvoiceCreateParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var body: InvoiceCreateBody.Builder = InvoiceCreateBody.builder() private var additionalHeaders: Headers.Builder = Headers.builder() @@ -672,6 +684,11 @@ constructor( /** An optional discount to attach to the invoice. */ fun discount(trial: TrialDiscount) = apply { body.discount(trial) } + /** An optional discount to attach to the invoice. */ + fun trialDiscount(appliesToPriceIds: List) = apply { + body.trialDiscount(appliesToPriceIds) + } + /** An optional discount to attach to the invoice. */ fun discount(usage: Discount.UsageDiscount) = apply { body.discount(usage) } @@ -969,7 +986,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [LineItem]. */ + class Builder internal constructor() { private var endDate: JsonField? = null private var itemId: JsonField? = null @@ -1068,6 +1086,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -1077,21 +1103,51 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { UNIT, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { UNIT, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { UNIT -> Value.UNIT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { UNIT -> Known.UNIT @@ -1154,7 +1210,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [UnitConfig]. */ + class Builder internal constructor() { private var unitAmount: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -1272,7 +1329,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() 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 3656e550..c2b4b28e 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 @@ -3,6 +3,7 @@ package com.withorb.api.models import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -10,11 +11,11 @@ import java.util.Objects /** This endpoint is used to fetch an [`Invoice`](/core-concepts#invoice) given an identifier. */ class InvoiceFetchParams -constructor( +private constructor( private val invoiceId: String, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun invoiceId(): String = invoiceId @@ -22,9 +23,9 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun getPathParam(index: Int): String { return when (index) { @@ -40,8 +41,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [InvoiceFetchParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var invoiceId: String? = null private var additionalHeaders: Headers.Builder = Headers.builder() 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 48316665..68b8d2a6 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 @@ -3,6 +3,7 @@ package com.withorb.api.models import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -13,11 +14,11 @@ import java.util.Objects * billing period given a subscription. */ class InvoiceFetchUpcomingParams -constructor( +private constructor( private val subscriptionId: String, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun subscriptionId(): String = subscriptionId @@ -25,10 +26,9 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic - internal fun getQueryParams(): QueryParams { + override fun _queryParams(): QueryParams { val queryParams = QueryParams.builder() this.subscriptionId.let { queryParams.put("subscription_id", listOf(it.toString())) } queryParams.putAll(additionalQueryParams) @@ -42,8 +42,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [InvoiceFetchUpcomingParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var subscriptionId: String? = null private var additionalHeaders: Headers.Builder = Headers.builder() 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 9b25cff7..bd92ad9c 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 @@ -795,7 +795,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoiceFetchUpcomingResponse]. */ + class Builder internal constructor() { private var id: JsonField? = null private var amountDue: JsonField? = null @@ -1348,6 +1349,14 @@ private constructor( fun addDiscount(trial: TrialDiscount) = addDiscount(InvoiceLevelDiscount.ofTrial(trial)) + fun addTrialDiscount(appliesToPriceIds: List) = + addDiscount( + TrialDiscount.builder() + .discountType(TrialDiscount.DiscountType.TRIAL) + .appliesToPriceIds(appliesToPriceIds) + .build() + ) + /** * When the invoice payment is due. The due date is null if the invoice is not yet * finalized. @@ -1932,7 +1941,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AutoCollection]. */ + class Builder internal constructor() { private var enabled: JsonField? = null private var nextAttemptAt: JsonField? = null @@ -2162,7 +2172,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingAddress]. */ + class Builder internal constructor() { private var city: JsonField? = null private var country: JsonField? = null @@ -2366,7 +2377,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CreditNote]. */ + class Builder internal constructor() { private var id: JsonField? = null private var creditNoteNumber: JsonField? = null @@ -2535,7 +2547,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Customer]. */ + class Builder internal constructor() { private var id: JsonField? = null private var externalCustomerId: JsonField? = null @@ -2748,7 +2761,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CustomerBalanceTransaction]. */ + class Builder internal constructor() { private var id: JsonField? = null private var action: JsonField? = null @@ -2901,6 +2915,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -2924,6 +2946,7 @@ private constructor( @JvmStatic fun of(value: String) = Action(JsonField.of(value)) } + /** An enum containing [Action]'s known values. */ enum class Known { APPLIED_TO_INVOICE, MANUAL_ADJUSTMENT, @@ -2935,6 +2958,15 @@ private constructor( OVERPAYMENT_REFUND, } + /** + * An enum containing [Action]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Action] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { APPLIED_TO_INVOICE, MANUAL_ADJUSTMENT, @@ -2944,9 +2976,19 @@ private constructor( CREDIT_NOTE_APPLIED, CREDIT_NOTE_VOIDED, OVERPAYMENT_REFUND, + /** + * An enum member indicating that [Action] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { APPLIED_TO_INVOICE -> Value.APPLIED_TO_INVOICE @@ -2960,6 +3002,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { APPLIED_TO_INVOICE -> Known.APPLIED_TO_INVOICE @@ -3027,7 +3078,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CreditNote]. */ + class Builder internal constructor() { private var id: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -3127,7 +3179,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Invoice]. */ + class Builder internal constructor() { private var id: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -3193,6 +3246,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -3204,17 +3265,35 @@ private constructor( @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } + /** An enum containing [Type]'s known values. */ enum class Known { INCREMENT, DECREMENT, } + /** + * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Type] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { INCREMENT, DECREMENT, + /** An enum member indicating that [Type] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { INCREMENT -> Value.INCREMENT @@ -3222,6 +3301,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { INCREMENT -> Known.INCREMENT @@ -3419,7 +3507,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CustomerTaxId]. */ + class Builder internal constructor() { private var country: JsonField? = null private var type: JsonField? = null @@ -3480,6 +3569,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -3643,6 +3740,7 @@ private constructor( @JvmStatic fun of(value: String) = Country(JsonField.of(value)) } + /** An enum containing [Country]'s known values. */ enum class Known { AD, AE, @@ -3724,6 +3822,15 @@ private constructor( ZA, } + /** + * An enum containing [Country]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Country] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { AD, AE, @@ -3803,9 +3910,19 @@ private constructor( VE, VN, ZA, + /** + * An enum member indicating that [Country] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { AD -> Value.AD @@ -3889,6 +4006,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { AD -> Known.AD @@ -3993,6 +4119,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -4142,6 +4276,7 @@ private constructor( @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } + /** An enum containing [Type]'s known values. */ enum class Known { AD_NRT, AE_TRN, @@ -4216,6 +4351,15 @@ private constructor( ZA_VAT, } + /** + * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Type] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { AD_NRT, AE_TRN, @@ -4288,9 +4432,17 @@ private constructor( VE_RIF, VN_TIN, ZA_VAT, + /** An enum member indicating that [Type] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { AD_NRT -> Value.AD_NRT @@ -4367,6 +4519,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { AD_NRT -> Known.AD_NRT @@ -4482,6 +4643,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -4495,19 +4664,40 @@ private constructor( @JvmStatic fun of(value: String) = InvoiceSource(JsonField.of(value)) } + /** An enum containing [InvoiceSource]'s known values. */ enum class Known { SUBSCRIPTION, PARTIAL, ONE_OFF, } + /** + * An enum containing [InvoiceSource]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [InvoiceSource] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { SUBSCRIPTION, PARTIAL, ONE_OFF, + /** + * An enum member indicating that [InvoiceSource] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { SUBSCRIPTION -> Value.SUBSCRIPTION @@ -4516,6 +4706,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { SUBSCRIPTION -> Known.SUBSCRIPTION @@ -4544,9 +4742,18 @@ private constructor( @JsonCreator private constructor( @JsonProperty("id") @ExcludeMissing private val id: JsonField = JsonMissing.of(), + @JsonProperty("adjusted_subtotal") + @ExcludeMissing + private val adjustedSubtotal: JsonField = JsonMissing.of(), + @JsonProperty("adjustments") + @ExcludeMissing + private val adjustments: JsonField> = JsonMissing.of(), @JsonProperty("amount") @ExcludeMissing private val amount: JsonField = JsonMissing.of(), + @JsonProperty("credits_applied") + @ExcludeMissing + private val creditsApplied: JsonField = JsonMissing.of(), @JsonProperty("discount") @ExcludeMissing private val discount: JsonField = JsonMissing.of(), @@ -4571,6 +4778,9 @@ private constructor( @JsonProperty("name") @ExcludeMissing private val name: JsonField = JsonMissing.of(), + @JsonProperty("partially_invoiced_amount") + @ExcludeMissing + private val partiallyInvoicedAmount: JsonField = JsonMissing.of(), @JsonProperty("price") @ExcludeMissing private val price: JsonField = JsonMissing.of(), @@ -4596,9 +4806,21 @@ private constructor( /** A unique ID for this line item. */ fun id(): String = id.getRequired("id") + /** + * The line amount after any adjustments, before overage conversion, credits and partial + * invoicing. + */ + fun adjustedSubtotal(): String = adjustedSubtotal.getRequired("adjusted_subtotal") + + /** All adjustments applied to the line item. */ + fun adjustments(): List = adjustments.getRequired("adjustments") + /** The final amount after any discounts or minimums. */ fun amount(): String = amount.getRequired("amount") + /** The number of credits used */ + fun creditsApplied(): String = creditsApplied.getRequired("credits_applied") + fun discount(): Optional = Optional.ofNullable(discount.getNullable("discount")) /** The end date of the range of time applied for this line item's price. */ @@ -4611,19 +4833,31 @@ private constructor( */ fun grouping(): Optional = Optional.ofNullable(grouping.getNullable("grouping")) + /** This field is deprecated in favor of `adjustments`. */ + @Deprecated("deprecated") fun maximum(): Optional = Optional.ofNullable(maximum.getNullable("maximum")) + /** This field is deprecated in favor of `adjustments`. */ + @Deprecated("deprecated") fun maximumAmount(): Optional = Optional.ofNullable(maximumAmount.getNullable("maximum_amount")) + /** This field is deprecated in favor of `adjustments`. */ + @Deprecated("deprecated") fun minimum(): Optional = Optional.ofNullable(minimum.getNullable("minimum")) + /** This field is deprecated in favor of `adjustments`. */ + @Deprecated("deprecated") fun minimumAmount(): Optional = Optional.ofNullable(minimumAmount.getNullable("minimum_amount")) /** The name of the price associated with this line item. */ fun name(): String = name.getRequired("name") + /** Any amount applied from a partial invoice */ + fun partiallyInvoicedAmount(): String = + partiallyInvoicedAmount.getRequired("partially_invoiced_amount") + /** * 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 @@ -4661,9 +4895,27 @@ private constructor( /** A unique ID for this line item. */ @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + /** + * The line amount after any adjustments, before overage conversion, credits and partial + * invoicing. + */ + @JsonProperty("adjusted_subtotal") + @ExcludeMissing + fun _adjustedSubtotal(): JsonField = adjustedSubtotal + + /** All adjustments applied to the line item. */ + @JsonProperty("adjustments") + @ExcludeMissing + fun _adjustments(): JsonField> = adjustments + /** The final amount after any discounts or minimums. */ @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount + /** The number of credits used */ + @JsonProperty("credits_applied") + @ExcludeMissing + fun _creditsApplied(): JsonField = creditsApplied + @JsonProperty("discount") @ExcludeMissing fun _discount(): JsonField = discount /** The end date of the range of time applied for this line item's price. */ @@ -4678,14 +4930,26 @@ private constructor( */ @JsonProperty("grouping") @ExcludeMissing fun _grouping(): JsonField = grouping - @JsonProperty("maximum") @ExcludeMissing fun _maximum(): JsonField = maximum + /** This field is deprecated in favor of `adjustments`. */ + @Deprecated("deprecated") + @JsonProperty("maximum") + @ExcludeMissing + fun _maximum(): JsonField = maximum + /** This field is deprecated in favor of `adjustments`. */ + @Deprecated("deprecated") @JsonProperty("maximum_amount") @ExcludeMissing fun _maximumAmount(): JsonField = maximumAmount - @JsonProperty("minimum") @ExcludeMissing fun _minimum(): JsonField = minimum + /** This field is deprecated in favor of `adjustments`. */ + @Deprecated("deprecated") + @JsonProperty("minimum") + @ExcludeMissing + fun _minimum(): JsonField = minimum + /** This field is deprecated in favor of `adjustments`. */ + @Deprecated("deprecated") @JsonProperty("minimum_amount") @ExcludeMissing fun _minimumAmount(): JsonField = minimumAmount @@ -4693,6 +4957,11 @@ private constructor( /** The name of the price associated with this line item. */ @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + /** Any amount applied from a partial invoice */ + @JsonProperty("partially_invoiced_amount") + @ExcludeMissing + fun _partiallyInvoicedAmount(): JsonField = partiallyInvoicedAmount + /** * 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 @@ -4745,7 +5014,10 @@ private constructor( } id() + adjustedSubtotal() + adjustments().forEach { it.validate() } amount() + creditsApplied() discount().ifPresent { it.validate() } endDate() grouping() @@ -4754,6 +5026,7 @@ private constructor( minimum().ifPresent { it.validate() } minimumAmount() name() + partiallyInvoicedAmount() price().ifPresent { it.validate() } quantity() startDate() @@ -4770,10 +5043,14 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [LineItem]. */ + class Builder internal constructor() { private var id: JsonField? = null + private var adjustedSubtotal: JsonField? = null + private var adjustments: JsonField>? = null private var amount: JsonField? = null + private var creditsApplied: JsonField? = null private var discount: JsonField? = null private var endDate: JsonField? = null private var grouping: JsonField? = null @@ -4782,6 +5059,7 @@ private constructor( private var minimum: JsonField? = null private var minimumAmount: JsonField? = null private var name: JsonField? = null + private var partiallyInvoicedAmount: JsonField? = null private var price: JsonField? = null private var quantity: JsonField? = null private var startDate: JsonField? = null @@ -4793,7 +5071,10 @@ private constructor( @JvmSynthetic internal fun from(lineItem: LineItem) = apply { id = lineItem.id + adjustedSubtotal = lineItem.adjustedSubtotal + adjustments = lineItem.adjustments.map { it.toMutableList() } amount = lineItem.amount + creditsApplied = lineItem.creditsApplied discount = lineItem.discount endDate = lineItem.endDate grouping = lineItem.grouping @@ -4802,6 +5083,7 @@ private constructor( minimum = lineItem.minimum minimumAmount = lineItem.minimumAmount name = lineItem.name + partiallyInvoicedAmount = lineItem.partiallyInvoicedAmount price = lineItem.price quantity = lineItem.quantity startDate = lineItem.startDate @@ -4817,12 +5099,78 @@ private constructor( /** A unique ID for this line item. */ fun id(id: JsonField) = apply { this.id = id } + /** + * The line amount after any adjustments, before overage conversion, credits and partial + * invoicing. + */ + fun adjustedSubtotal(adjustedSubtotal: String) = + adjustedSubtotal(JsonField.of(adjustedSubtotal)) + + /** + * The line amount after any adjustments, before overage conversion, credits and partial + * invoicing. + */ + fun adjustedSubtotal(adjustedSubtotal: JsonField) = apply { + this.adjustedSubtotal = adjustedSubtotal + } + + /** All adjustments applied to the line item. */ + fun adjustments(adjustments: List) = adjustments(JsonField.of(adjustments)) + + /** All adjustments applied to the line item. */ + fun adjustments(adjustments: JsonField>) = apply { + this.adjustments = adjustments.map { it.toMutableList() } + } + + /** All adjustments applied to the line item. */ + fun addAdjustment(adjustment: Adjustment) = apply { + adjustments = + (adjustments ?: JsonField.of(mutableListOf())).apply { + asKnown() + .orElseThrow { + IllegalStateException( + "Field was set to non-list type: ${javaClass.simpleName}" + ) + } + .add(adjustment) + } + } + + /** All adjustments applied to the line item. */ + fun addAdjustment(amountDiscount: Adjustment.AmountDiscountAdjustment) = + addAdjustment(Adjustment.ofAmountDiscount(amountDiscount)) + + /** All adjustments applied to the line item. */ + fun addAdjustment(percentageDiscount: Adjustment.PercentageDiscountAdjustment) = + addAdjustment(Adjustment.ofPercentageDiscount(percentageDiscount)) + + /** All adjustments applied to the line item. */ + fun addAdjustment(usageDiscount: Adjustment.UsageDiscountAdjustment) = + addAdjustment(Adjustment.ofUsageDiscount(usageDiscount)) + + /** All adjustments applied to the line item. */ + fun addAdjustment(minimum: Adjustment.MinimumAdjustment) = + addAdjustment(Adjustment.ofMinimum(minimum)) + + /** All adjustments applied to the line item. */ + fun addAdjustment(maximum: Adjustment.MaximumAdjustment) = + addAdjustment(Adjustment.ofMaximum(maximum)) + /** The final amount after any discounts or minimums. */ fun amount(amount: String) = amount(JsonField.of(amount)) /** The final amount after any discounts or minimums. */ fun amount(amount: JsonField) = apply { this.amount = amount } + /** The number of credits used */ + fun creditsApplied(creditsApplied: String) = + creditsApplied(JsonField.of(creditsApplied)) + + /** The number of credits used */ + fun creditsApplied(creditsApplied: JsonField) = apply { + this.creditsApplied = creditsApplied + } + fun discount(discount: Discount?) = discount(JsonField.ofNullable(discount)) fun discount(discount: Optional) = discount(discount.orElse(null)) @@ -4834,6 +5182,14 @@ private constructor( fun discount(trial: TrialDiscount) = discount(Discount.ofTrial(trial)) + fun trialDiscount(appliesToPriceIds: List) = + discount( + TrialDiscount.builder() + .discountType(TrialDiscount.DiscountType.TRIAL) + .appliesToPriceIds(appliesToPriceIds) + .build() + ) + fun discount(usage: Discount.UsageDiscount) = discount(Discount.ofUsage(usage)) fun discount(amount: AmountDiscount) = discount(Discount.ofAmount(amount)) @@ -4865,34 +5221,58 @@ private constructor( */ fun grouping(grouping: JsonField) = apply { this.grouping = grouping } + /** This field is deprecated in favor of `adjustments`. */ + @Deprecated("deprecated") fun maximum(maximum: Maximum?) = maximum(JsonField.ofNullable(maximum)) + /** This field is deprecated in favor of `adjustments`. */ + @Deprecated("deprecated") fun maximum(maximum: Optional) = maximum(maximum.orElse(null)) + /** This field is deprecated in favor of `adjustments`. */ + @Deprecated("deprecated") fun maximum(maximum: JsonField) = apply { this.maximum = maximum } + /** This field is deprecated in favor of `adjustments`. */ + @Deprecated("deprecated") fun maximumAmount(maximumAmount: String?) = maximumAmount(JsonField.ofNullable(maximumAmount)) + /** This field is deprecated in favor of `adjustments`. */ + @Deprecated("deprecated") fun maximumAmount(maximumAmount: Optional) = maximumAmount(maximumAmount.orElse(null)) + /** This field is deprecated in favor of `adjustments`. */ + @Deprecated("deprecated") fun maximumAmount(maximumAmount: JsonField) = apply { this.maximumAmount = maximumAmount } + /** This field is deprecated in favor of `adjustments`. */ + @Deprecated("deprecated") fun minimum(minimum: Minimum?) = minimum(JsonField.ofNullable(minimum)) + /** This field is deprecated in favor of `adjustments`. */ + @Deprecated("deprecated") fun minimum(minimum: Optional) = minimum(minimum.orElse(null)) + /** This field is deprecated in favor of `adjustments`. */ + @Deprecated("deprecated") fun minimum(minimum: JsonField) = apply { this.minimum = minimum } + /** This field is deprecated in favor of `adjustments`. */ + @Deprecated("deprecated") fun minimumAmount(minimumAmount: String?) = minimumAmount(JsonField.ofNullable(minimumAmount)) + /** This field is deprecated in favor of `adjustments`. */ + @Deprecated("deprecated") fun minimumAmount(minimumAmount: Optional) = minimumAmount(minimumAmount.orElse(null)) + /** This field is deprecated in favor of `adjustments`. */ + @Deprecated("deprecated") fun minimumAmount(minimumAmount: JsonField) = apply { this.minimumAmount = minimumAmount } @@ -4903,6 +5283,15 @@ private constructor( /** The name of the price associated with this line item. */ fun name(name: JsonField) = apply { this.name = name } + /** Any amount applied from a partial invoice */ + fun partiallyInvoicedAmount(partiallyInvoicedAmount: String) = + partiallyInvoicedAmount(JsonField.of(partiallyInvoicedAmount)) + + /** Any amount applied from a partial invoice */ + fun partiallyInvoicedAmount(partiallyInvoicedAmount: JsonField) = apply { + this.partiallyInvoicedAmount = partiallyInvoicedAmount + } + /** * 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 @@ -5312,6 +5701,36 @@ private constructor( fun price(maxGroupTieredPackage: Price.MaxGroupTieredPackagePrice) = price(Price.ofMaxGroupTieredPackage(maxGroupTieredPackage)) + /** + * The Price resource represents a price that can be billed on a subscription, resulting + * in a charge on an invoice in the form of an invoice line item. Prices take a quantity + * and determine an amount to bill. + * + * Orb supports a few different pricing models out of the box. Each of these models is + * serialized differently in a given Price object. The model_type field determines the + * key for the configuration object that is present. + * + * For more on the types of prices, see + * [the core concepts documentation](/core-concepts#plan-and-price) + */ + fun price(scalableMatrixWithUnitPricing: Price.ScalableMatrixWithUnitPricingPrice) = + price(Price.ofScalableMatrixWithUnitPricing(scalableMatrixWithUnitPricing)) + + /** + * The Price resource represents a price that can be billed on a subscription, resulting + * in a charge on an invoice in the form of an invoice line item. Prices take a quantity + * and determine an amount to bill. + * + * Orb supports a few different pricing models out of the box. Each of these models is + * serialized differently in a given Price object. The model_type field determines the + * key for the configuration object that is present. + * + * For more on the types of prices, see + * [the core concepts documentation](/core-concepts#plan-and-price) + */ + fun price(scalableMatrixWithTieredPricing: Price.ScalableMatrixWithTieredPricingPrice) = + price(Price.ofScalableMatrixWithTieredPricing(scalableMatrixWithTieredPricing)) + fun quantity(quantity: Double) = quantity(JsonField.of(quantity)) fun quantity(quantity: JsonField) = apply { this.quantity = quantity } @@ -5436,7 +5855,10 @@ private constructor( fun build(): LineItem = LineItem( checkRequired("id", id), + checkRequired("adjustedSubtotal", adjustedSubtotal), + checkRequired("adjustments", adjustments).map { it.toImmutable() }, checkRequired("amount", amount), + checkRequired("creditsApplied", creditsApplied), checkRequired("discount", discount), checkRequired("endDate", endDate), checkRequired("grouping", grouping), @@ -5445,6 +5867,7 @@ private constructor( checkRequired("minimum", minimum), checkRequired("minimumAmount", minimumAmount), checkRequired("name", name), + checkRequired("partiallyInvoicedAmount", partiallyInvoicedAmount), checkRequired("price", price), checkRequired("quantity", quantity), checkRequired("startDate", startDate), @@ -5455,81 +5878,2264 @@ private constructor( ) } - @NoAutoDetect - class Maximum - @JsonCreator + @JsonDeserialize(using = Adjustment.Deserializer::class) + @JsonSerialize(using = Adjustment.Serializer::class) + class Adjustment 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(), + private val amountDiscount: AmountDiscountAdjustment? = null, + private val percentageDiscount: PercentageDiscountAdjustment? = null, + private val usageDiscount: UsageDiscountAdjustment? = null, + private val minimum: MinimumAdjustment? = null, + private val maximum: MaximumAdjustment? = null, + private val _json: JsonValue? = null, ) { - /** - * 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") + fun amountDiscount(): Optional = + Optional.ofNullable(amountDiscount) - /** Maximum amount applied */ - fun maximumAmount(): String = maximumAmount.getRequired("maximum_amount") + fun percentageDiscount(): Optional = + Optional.ofNullable(percentageDiscount) - /** - * 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 + fun usageDiscount(): Optional = + Optional.ofNullable(usageDiscount) - /** Maximum amount applied */ - @JsonProperty("maximum_amount") - @ExcludeMissing - fun _maximumAmount(): JsonField = maximumAmount + fun minimum(): Optional = Optional.ofNullable(minimum) - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = additionalProperties + fun maximum(): Optional = Optional.ofNullable(maximum) + + fun isAmountDiscount(): Boolean = amountDiscount != null + + fun isPercentageDiscount(): Boolean = percentageDiscount != null + + fun isUsageDiscount(): Boolean = usageDiscount != null + + fun isMinimum(): Boolean = minimum != null + + fun isMaximum(): Boolean = maximum != null + + fun asAmountDiscount(): AmountDiscountAdjustment = + amountDiscount.getOrThrow("amountDiscount") + + fun asPercentageDiscount(): PercentageDiscountAdjustment = + percentageDiscount.getOrThrow("percentageDiscount") + + fun asUsageDiscount(): UsageDiscountAdjustment = + usageDiscount.getOrThrow("usageDiscount") + + fun asMinimum(): MinimumAdjustment = minimum.getOrThrow("minimum") + + fun asMaximum(): MaximumAdjustment = maximum.getOrThrow("maximum") + + fun _json(): Optional = Optional.ofNullable(_json) + + fun accept(visitor: Visitor): T { + return when { + amountDiscount != null -> visitor.visitAmountDiscount(amountDiscount) + percentageDiscount != null -> + visitor.visitPercentageDiscount(percentageDiscount) + usageDiscount != null -> visitor.visitUsageDiscount(usageDiscount) + minimum != null -> visitor.visitMinimum(minimum) + maximum != null -> visitor.visitMaximum(maximum) + else -> visitor.unknown(_json) + } + } private var validated: Boolean = false - fun validate(): Maximum = apply { + fun validate(): Adjustment = apply { if (validated) { return@apply } - appliesToPriceIds() - maximumAmount() + accept( + object : Visitor { + override fun visitAmountDiscount(amountDiscount: AmountDiscountAdjustment) { + amountDiscount.validate() + } + + override fun visitPercentageDiscount( + percentageDiscount: PercentageDiscountAdjustment + ) { + percentageDiscount.validate() + } + + override fun visitUsageDiscount(usageDiscount: UsageDiscountAdjustment) { + usageDiscount.validate() + } + + override fun visitMinimum(minimum: MinimumAdjustment) { + minimum.validate() + } + + override fun visitMaximum(maximum: MaximumAdjustment) { + maximum.validate() + } + } + ) validated = true } - fun toBuilder() = Builder().from(this) + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Adjustment && amountDiscount == other.amountDiscount && percentageDiscount == other.percentageDiscount && usageDiscount == other.usageDiscount && minimum == other.minimum && maximum == other.maximum /* spotless:on */ + } + + override fun hashCode(): Int = /* spotless:off */ Objects.hash(amountDiscount, percentageDiscount, usageDiscount, minimum, maximum) /* spotless:on */ + + override fun toString(): String = + when { + amountDiscount != null -> "Adjustment{amountDiscount=$amountDiscount}" + percentageDiscount != null -> + "Adjustment{percentageDiscount=$percentageDiscount}" + usageDiscount != null -> "Adjustment{usageDiscount=$usageDiscount}" + minimum != null -> "Adjustment{minimum=$minimum}" + maximum != null -> "Adjustment{maximum=$maximum}" + _json != null -> "Adjustment{_unknown=$_json}" + else -> throw IllegalStateException("Invalid Adjustment") + } companion object { - @JvmStatic fun builder() = Builder() - } + @JvmStatic + fun ofAmountDiscount(amountDiscount: AmountDiscountAdjustment) = + Adjustment(amountDiscount = amountDiscount) - class Builder { + @JvmStatic + fun ofPercentageDiscount(percentageDiscount: PercentageDiscountAdjustment) = + Adjustment(percentageDiscount = percentageDiscount) - private var appliesToPriceIds: JsonField>? = null - private var maximumAmount: JsonField? = null - private var additionalProperties: MutableMap = mutableMapOf() + @JvmStatic + fun ofUsageDiscount(usageDiscount: UsageDiscountAdjustment) = + Adjustment(usageDiscount = usageDiscount) - @JvmSynthetic - internal fun from(maximum: Maximum) = apply { - appliesToPriceIds = maximum.appliesToPriceIds.map { it.toMutableList() } - maximumAmount = maximum.maximumAmount - additionalProperties = maximum.additionalProperties.toMutableMap() - } + @JvmStatic fun ofMinimum(minimum: MinimumAdjustment) = Adjustment(minimum = minimum) - /** - * List of price_ids that this maximum amount applies to. For plan/plan phase + @JvmStatic fun ofMaximum(maximum: MaximumAdjustment) = Adjustment(maximum = maximum) + } + + /** + * An interface that defines how to map each variant of [Adjustment] to a value of type + * [T]. + */ + interface Visitor { + + fun visitAmountDiscount(amountDiscount: AmountDiscountAdjustment): T + + fun visitPercentageDiscount(percentageDiscount: PercentageDiscountAdjustment): T + + fun visitUsageDiscount(usageDiscount: UsageDiscountAdjustment): T + + fun visitMinimum(minimum: MinimumAdjustment): T + + fun visitMaximum(maximum: MaximumAdjustment): T + + /** + * Maps an unknown variant of [Adjustment] to a value of type [T]. + * + * An instance of [Adjustment] can contain an unknown variant if it was deserialized + * from data that doesn't match any known variant. For example, if the SDK is on an + * older version than the API, then the API may respond with new variants that the + * SDK is unaware of. + * + * @throws OrbInvalidDataException in the default implementation. + */ + fun unknown(json: JsonValue?): T { + throw OrbInvalidDataException("Unknown Adjustment: $json") + } + } + + internal class Deserializer : BaseDeserializer(Adjustment::class) { + + override fun ObjectCodec.deserialize(node: JsonNode): Adjustment { + val json = JsonValue.fromJsonNode(node) + val adjustmentType = + json.asObject().getOrNull()?.get("adjustment_type")?.asString()?.getOrNull() + + when (adjustmentType) { + "amount_discount" -> { + tryDeserialize(node, jacksonTypeRef()) { + it.validate() + } + ?.let { + return Adjustment(amountDiscount = it, _json = json) + } + } + "percentage_discount" -> { + tryDeserialize(node, jacksonTypeRef()) { + it.validate() + } + ?.let { + return Adjustment(percentageDiscount = it, _json = json) + } + } + "usage_discount" -> { + tryDeserialize(node, jacksonTypeRef()) { + it.validate() + } + ?.let { + return Adjustment(usageDiscount = it, _json = json) + } + } + "minimum" -> { + tryDeserialize(node, jacksonTypeRef()) { + it.validate() + } + ?.let { + return Adjustment(minimum = it, _json = json) + } + } + "maximum" -> { + tryDeserialize(node, jacksonTypeRef()) { + it.validate() + } + ?.let { + return Adjustment(maximum = it, _json = json) + } + } + } + + return Adjustment(_json = json) + } + } + + internal class Serializer : BaseSerializer(Adjustment::class) { + + override fun serialize( + value: Adjustment, + generator: JsonGenerator, + provider: SerializerProvider + ) { + when { + value.amountDiscount != null -> generator.writeObject(value.amountDiscount) + value.percentageDiscount != null -> + generator.writeObject(value.percentageDiscount) + value.usageDiscount != null -> generator.writeObject(value.usageDiscount) + value.minimum != null -> generator.writeObject(value.minimum) + value.maximum != null -> generator.writeObject(value.maximum) + value._json != null -> generator.writeObject(value._json) + else -> throw IllegalStateException("Invalid Adjustment") + } + } + } + + @NoAutoDetect + class AmountDiscountAdjustment + @JsonCreator + private constructor( + @JsonProperty("id") + @ExcludeMissing + private val id: JsonField = JsonMissing.of(), + @JsonProperty("adjustment_type") + @ExcludeMissing + private val adjustmentType: JsonField = JsonMissing.of(), + @JsonProperty("amount_discount") + @ExcludeMissing + private val amountDiscount: JsonField = JsonMissing.of(), + @JsonProperty("applies_to_price_ids") + @ExcludeMissing + private val appliesToPriceIds: JsonField> = JsonMissing.of(), + @JsonProperty("is_invoice_level") + @ExcludeMissing + private val isInvoiceLevel: JsonField = JsonMissing.of(), + @JsonProperty("plan_phase_order") + @ExcludeMissing + private val planPhaseOrder: JsonField = JsonMissing.of(), + @JsonProperty("reason") + @ExcludeMissing + private val reason: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { + + fun id(): String = id.getRequired("id") + + fun adjustmentType(): AdjustmentType = adjustmentType.getRequired("adjustment_type") + + /** + * The amount by which to discount the prices this adjustment applies to in a given + * billing period. + */ + fun amountDiscount(): String = amountDiscount.getRequired("amount_discount") + + /** The price IDs that this adjustment applies to. */ + fun appliesToPriceIds(): List = + appliesToPriceIds.getRequired("applies_to_price_ids") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + + /** The reason for the adjustment. */ + fun reason(): Optional = Optional.ofNullable(reason.getNullable("reason")) + + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + @JsonProperty("adjustment_type") + @ExcludeMissing + fun _adjustmentType(): JsonField = adjustmentType + + /** + * The amount by which to discount the prices this adjustment applies to in a given + * billing period. + */ + @JsonProperty("amount_discount") + @ExcludeMissing + fun _amountDiscount(): JsonField = amountDiscount + + /** The price IDs that this adjustment applies to. */ + @JsonProperty("applies_to_price_ids") + @ExcludeMissing + fun _appliesToPriceIds(): JsonField> = appliesToPriceIds + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel(): JsonField = isInvoiceLevel + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun _planPhaseOrder(): JsonField = planPhaseOrder + + /** The reason for the adjustment. */ + @JsonProperty("reason") @ExcludeMissing fun _reason(): JsonField = reason + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): AmountDiscountAdjustment = apply { + if (validated) { + return@apply + } + + id() + adjustmentType() + amountDiscount() + appliesToPriceIds() + isInvoiceLevel() + planPhaseOrder() + reason() + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + /** A builder for [AmountDiscountAdjustment]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var adjustmentType: JsonField? = null + private var amountDiscount: JsonField? = null + private var appliesToPriceIds: JsonField>? = null + private var isInvoiceLevel: JsonField? = null + private var planPhaseOrder: JsonField? = null + private var reason: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(amountDiscountAdjustment: AmountDiscountAdjustment) = apply { + id = amountDiscountAdjustment.id + adjustmentType = amountDiscountAdjustment.adjustmentType + amountDiscount = amountDiscountAdjustment.amountDiscount + appliesToPriceIds = + amountDiscountAdjustment.appliesToPriceIds.map { it.toMutableList() } + isInvoiceLevel = amountDiscountAdjustment.isInvoiceLevel + planPhaseOrder = amountDiscountAdjustment.planPhaseOrder + reason = amountDiscountAdjustment.reason + additionalProperties = + amountDiscountAdjustment.additionalProperties.toMutableMap() + } + + fun id(id: String) = id(JsonField.of(id)) + + fun id(id: JsonField) = apply { this.id = id } + + fun adjustmentType(adjustmentType: AdjustmentType) = + adjustmentType(JsonField.of(adjustmentType)) + + fun adjustmentType(adjustmentType: JsonField) = apply { + this.adjustmentType = adjustmentType + } + + /** + * The amount by which to discount the prices this adjustment applies to in a + * given billing period. + */ + fun amountDiscount(amountDiscount: String) = + amountDiscount(JsonField.of(amountDiscount)) + + /** + * The amount by which to discount the prices this adjustment applies to in a + * given billing period. + */ + fun amountDiscount(amountDiscount: JsonField) = apply { + this.amountDiscount = amountDiscount + } + + /** The price IDs that this adjustment applies to. */ + fun appliesToPriceIds(appliesToPriceIds: List) = + appliesToPriceIds(JsonField.of(appliesToPriceIds)) + + /** The price IDs that this adjustment applies to. */ + fun appliesToPriceIds(appliesToPriceIds: JsonField>) = apply { + this.appliesToPriceIds = appliesToPriceIds.map { it.toMutableList() } + } + + /** The price IDs that this adjustment applies to. */ + 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) + } + } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long?) = + planPhaseOrder(JsonField.ofNullable(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = + planPhaseOrder(planPhaseOrder as Long?) + + /** The plan phase in which this adjustment is active. */ + @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 + fun planPhaseOrder(planPhaseOrder: Optional) = + planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + + /** The reason for the adjustment. */ + fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) + + /** The reason for the adjustment. */ + fun reason(reason: Optional) = reason(reason.orElse(null)) + + /** The reason for the adjustment. */ + fun reason(reason: JsonField) = apply { this.reason = reason } + + 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(): AmountDiscountAdjustment = + AmountDiscountAdjustment( + checkRequired("id", id), + checkRequired("adjustmentType", adjustmentType), + checkRequired("amountDiscount", amountDiscount), + checkRequired("appliesToPriceIds", appliesToPriceIds).map { + it.toImmutable() + }, + checkRequired("isInvoiceLevel", isInvoiceLevel), + checkRequired("planPhaseOrder", planPhaseOrder), + checkRequired("reason", reason), + additionalProperties.toImmutable(), + ) + } + + class AdjustmentType + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue + fun _value(): JsonField = value + + companion object { + + @JvmField val AMOUNT_DISCOUNT = of("amount_discount") + + @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) + } + + /** An enum containing [AdjustmentType]'s known values. */ + enum class Known { + AMOUNT_DISCOUNT, + } + + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + AMOUNT_DISCOUNT, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + AMOUNT_DISCOUNT -> Value.AMOUNT_DISCOUNT + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ + fun known(): Known = + when (this) { + AMOUNT_DISCOUNT -> Known.AMOUNT_DISCOUNT + else -> throw OrbInvalidDataException("Unknown AdjustmentType: $value") + } + + fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is AdjustmentType && 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 AmountDiscountAdjustment && id == other.id && adjustmentType == other.adjustmentType && amountDiscount == other.amountDiscount && appliesToPriceIds == other.appliesToPriceIds && isInvoiceLevel == other.isInvoiceLevel && planPhaseOrder == other.planPhaseOrder && reason == other.reason && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(id, adjustmentType, amountDiscount, appliesToPriceIds, isInvoiceLevel, planPhaseOrder, reason, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "AmountDiscountAdjustment{id=$id, adjustmentType=$adjustmentType, amountDiscount=$amountDiscount, appliesToPriceIds=$appliesToPriceIds, isInvoiceLevel=$isInvoiceLevel, planPhaseOrder=$planPhaseOrder, reason=$reason, additionalProperties=$additionalProperties}" + } + + @NoAutoDetect + class PercentageDiscountAdjustment + @JsonCreator + private constructor( + @JsonProperty("id") + @ExcludeMissing + private val id: JsonField = JsonMissing.of(), + @JsonProperty("adjustment_type") + @ExcludeMissing + private val adjustmentType: JsonField = JsonMissing.of(), + @JsonProperty("applies_to_price_ids") + @ExcludeMissing + private val appliesToPriceIds: JsonField> = JsonMissing.of(), + @JsonProperty("is_invoice_level") + @ExcludeMissing + private val isInvoiceLevel: JsonField = JsonMissing.of(), + @JsonProperty("percentage_discount") + @ExcludeMissing + private val percentageDiscount: JsonField = JsonMissing.of(), + @JsonProperty("plan_phase_order") + @ExcludeMissing + private val planPhaseOrder: JsonField = JsonMissing.of(), + @JsonProperty("reason") + @ExcludeMissing + private val reason: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { + + fun id(): String = id.getRequired("id") + + fun adjustmentType(): AdjustmentType = adjustmentType.getRequired("adjustment_type") + + /** The price IDs that this adjustment applies to. */ + fun appliesToPriceIds(): List = + appliesToPriceIds.getRequired("applies_to_price_ids") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** + * The percentage (as a value between 0 and 1) by which to discount the price + * intervals this adjustment applies to in a given billing period. + */ + fun percentageDiscount(): Double = + percentageDiscount.getRequired("percentage_discount") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + + /** The reason for the adjustment. */ + fun reason(): Optional = Optional.ofNullable(reason.getNullable("reason")) + + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + @JsonProperty("adjustment_type") + @ExcludeMissing + fun _adjustmentType(): JsonField = adjustmentType + + /** The price IDs that this adjustment applies to. */ + @JsonProperty("applies_to_price_ids") + @ExcludeMissing + fun _appliesToPriceIds(): JsonField> = appliesToPriceIds + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel(): JsonField = isInvoiceLevel + + /** + * The percentage (as a value between 0 and 1) by which to discount the price + * intervals this adjustment applies to in a given billing period. + */ + @JsonProperty("percentage_discount") + @ExcludeMissing + fun _percentageDiscount(): JsonField = percentageDiscount + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun _planPhaseOrder(): JsonField = planPhaseOrder + + /** The reason for the adjustment. */ + @JsonProperty("reason") @ExcludeMissing fun _reason(): JsonField = reason + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): PercentageDiscountAdjustment = apply { + if (validated) { + return@apply + } + + id() + adjustmentType() + appliesToPriceIds() + isInvoiceLevel() + percentageDiscount() + planPhaseOrder() + reason() + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + /** A builder for [PercentageDiscountAdjustment]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var adjustmentType: JsonField? = null + private var appliesToPriceIds: JsonField>? = null + private var isInvoiceLevel: JsonField? = null + private var percentageDiscount: JsonField? = null + private var planPhaseOrder: JsonField? = null + private var reason: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(percentageDiscountAdjustment: PercentageDiscountAdjustment) = + apply { + id = percentageDiscountAdjustment.id + adjustmentType = percentageDiscountAdjustment.adjustmentType + appliesToPriceIds = + percentageDiscountAdjustment.appliesToPriceIds.map { + it.toMutableList() + } + isInvoiceLevel = percentageDiscountAdjustment.isInvoiceLevel + percentageDiscount = percentageDiscountAdjustment.percentageDiscount + planPhaseOrder = percentageDiscountAdjustment.planPhaseOrder + reason = percentageDiscountAdjustment.reason + additionalProperties = + percentageDiscountAdjustment.additionalProperties.toMutableMap() + } + + fun id(id: String) = id(JsonField.of(id)) + + fun id(id: JsonField) = apply { this.id = id } + + fun adjustmentType(adjustmentType: AdjustmentType) = + adjustmentType(JsonField.of(adjustmentType)) + + fun adjustmentType(adjustmentType: JsonField) = apply { + this.adjustmentType = adjustmentType + } + + /** The price IDs that this adjustment applies to. */ + fun appliesToPriceIds(appliesToPriceIds: List) = + appliesToPriceIds(JsonField.of(appliesToPriceIds)) + + /** The price IDs that this adjustment applies to. */ + fun appliesToPriceIds(appliesToPriceIds: JsonField>) = apply { + this.appliesToPriceIds = appliesToPriceIds.map { it.toMutableList() } + } + + /** The price IDs that this adjustment applies to. */ + 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) + } + } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** + * The percentage (as a value between 0 and 1) by which to discount the price + * intervals this adjustment applies to in a given billing period. + */ + fun percentageDiscount(percentageDiscount: Double) = + percentageDiscount(JsonField.of(percentageDiscount)) + + /** + * The percentage (as a value between 0 and 1) by which to discount the price + * intervals this adjustment applies to in a given billing period. + */ + fun percentageDiscount(percentageDiscount: JsonField) = apply { + this.percentageDiscount = percentageDiscount + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long?) = + planPhaseOrder(JsonField.ofNullable(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = + planPhaseOrder(planPhaseOrder as Long?) + + /** The plan phase in which this adjustment is active. */ + @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 + fun planPhaseOrder(planPhaseOrder: Optional) = + planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + + /** The reason for the adjustment. */ + fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) + + /** The reason for the adjustment. */ + fun reason(reason: Optional) = reason(reason.orElse(null)) + + /** The reason for the adjustment. */ + fun reason(reason: JsonField) = apply { this.reason = reason } + + 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(): PercentageDiscountAdjustment = + PercentageDiscountAdjustment( + checkRequired("id", id), + checkRequired("adjustmentType", adjustmentType), + checkRequired("appliesToPriceIds", appliesToPriceIds).map { + it.toImmutable() + }, + checkRequired("isInvoiceLevel", isInvoiceLevel), + checkRequired("percentageDiscount", percentageDiscount), + checkRequired("planPhaseOrder", planPhaseOrder), + checkRequired("reason", reason), + additionalProperties.toImmutable(), + ) + } + + class AdjustmentType + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue + fun _value(): JsonField = value + + companion object { + + @JvmField val PERCENTAGE_DISCOUNT = of("percentage_discount") + + @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) + } + + /** An enum containing [AdjustmentType]'s known values. */ + enum class Known { + PERCENTAGE_DISCOUNT, + } + + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + PERCENTAGE_DISCOUNT, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + PERCENTAGE_DISCOUNT -> Value.PERCENTAGE_DISCOUNT + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ + fun known(): Known = + when (this) { + PERCENTAGE_DISCOUNT -> Known.PERCENTAGE_DISCOUNT + else -> throw OrbInvalidDataException("Unknown AdjustmentType: $value") + } + + fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is AdjustmentType && 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 PercentageDiscountAdjustment && id == other.id && adjustmentType == other.adjustmentType && appliesToPriceIds == other.appliesToPriceIds && isInvoiceLevel == other.isInvoiceLevel && percentageDiscount == other.percentageDiscount && planPhaseOrder == other.planPhaseOrder && reason == other.reason && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(id, adjustmentType, appliesToPriceIds, isInvoiceLevel, percentageDiscount, planPhaseOrder, reason, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "PercentageDiscountAdjustment{id=$id, adjustmentType=$adjustmentType, appliesToPriceIds=$appliesToPriceIds, isInvoiceLevel=$isInvoiceLevel, percentageDiscount=$percentageDiscount, planPhaseOrder=$planPhaseOrder, reason=$reason, additionalProperties=$additionalProperties}" + } + + @NoAutoDetect + class UsageDiscountAdjustment + @JsonCreator + private constructor( + @JsonProperty("id") + @ExcludeMissing + private val id: JsonField = JsonMissing.of(), + @JsonProperty("adjustment_type") + @ExcludeMissing + private val adjustmentType: JsonField = JsonMissing.of(), + @JsonProperty("applies_to_price_ids") + @ExcludeMissing + private val appliesToPriceIds: JsonField> = JsonMissing.of(), + @JsonProperty("is_invoice_level") + @ExcludeMissing + private val isInvoiceLevel: JsonField = JsonMissing.of(), + @JsonProperty("plan_phase_order") + @ExcludeMissing + private val planPhaseOrder: JsonField = JsonMissing.of(), + @JsonProperty("reason") + @ExcludeMissing + private val reason: JsonField = JsonMissing.of(), + @JsonProperty("usage_discount") + @ExcludeMissing + private val usageDiscount: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { + + fun id(): String = id.getRequired("id") + + fun adjustmentType(): AdjustmentType = adjustmentType.getRequired("adjustment_type") + + /** The price IDs that this adjustment applies to. */ + fun appliesToPriceIds(): List = + appliesToPriceIds.getRequired("applies_to_price_ids") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + + /** The reason for the adjustment. */ + fun reason(): Optional = Optional.ofNullable(reason.getNullable("reason")) + + /** + * The number of usage units by which to discount the price this adjustment applies + * to in a given billing period. + */ + fun usageDiscount(): Double = usageDiscount.getRequired("usage_discount") + + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + @JsonProperty("adjustment_type") + @ExcludeMissing + fun _adjustmentType(): JsonField = adjustmentType + + /** The price IDs that this adjustment applies to. */ + @JsonProperty("applies_to_price_ids") + @ExcludeMissing + fun _appliesToPriceIds(): JsonField> = appliesToPriceIds + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel(): JsonField = isInvoiceLevel + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun _planPhaseOrder(): JsonField = planPhaseOrder + + /** The reason for the adjustment. */ + @JsonProperty("reason") @ExcludeMissing fun _reason(): JsonField = reason + + /** + * The number of usage units by which to discount the price this adjustment applies + * to in a given billing period. + */ + @JsonProperty("usage_discount") + @ExcludeMissing + fun _usageDiscount(): JsonField = usageDiscount + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): UsageDiscountAdjustment = apply { + if (validated) { + return@apply + } + + id() + adjustmentType() + appliesToPriceIds() + isInvoiceLevel() + planPhaseOrder() + reason() + usageDiscount() + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + /** A builder for [UsageDiscountAdjustment]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var adjustmentType: JsonField? = null + private var appliesToPriceIds: JsonField>? = null + private var isInvoiceLevel: JsonField? = null + private var planPhaseOrder: JsonField? = null + private var reason: JsonField? = null + private var usageDiscount: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(usageDiscountAdjustment: UsageDiscountAdjustment) = apply { + id = usageDiscountAdjustment.id + adjustmentType = usageDiscountAdjustment.adjustmentType + appliesToPriceIds = + usageDiscountAdjustment.appliesToPriceIds.map { it.toMutableList() } + isInvoiceLevel = usageDiscountAdjustment.isInvoiceLevel + planPhaseOrder = usageDiscountAdjustment.planPhaseOrder + reason = usageDiscountAdjustment.reason + usageDiscount = usageDiscountAdjustment.usageDiscount + additionalProperties = + usageDiscountAdjustment.additionalProperties.toMutableMap() + } + + fun id(id: String) = id(JsonField.of(id)) + + fun id(id: JsonField) = apply { this.id = id } + + fun adjustmentType(adjustmentType: AdjustmentType) = + adjustmentType(JsonField.of(adjustmentType)) + + fun adjustmentType(adjustmentType: JsonField) = apply { + this.adjustmentType = adjustmentType + } + + /** The price IDs that this adjustment applies to. */ + fun appliesToPriceIds(appliesToPriceIds: List) = + appliesToPriceIds(JsonField.of(appliesToPriceIds)) + + /** The price IDs that this adjustment applies to. */ + fun appliesToPriceIds(appliesToPriceIds: JsonField>) = apply { + this.appliesToPriceIds = appliesToPriceIds.map { it.toMutableList() } + } + + /** The price IDs that this adjustment applies to. */ + 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) + } + } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long?) = + planPhaseOrder(JsonField.ofNullable(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = + planPhaseOrder(planPhaseOrder as Long?) + + /** The plan phase in which this adjustment is active. */ + @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 + fun planPhaseOrder(planPhaseOrder: Optional) = + planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + + /** The reason for the adjustment. */ + fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) + + /** The reason for the adjustment. */ + fun reason(reason: Optional) = reason(reason.orElse(null)) + + /** The reason for the adjustment. */ + fun reason(reason: JsonField) = apply { this.reason = reason } + + /** + * The number of usage units by which to discount the price this adjustment + * applies to in a given billing period. + */ + fun usageDiscount(usageDiscount: Double) = + usageDiscount(JsonField.of(usageDiscount)) + + /** + * The number of usage units by which to discount the price this adjustment + * applies to in a given billing period. + */ + fun usageDiscount(usageDiscount: JsonField) = apply { + this.usageDiscount = usageDiscount + } + + 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(): UsageDiscountAdjustment = + UsageDiscountAdjustment( + checkRequired("id", id), + checkRequired("adjustmentType", adjustmentType), + checkRequired("appliesToPriceIds", appliesToPriceIds).map { + it.toImmutable() + }, + checkRequired("isInvoiceLevel", isInvoiceLevel), + checkRequired("planPhaseOrder", planPhaseOrder), + checkRequired("reason", reason), + checkRequired("usageDiscount", usageDiscount), + additionalProperties.toImmutable(), + ) + } + + class AdjustmentType + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue + fun _value(): JsonField = value + + companion object { + + @JvmField val USAGE_DISCOUNT = of("usage_discount") + + @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) + } + + /** An enum containing [AdjustmentType]'s known values. */ + enum class Known { + USAGE_DISCOUNT, + } + + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + USAGE_DISCOUNT, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + USAGE_DISCOUNT -> Value.USAGE_DISCOUNT + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ + fun known(): Known = + when (this) { + USAGE_DISCOUNT -> Known.USAGE_DISCOUNT + else -> throw OrbInvalidDataException("Unknown AdjustmentType: $value") + } + + fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is AdjustmentType && 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 UsageDiscountAdjustment && id == other.id && adjustmentType == other.adjustmentType && appliesToPriceIds == other.appliesToPriceIds && isInvoiceLevel == other.isInvoiceLevel && planPhaseOrder == other.planPhaseOrder && reason == other.reason && usageDiscount == other.usageDiscount && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(id, adjustmentType, appliesToPriceIds, isInvoiceLevel, planPhaseOrder, reason, usageDiscount, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "UsageDiscountAdjustment{id=$id, adjustmentType=$adjustmentType, appliesToPriceIds=$appliesToPriceIds, isInvoiceLevel=$isInvoiceLevel, planPhaseOrder=$planPhaseOrder, reason=$reason, usageDiscount=$usageDiscount, additionalProperties=$additionalProperties}" + } + + @NoAutoDetect + class MinimumAdjustment + @JsonCreator + private constructor( + @JsonProperty("id") + @ExcludeMissing + private val id: JsonField = JsonMissing.of(), + @JsonProperty("adjustment_type") + @ExcludeMissing + private val adjustmentType: JsonField = JsonMissing.of(), + @JsonProperty("applies_to_price_ids") + @ExcludeMissing + private val appliesToPriceIds: JsonField> = JsonMissing.of(), + @JsonProperty("is_invoice_level") + @ExcludeMissing + private val isInvoiceLevel: JsonField = JsonMissing.of(), + @JsonProperty("item_id") + @ExcludeMissing + private val itemId: JsonField = JsonMissing.of(), + @JsonProperty("minimum_amount") + @ExcludeMissing + private val minimumAmount: JsonField = JsonMissing.of(), + @JsonProperty("plan_phase_order") + @ExcludeMissing + private val planPhaseOrder: JsonField = JsonMissing.of(), + @JsonProperty("reason") + @ExcludeMissing + private val reason: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { + + fun id(): String = id.getRequired("id") + + fun adjustmentType(): AdjustmentType = adjustmentType.getRequired("adjustment_type") + + /** The price IDs that this adjustment applies to. */ + fun appliesToPriceIds(): List = + appliesToPriceIds.getRequired("applies_to_price_ids") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** The item ID that revenue from this minimum will be attributed to. */ + fun itemId(): String = itemId.getRequired("item_id") + + /** + * The minimum amount to charge in a given billing period for the prices this + * adjustment applies to. + */ + fun minimumAmount(): String = minimumAmount.getRequired("minimum_amount") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + + /** The reason for the adjustment. */ + fun reason(): Optional = Optional.ofNullable(reason.getNullable("reason")) + + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + @JsonProperty("adjustment_type") + @ExcludeMissing + fun _adjustmentType(): JsonField = adjustmentType + + /** The price IDs that this adjustment applies to. */ + @JsonProperty("applies_to_price_ids") + @ExcludeMissing + fun _appliesToPriceIds(): JsonField> = appliesToPriceIds + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel(): JsonField = isInvoiceLevel + + /** The item ID that revenue from this minimum will be attributed to. */ + @JsonProperty("item_id") @ExcludeMissing fun _itemId(): JsonField = itemId + + /** + * The minimum amount to charge in a given billing period for the prices this + * adjustment applies to. + */ + @JsonProperty("minimum_amount") + @ExcludeMissing + fun _minimumAmount(): JsonField = minimumAmount + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun _planPhaseOrder(): JsonField = planPhaseOrder + + /** The reason for the adjustment. */ + @JsonProperty("reason") @ExcludeMissing fun _reason(): JsonField = reason + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): MinimumAdjustment = apply { + if (validated) { + return@apply + } + + id() + adjustmentType() + appliesToPriceIds() + isInvoiceLevel() + itemId() + minimumAmount() + planPhaseOrder() + reason() + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + /** A builder for [MinimumAdjustment]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var adjustmentType: JsonField? = null + private var appliesToPriceIds: JsonField>? = null + private var isInvoiceLevel: JsonField? = null + private var itemId: JsonField? = null + private var minimumAmount: JsonField? = null + private var planPhaseOrder: JsonField? = null + private var reason: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(minimumAdjustment: MinimumAdjustment) = apply { + id = minimumAdjustment.id + adjustmentType = minimumAdjustment.adjustmentType + appliesToPriceIds = + minimumAdjustment.appliesToPriceIds.map { it.toMutableList() } + isInvoiceLevel = minimumAdjustment.isInvoiceLevel + itemId = minimumAdjustment.itemId + minimumAmount = minimumAdjustment.minimumAmount + planPhaseOrder = minimumAdjustment.planPhaseOrder + reason = minimumAdjustment.reason + additionalProperties = minimumAdjustment.additionalProperties.toMutableMap() + } + + fun id(id: String) = id(JsonField.of(id)) + + fun id(id: JsonField) = apply { this.id = id } + + fun adjustmentType(adjustmentType: AdjustmentType) = + adjustmentType(JsonField.of(adjustmentType)) + + fun adjustmentType(adjustmentType: JsonField) = apply { + this.adjustmentType = adjustmentType + } + + /** The price IDs that this adjustment applies to. */ + fun appliesToPriceIds(appliesToPriceIds: List) = + appliesToPriceIds(JsonField.of(appliesToPriceIds)) + + /** The price IDs that this adjustment applies to. */ + fun appliesToPriceIds(appliesToPriceIds: JsonField>) = apply { + this.appliesToPriceIds = appliesToPriceIds.map { it.toMutableList() } + } + + /** The price IDs that this adjustment applies to. */ + 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) + } + } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** The item ID that revenue from this minimum will be attributed to. */ + fun itemId(itemId: String) = itemId(JsonField.of(itemId)) + + /** The item ID that revenue from this minimum will be attributed to. */ + fun itemId(itemId: JsonField) = apply { this.itemId = itemId } + + /** + * The minimum amount to charge in a given billing period for the prices this + * adjustment applies to. + */ + fun minimumAmount(minimumAmount: String) = + minimumAmount(JsonField.of(minimumAmount)) + + /** + * The minimum amount to charge in a given billing period for the prices this + * adjustment applies to. + */ + fun minimumAmount(minimumAmount: JsonField) = apply { + this.minimumAmount = minimumAmount + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long?) = + planPhaseOrder(JsonField.ofNullable(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = + planPhaseOrder(planPhaseOrder as Long?) + + /** The plan phase in which this adjustment is active. */ + @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 + fun planPhaseOrder(planPhaseOrder: Optional) = + planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + + /** The reason for the adjustment. */ + fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) + + /** The reason for the adjustment. */ + fun reason(reason: Optional) = reason(reason.orElse(null)) + + /** The reason for the adjustment. */ + fun reason(reason: JsonField) = apply { this.reason = reason } + + 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(): MinimumAdjustment = + MinimumAdjustment( + checkRequired("id", id), + checkRequired("adjustmentType", adjustmentType), + checkRequired("appliesToPriceIds", appliesToPriceIds).map { + it.toImmutable() + }, + checkRequired("isInvoiceLevel", isInvoiceLevel), + checkRequired("itemId", itemId), + checkRequired("minimumAmount", minimumAmount), + checkRequired("planPhaseOrder", planPhaseOrder), + checkRequired("reason", reason), + additionalProperties.toImmutable(), + ) + } + + class AdjustmentType + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue + fun _value(): JsonField = value + + companion object { + + @JvmField val MINIMUM = of("minimum") + + @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) + } + + /** An enum containing [AdjustmentType]'s known values. */ + enum class Known { + MINIMUM, + } + + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + MINIMUM, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + MINIMUM -> Value.MINIMUM + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ + fun known(): Known = + when (this) { + MINIMUM -> Known.MINIMUM + else -> throw OrbInvalidDataException("Unknown AdjustmentType: $value") + } + + fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is AdjustmentType && 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 MinimumAdjustment && id == other.id && adjustmentType == other.adjustmentType && appliesToPriceIds == other.appliesToPriceIds && isInvoiceLevel == other.isInvoiceLevel && itemId == other.itemId && minimumAmount == other.minimumAmount && planPhaseOrder == other.planPhaseOrder && reason == other.reason && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(id, adjustmentType, appliesToPriceIds, isInvoiceLevel, itemId, minimumAmount, planPhaseOrder, reason, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "MinimumAdjustment{id=$id, adjustmentType=$adjustmentType, appliesToPriceIds=$appliesToPriceIds, isInvoiceLevel=$isInvoiceLevel, itemId=$itemId, minimumAmount=$minimumAmount, planPhaseOrder=$planPhaseOrder, reason=$reason, additionalProperties=$additionalProperties}" + } + + @NoAutoDetect + class MaximumAdjustment + @JsonCreator + private constructor( + @JsonProperty("id") + @ExcludeMissing + private val id: JsonField = JsonMissing.of(), + @JsonProperty("adjustment_type") + @ExcludeMissing + private val adjustmentType: JsonField = JsonMissing.of(), + @JsonProperty("applies_to_price_ids") + @ExcludeMissing + private val appliesToPriceIds: JsonField> = JsonMissing.of(), + @JsonProperty("is_invoice_level") + @ExcludeMissing + private val isInvoiceLevel: JsonField = JsonMissing.of(), + @JsonProperty("maximum_amount") + @ExcludeMissing + private val maximumAmount: JsonField = JsonMissing.of(), + @JsonProperty("plan_phase_order") + @ExcludeMissing + private val planPhaseOrder: JsonField = JsonMissing.of(), + @JsonProperty("reason") + @ExcludeMissing + private val reason: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { + + fun id(): String = id.getRequired("id") + + fun adjustmentType(): AdjustmentType = adjustmentType.getRequired("adjustment_type") + + /** The price IDs that this adjustment applies to. */ + fun appliesToPriceIds(): List = + appliesToPriceIds.getRequired("applies_to_price_ids") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** + * The maximum amount to charge in a given billing period for the prices this + * adjustment applies to. + */ + fun maximumAmount(): String = maximumAmount.getRequired("maximum_amount") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + + /** The reason for the adjustment. */ + fun reason(): Optional = Optional.ofNullable(reason.getNullable("reason")) + + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + @JsonProperty("adjustment_type") + @ExcludeMissing + fun _adjustmentType(): JsonField = adjustmentType + + /** The price IDs that this adjustment applies to. */ + @JsonProperty("applies_to_price_ids") + @ExcludeMissing + fun _appliesToPriceIds(): JsonField> = appliesToPriceIds + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel(): JsonField = isInvoiceLevel + + /** + * The maximum amount to charge in a given billing period for the prices this + * adjustment applies to. + */ + @JsonProperty("maximum_amount") + @ExcludeMissing + fun _maximumAmount(): JsonField = maximumAmount + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun _planPhaseOrder(): JsonField = planPhaseOrder + + /** The reason for the adjustment. */ + @JsonProperty("reason") @ExcludeMissing fun _reason(): JsonField = reason + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): MaximumAdjustment = apply { + if (validated) { + return@apply + } + + id() + adjustmentType() + appliesToPriceIds() + isInvoiceLevel() + maximumAmount() + planPhaseOrder() + reason() + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + /** A builder for [MaximumAdjustment]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var adjustmentType: JsonField? = null + private var appliesToPriceIds: JsonField>? = null + private var isInvoiceLevel: JsonField? = null + private var maximumAmount: JsonField? = null + private var planPhaseOrder: JsonField? = null + private var reason: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(maximumAdjustment: MaximumAdjustment) = apply { + id = maximumAdjustment.id + adjustmentType = maximumAdjustment.adjustmentType + appliesToPriceIds = + maximumAdjustment.appliesToPriceIds.map { it.toMutableList() } + isInvoiceLevel = maximumAdjustment.isInvoiceLevel + maximumAmount = maximumAdjustment.maximumAmount + planPhaseOrder = maximumAdjustment.planPhaseOrder + reason = maximumAdjustment.reason + additionalProperties = maximumAdjustment.additionalProperties.toMutableMap() + } + + fun id(id: String) = id(JsonField.of(id)) + + fun id(id: JsonField) = apply { this.id = id } + + fun adjustmentType(adjustmentType: AdjustmentType) = + adjustmentType(JsonField.of(adjustmentType)) + + fun adjustmentType(adjustmentType: JsonField) = apply { + this.adjustmentType = adjustmentType + } + + /** The price IDs that this adjustment applies to. */ + fun appliesToPriceIds(appliesToPriceIds: List) = + appliesToPriceIds(JsonField.of(appliesToPriceIds)) + + /** The price IDs that this adjustment applies to. */ + fun appliesToPriceIds(appliesToPriceIds: JsonField>) = apply { + this.appliesToPriceIds = appliesToPriceIds.map { it.toMutableList() } + } + + /** The price IDs that this adjustment applies to. */ + 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) + } + } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments + * that apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** + * The maximum amount to charge in a given billing period for the prices this + * adjustment applies to. + */ + fun maximumAmount(maximumAmount: String) = + maximumAmount(JsonField.of(maximumAmount)) + + /** + * The maximum amount to charge in a given billing period for the prices this + * adjustment applies to. + */ + fun maximumAmount(maximumAmount: JsonField) = apply { + this.maximumAmount = maximumAmount + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long?) = + planPhaseOrder(JsonField.ofNullable(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = + planPhaseOrder(planPhaseOrder as Long?) + + /** The plan phase in which this adjustment is active. */ + @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 + fun planPhaseOrder(planPhaseOrder: Optional) = + planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + + /** The reason for the adjustment. */ + fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) + + /** The reason for the adjustment. */ + fun reason(reason: Optional) = reason(reason.orElse(null)) + + /** The reason for the adjustment. */ + fun reason(reason: JsonField) = apply { this.reason = reason } + + 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(): MaximumAdjustment = + MaximumAdjustment( + checkRequired("id", id), + checkRequired("adjustmentType", adjustmentType), + checkRequired("appliesToPriceIds", appliesToPriceIds).map { + it.toImmutable() + }, + checkRequired("isInvoiceLevel", isInvoiceLevel), + checkRequired("maximumAmount", maximumAmount), + checkRequired("planPhaseOrder", planPhaseOrder), + checkRequired("reason", reason), + additionalProperties.toImmutable(), + ) + } + + class AdjustmentType + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue + fun _value(): JsonField = value + + companion object { + + @JvmField val MAXIMUM = of("maximum") + + @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) + } + + /** An enum containing [AdjustmentType]'s known values. */ + enum class Known { + MAXIMUM, + } + + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + MAXIMUM, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + MAXIMUM -> Value.MAXIMUM + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ + fun known(): Known = + when (this) { + MAXIMUM -> Known.MAXIMUM + else -> throw OrbInvalidDataException("Unknown AdjustmentType: $value") + } + + fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is AdjustmentType && 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 MaximumAdjustment && id == other.id && adjustmentType == other.adjustmentType && appliesToPriceIds == other.appliesToPriceIds && isInvoiceLevel == other.isInvoiceLevel && maximumAmount == other.maximumAmount && planPhaseOrder == other.planPhaseOrder && reason == other.reason && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(id, adjustmentType, appliesToPriceIds, isInvoiceLevel, maximumAmount, planPhaseOrder, reason, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "MaximumAdjustment{id=$id, adjustmentType=$adjustmentType, appliesToPriceIds=$appliesToPriceIds, isInvoiceLevel=$isInvoiceLevel, maximumAmount=$maximumAmount, planPhaseOrder=$planPhaseOrder, reason=$reason, additionalProperties=$additionalProperties}" + } + } + + /** This field is deprecated in favor of `adjustments`. */ + @Deprecated("deprecated") + @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() + } + + /** A builder for [Maximum]. */ + class Builder internal constructor() { + + 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) = @@ -5619,6 +8225,8 @@ private constructor( "Maximum{appliesToPriceIds=$appliesToPriceIds, maximumAmount=$maximumAmount, additionalProperties=$additionalProperties}" } + /** This field is deprecated in favor of `adjustments`. */ + @Deprecated("deprecated") @NoAutoDetect class Minimum @JsonCreator @@ -5679,7 +8287,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Minimum]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var minimumAmount: JsonField? = null @@ -5875,6 +8484,10 @@ private constructor( @JvmStatic fun ofOther(other: OtherSubLineItem) = SubLineItem(other = other) } + /** + * An interface that defines how to map each variant of [SubLineItem] to a value of type + * [T]. + */ interface Visitor { fun visitMatrix(matrix: MatrixSubLineItem): T @@ -5883,12 +8496,22 @@ private constructor( fun visitOther(other: OtherSubLineItem): T + /** + * Maps an unknown variant of [SubLineItem] to a value of type [T]. + * + * An instance of [SubLineItem] can contain an unknown variant if it was + * deserialized from data that doesn't match any known variant. For example, if the + * SDK is on an older version than the API, then the API may respond with new + * variants that the SDK is unaware of. + * + * @throws OrbInvalidDataException in the default implementation. + */ fun unknown(json: JsonValue?): T { throw OrbInvalidDataException("Unknown SubLineItem: $json") } } - class Deserializer : BaseDeserializer(SubLineItem::class) { + internal class Deserializer : BaseDeserializer(SubLineItem::class) { override fun ObjectCodec.deserialize(node: JsonNode): SubLineItem { val json = JsonValue.fromJsonNode(node) @@ -5925,7 +8548,7 @@ private constructor( } } - class Serializer : BaseSerializer(SubLineItem::class) { + internal class Serializer : BaseSerializer(SubLineItem::class) { override fun serialize( value: SubLineItem, @@ -6028,7 +8651,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MatrixSubLineItem]. */ + class Builder internal constructor() { private var amount: JsonField? = null private var grouping: JsonField? = null @@ -6161,7 +8785,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Grouping]. */ + class Builder internal constructor() { private var key: JsonField? = null private var value: JsonField? = null @@ -6278,7 +8903,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MatrixConfig]. */ + class Builder internal constructor() { private var dimensionValues: JsonField>? = null private var additionalProperties: MutableMap = @@ -6369,6 +8995,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -6379,21 +9013,51 @@ private constructor( @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } + /** An enum containing [Type]'s known values. */ enum class Known { MATRIX, } + /** + * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Type] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { MATRIX, + /** + * An enum member indicating that [Type] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { MATRIX -> Value.MATRIX else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { MATRIX -> Known.MATRIX @@ -6519,7 +9183,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TierSubLineItem]. */ + class Builder internal constructor() { private var amount: JsonField? = null private var grouping: JsonField? = null @@ -6651,7 +9316,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Grouping]. */ + class Builder internal constructor() { private var key: JsonField? = null private var value: JsonField? = null @@ -6786,7 +9452,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TierConfig]. */ + class Builder internal constructor() { private var firstUnit: JsonField? = null private var lastUnit: JsonField? = null @@ -6883,6 +9550,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -6893,21 +9568,51 @@ private constructor( @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } + /** An enum containing [Type]'s known values. */ enum class Known { TIER, } + /** + * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Type] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { TIER, + /** + * An enum member indicating that [Type] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { TIER -> Value.TIER else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { TIER -> Known.TIER @@ -7023,7 +9728,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [OtherSubLineItem]. */ + class Builder internal constructor() { private var amount: JsonField? = null private var grouping: JsonField? = null @@ -7146,7 +9852,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Grouping]. */ + class Builder internal constructor() { private var key: JsonField? = null private var value: JsonField? = null @@ -7227,6 +9934,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -7237,21 +9952,51 @@ private constructor( @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } + /** An enum containing [Type]'s known values. */ enum class Known { NULL, } + /** + * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Type] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { NULL, + /** + * An enum member indicating that [Type] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { NULL -> Value.NULL else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { NULL -> Known.NULL @@ -7357,7 +10102,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TaxAmount]. */ + class Builder internal constructor() { private var amount: JsonField? = null private var taxRateDescription: JsonField? = null @@ -7454,17 +10200,17 @@ private constructor( return true } - return /* spotless:off */ other is LineItem && id == other.id && amount == other.amount && discount == other.discount && endDate == other.endDate && grouping == other.grouping && maximum == other.maximum && maximumAmount == other.maximumAmount && minimum == other.minimum && minimumAmount == other.minimumAmount && name == other.name && price == other.price && quantity == other.quantity && startDate == other.startDate && subLineItems == other.subLineItems && subtotal == other.subtotal && taxAmounts == other.taxAmounts && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is LineItem && id == other.id && adjustedSubtotal == other.adjustedSubtotal && adjustments == other.adjustments && amount == other.amount && creditsApplied == other.creditsApplied && discount == other.discount && endDate == other.endDate && grouping == other.grouping && maximum == other.maximum && maximumAmount == other.maximumAmount && minimum == other.minimum && minimumAmount == other.minimumAmount && name == other.name && partiallyInvoicedAmount == other.partiallyInvoicedAmount && price == other.price && quantity == other.quantity && startDate == other.startDate && subLineItems == other.subLineItems && subtotal == other.subtotal && taxAmounts == other.taxAmounts && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, amount, discount, endDate, grouping, maximum, maximumAmount, minimum, minimumAmount, name, price, quantity, startDate, subLineItems, subtotal, taxAmounts, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, adjustedSubtotal, adjustments, amount, creditsApplied, discount, endDate, grouping, maximum, maximumAmount, minimum, minimumAmount, name, partiallyInvoicedAmount, price, quantity, startDate, subLineItems, subtotal, taxAmounts, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "LineItem{id=$id, amount=$amount, discount=$discount, endDate=$endDate, grouping=$grouping, maximum=$maximum, maximumAmount=$maximumAmount, minimum=$minimum, minimumAmount=$minimumAmount, name=$name, price=$price, quantity=$quantity, startDate=$startDate, subLineItems=$subLineItems, subtotal=$subtotal, taxAmounts=$taxAmounts, additionalProperties=$additionalProperties}" + "LineItem{id=$id, adjustedSubtotal=$adjustedSubtotal, adjustments=$adjustments, amount=$amount, creditsApplied=$creditsApplied, discount=$discount, endDate=$endDate, grouping=$grouping, maximum=$maximum, maximumAmount=$maximumAmount, minimum=$minimum, minimumAmount=$minimumAmount, name=$name, partiallyInvoicedAmount=$partiallyInvoicedAmount, price=$price, quantity=$quantity, startDate=$startDate, subLineItems=$subLineItems, subtotal=$subtotal, taxAmounts=$taxAmounts, additionalProperties=$additionalProperties}" } @NoAutoDetect @@ -7527,7 +10273,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Maximum]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var maximumAmount: JsonField? = null @@ -7659,7 +10406,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -7767,7 +10515,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Minimum]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var minimumAmount: JsonField? = null @@ -7960,7 +10709,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [PaymentAttempt]. */ + class Builder internal constructor() { private var id: JsonField? = null private var amount: JsonField? = null @@ -8071,6 +10821,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -8080,21 +10838,51 @@ private constructor( @JvmStatic fun of(value: String) = PaymentProvider(JsonField.of(value)) } + /** An enum containing [PaymentProvider]'s known values. */ enum class Known { STRIPE, } + /** + * An enum containing [PaymentProvider]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [PaymentProvider] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { STRIPE, + /** + * An enum member indicating that [PaymentProvider] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { STRIPE -> Value.STRIPE else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { STRIPE -> Known.STRIPE @@ -8214,7 +11002,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [ShippingAddress]. */ + class Builder internal constructor() { private var city: JsonField? = null private var country: JsonField? = null @@ -8326,6 +11115,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -8343,6 +11140,7 @@ private constructor( @JvmStatic fun of(value: String) = Status(JsonField.of(value)) } + /** An enum containing [Status]'s known values. */ enum class Known { ISSUED, PAID, @@ -8351,15 +11149,32 @@ private constructor( DRAFT, } + /** + * An enum containing [Status]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Status] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ISSUED, PAID, SYNCED, VOID, DRAFT, + /** An enum member indicating that [Status] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { ISSUED -> Value.ISSUED @@ -8370,6 +11185,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { ISSUED -> Known.ISSUED @@ -8430,7 +11253,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Subscription]. */ + class Builder internal constructor() { private var id: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceIssueParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceIssueParams.kt index 09b44e41..6b1a1f77 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceIssueParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceIssueParams.kt @@ -11,6 +11,7 @@ import com.withorb.api.core.JsonField import com.withorb.api.core.JsonMissing import com.withorb.api.core.JsonValue import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -27,12 +28,12 @@ import java.util.Optional * providers, etc). */ class InvoiceIssueParams -constructor( +private constructor( private val invoiceId: String, private val body: InvoiceIssueBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun invoiceId(): String = invoiceId @@ -58,11 +59,11 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getBody(): InvoiceIssueBody = body + @JvmSynthetic internal fun _body(): InvoiceIssueBody = body - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun getPathParam(index: Int): String { return when (index) { @@ -123,7 +124,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoiceIssueBody]. */ + class Builder internal constructor() { private var synchronous: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -202,8 +204,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [InvoiceIssueParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var invoiceId: String? = null private var body: InvoiceIssueBody.Builder = InvoiceIssueBody.builder() diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceLevelDiscount.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceLevelDiscount.kt index 1a430929..79bf10f9 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceLevelDiscount.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceLevelDiscount.kt @@ -112,6 +112,10 @@ private constructor( @JvmStatic fun ofTrial(trial: TrialDiscount) = InvoiceLevelDiscount(trial = trial) } + /** + * An interface that defines how to map each variant of [InvoiceLevelDiscount] to a value of + * type [T]. + */ interface Visitor { fun visitPercentage(percentage: PercentageDiscount): T @@ -120,12 +124,23 @@ private constructor( fun visitTrial(trial: TrialDiscount): T + /** + * Maps an unknown variant of [InvoiceLevelDiscount] to a value of type [T]. + * + * An instance of [InvoiceLevelDiscount] can contain an unknown variant if it was + * deserialized from data that doesn't match any known variant. For example, if the SDK is + * on an older version than the API, then the API may respond with new variants that the SDK + * is unaware of. + * + * @throws OrbInvalidDataException in the default implementation. + */ fun unknown(json: JsonValue?): T { throw OrbInvalidDataException("Unknown InvoiceLevelDiscount: $json") } } - class Deserializer : BaseDeserializer(InvoiceLevelDiscount::class) { + internal class Deserializer : + BaseDeserializer(InvoiceLevelDiscount::class) { override fun ObjectCodec.deserialize(node: JsonNode): InvoiceLevelDiscount { val json = JsonValue.fromJsonNode(node) @@ -157,7 +172,7 @@ private constructor( } } - class Serializer : BaseSerializer(InvoiceLevelDiscount::class) { + internal class Serializer : BaseSerializer(InvoiceLevelDiscount::class) { override fun serialize( value: InvoiceLevelDiscount, diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceLineItemCreateParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceLineItemCreateParams.kt index 115178d8..25ed1d55 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceLineItemCreateParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceLineItemCreateParams.kt @@ -11,6 +11,7 @@ import com.withorb.api.core.JsonField import com.withorb.api.core.JsonMissing import com.withorb.api.core.JsonValue import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -24,11 +25,11 @@ import java.util.Objects * invoices that are in a `draft` status. */ class InvoiceLineItemCreateParams -constructor( +private constructor( private val body: InvoiceLineItemCreateBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { /** The total amount in the invoice's currency to add to the line item. */ fun amount(): String = body.amount() @@ -78,11 +79,11 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getBody(): InvoiceLineItemCreateBody = body + @JvmSynthetic internal fun _body(): InvoiceLineItemCreateBody = body - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams @NoAutoDetect class InvoiceLineItemCreateBody @@ -181,7 +182,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoiceLineItemCreateBody]. */ + class Builder internal constructor() { private var amount: JsonField? = null private var endDate: JsonField? = null @@ -300,8 +302,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [InvoiceLineItemCreateParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var body: InvoiceLineItemCreateBody.Builder = InvoiceLineItemCreateBody.builder() private var additionalHeaders: Headers.Builder = Headers.builder() 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 1074c6bc..0a16816d 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 @@ -36,9 +36,18 @@ class InvoiceLineItemCreateResponse @JsonCreator private constructor( @JsonProperty("id") @ExcludeMissing private val id: JsonField = JsonMissing.of(), + @JsonProperty("adjusted_subtotal") + @ExcludeMissing + private val adjustedSubtotal: JsonField = JsonMissing.of(), + @JsonProperty("adjustments") + @ExcludeMissing + private val adjustments: JsonField> = JsonMissing.of(), @JsonProperty("amount") @ExcludeMissing private val amount: JsonField = JsonMissing.of(), + @JsonProperty("credits_applied") + @ExcludeMissing + private val creditsApplied: JsonField = JsonMissing.of(), @JsonProperty("discount") @ExcludeMissing private val discount: JsonField = JsonMissing.of(), @@ -61,6 +70,9 @@ private constructor( @ExcludeMissing private val minimumAmount: JsonField = JsonMissing.of(), @JsonProperty("name") @ExcludeMissing private val name: JsonField = JsonMissing.of(), + @JsonProperty("partially_invoiced_amount") + @ExcludeMissing + private val partiallyInvoicedAmount: JsonField = JsonMissing.of(), @JsonProperty("price") @ExcludeMissing private val price: JsonField = JsonMissing.of(), @JsonProperty("quantity") @ExcludeMissing @@ -83,9 +95,21 @@ private constructor( /** A unique ID for this line item. */ fun id(): String = id.getRequired("id") + /** + * The line amount after any adjustments, before overage conversion, credits and partial + * invoicing. + */ + fun adjustedSubtotal(): String = adjustedSubtotal.getRequired("adjusted_subtotal") + + /** All adjustments applied to the line item. */ + fun adjustments(): List = adjustments.getRequired("adjustments") + /** The final amount after any discounts or minimums. */ fun amount(): String = amount.getRequired("amount") + /** The number of credits used */ + fun creditsApplied(): String = creditsApplied.getRequired("credits_applied") + fun discount(): Optional = Optional.ofNullable(discount.getNullable("discount")) /** The end date of the range of time applied for this line item's price. */ @@ -98,19 +122,31 @@ private constructor( */ fun grouping(): Optional = Optional.ofNullable(grouping.getNullable("grouping")) + /** This field is deprecated in favor of `adjustments`. */ + @Deprecated("deprecated") fun maximum(): Optional = Optional.ofNullable(maximum.getNullable("maximum")) + /** This field is deprecated in favor of `adjustments`. */ + @Deprecated("deprecated") fun maximumAmount(): Optional = Optional.ofNullable(maximumAmount.getNullable("maximum_amount")) + /** This field is deprecated in favor of `adjustments`. */ + @Deprecated("deprecated") fun minimum(): Optional = Optional.ofNullable(minimum.getNullable("minimum")) + /** This field is deprecated in favor of `adjustments`. */ + @Deprecated("deprecated") fun minimumAmount(): Optional = Optional.ofNullable(minimumAmount.getNullable("minimum_amount")) /** The name of the price associated with this line item. */ fun name(): String = name.getRequired("name") + /** Any amount applied from a partial invoice */ + fun partiallyInvoicedAmount(): String = + partiallyInvoicedAmount.getRequired("partially_invoiced_amount") + /** * 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 @@ -147,9 +183,27 @@ private constructor( /** A unique ID for this line item. */ @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + /** + * The line amount after any adjustments, before overage conversion, credits and partial + * invoicing. + */ + @JsonProperty("adjusted_subtotal") + @ExcludeMissing + fun _adjustedSubtotal(): JsonField = adjustedSubtotal + + /** All adjustments applied to the line item. */ + @JsonProperty("adjustments") + @ExcludeMissing + fun _adjustments(): JsonField> = adjustments + /** The final amount after any discounts or minimums. */ @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount + /** The number of credits used */ + @JsonProperty("credits_applied") + @ExcludeMissing + fun _creditsApplied(): JsonField = creditsApplied + @JsonProperty("discount") @ExcludeMissing fun _discount(): JsonField = discount /** The end date of the range of time applied for this line item's price. */ @@ -162,14 +216,26 @@ private constructor( */ @JsonProperty("grouping") @ExcludeMissing fun _grouping(): JsonField = grouping - @JsonProperty("maximum") @ExcludeMissing fun _maximum(): JsonField = maximum + /** This field is deprecated in favor of `adjustments`. */ + @Deprecated("deprecated") + @JsonProperty("maximum") + @ExcludeMissing + fun _maximum(): JsonField = maximum + /** This field is deprecated in favor of `adjustments`. */ + @Deprecated("deprecated") @JsonProperty("maximum_amount") @ExcludeMissing fun _maximumAmount(): JsonField = maximumAmount - @JsonProperty("minimum") @ExcludeMissing fun _minimum(): JsonField = minimum + /** This field is deprecated in favor of `adjustments`. */ + @Deprecated("deprecated") + @JsonProperty("minimum") + @ExcludeMissing + fun _minimum(): JsonField = minimum + /** This field is deprecated in favor of `adjustments`. */ + @Deprecated("deprecated") @JsonProperty("minimum_amount") @ExcludeMissing fun _minimumAmount(): JsonField = minimumAmount @@ -177,6 +243,11 @@ private constructor( /** The name of the price associated with this line item. */ @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + /** Any amount applied from a partial invoice */ + @JsonProperty("partially_invoiced_amount") + @ExcludeMissing + fun _partiallyInvoicedAmount(): JsonField = partiallyInvoicedAmount + /** * 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 @@ -228,7 +299,10 @@ private constructor( } id() + adjustedSubtotal() + adjustments().forEach { it.validate() } amount() + creditsApplied() discount().ifPresent { it.validate() } endDate() grouping() @@ -237,6 +311,7 @@ private constructor( minimum().ifPresent { it.validate() } minimumAmount() name() + partiallyInvoicedAmount() price().ifPresent { it.validate() } quantity() startDate() @@ -253,10 +328,14 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoiceLineItemCreateResponse]. */ + class Builder internal constructor() { private var id: JsonField? = null + private var adjustedSubtotal: JsonField? = null + private var adjustments: JsonField>? = null private var amount: JsonField? = null + private var creditsApplied: JsonField? = null private var discount: JsonField? = null private var endDate: JsonField? = null private var grouping: JsonField? = null @@ -265,6 +344,7 @@ private constructor( private var minimum: JsonField? = null private var minimumAmount: JsonField? = null private var name: JsonField? = null + private var partiallyInvoicedAmount: JsonField? = null private var price: JsonField? = null private var quantity: JsonField? = null private var startDate: JsonField? = null @@ -276,7 +356,10 @@ private constructor( @JvmSynthetic internal fun from(invoiceLineItemCreateResponse: InvoiceLineItemCreateResponse) = apply { id = invoiceLineItemCreateResponse.id + adjustedSubtotal = invoiceLineItemCreateResponse.adjustedSubtotal + adjustments = invoiceLineItemCreateResponse.adjustments.map { it.toMutableList() } amount = invoiceLineItemCreateResponse.amount + creditsApplied = invoiceLineItemCreateResponse.creditsApplied discount = invoiceLineItemCreateResponse.discount endDate = invoiceLineItemCreateResponse.endDate grouping = invoiceLineItemCreateResponse.grouping @@ -285,6 +368,7 @@ private constructor( minimum = invoiceLineItemCreateResponse.minimum minimumAmount = invoiceLineItemCreateResponse.minimumAmount name = invoiceLineItemCreateResponse.name + partiallyInvoicedAmount = invoiceLineItemCreateResponse.partiallyInvoicedAmount price = invoiceLineItemCreateResponse.price quantity = invoiceLineItemCreateResponse.quantity startDate = invoiceLineItemCreateResponse.startDate @@ -300,12 +384,77 @@ private constructor( /** A unique ID for this line item. */ fun id(id: JsonField) = apply { this.id = id } + /** + * The line amount after any adjustments, before overage conversion, credits and partial + * invoicing. + */ + fun adjustedSubtotal(adjustedSubtotal: String) = + adjustedSubtotal(JsonField.of(adjustedSubtotal)) + + /** + * The line amount after any adjustments, before overage conversion, credits and partial + * invoicing. + */ + fun adjustedSubtotal(adjustedSubtotal: JsonField) = apply { + this.adjustedSubtotal = adjustedSubtotal + } + + /** All adjustments applied to the line item. */ + fun adjustments(adjustments: List) = adjustments(JsonField.of(adjustments)) + + /** All adjustments applied to the line item. */ + fun adjustments(adjustments: JsonField>) = apply { + this.adjustments = adjustments.map { it.toMutableList() } + } + + /** All adjustments applied to the line item. */ + fun addAdjustment(adjustment: Adjustment) = apply { + adjustments = + (adjustments ?: JsonField.of(mutableListOf())).apply { + asKnown() + .orElseThrow { + IllegalStateException( + "Field was set to non-list type: ${javaClass.simpleName}" + ) + } + .add(adjustment) + } + } + + /** All adjustments applied to the line item. */ + fun addAdjustment(amountDiscount: Adjustment.AmountDiscountAdjustment) = + addAdjustment(Adjustment.ofAmountDiscount(amountDiscount)) + + /** All adjustments applied to the line item. */ + fun addAdjustment(percentageDiscount: Adjustment.PercentageDiscountAdjustment) = + addAdjustment(Adjustment.ofPercentageDiscount(percentageDiscount)) + + /** All adjustments applied to the line item. */ + fun addAdjustment(usageDiscount: Adjustment.UsageDiscountAdjustment) = + addAdjustment(Adjustment.ofUsageDiscount(usageDiscount)) + + /** All adjustments applied to the line item. */ + fun addAdjustment(minimum: Adjustment.MinimumAdjustment) = + addAdjustment(Adjustment.ofMinimum(minimum)) + + /** All adjustments applied to the line item. */ + fun addAdjustment(maximum: Adjustment.MaximumAdjustment) = + addAdjustment(Adjustment.ofMaximum(maximum)) + /** The final amount after any discounts or minimums. */ fun amount(amount: String) = amount(JsonField.of(amount)) /** The final amount after any discounts or minimums. */ fun amount(amount: JsonField) = apply { this.amount = amount } + /** The number of credits used */ + fun creditsApplied(creditsApplied: String) = creditsApplied(JsonField.of(creditsApplied)) + + /** The number of credits used */ + fun creditsApplied(creditsApplied: JsonField) = apply { + this.creditsApplied = creditsApplied + } + fun discount(discount: Discount?) = discount(JsonField.ofNullable(discount)) fun discount(discount: Optional) = discount(discount.orElse(null)) @@ -316,6 +465,14 @@ private constructor( fun discount(trial: TrialDiscount) = discount(Discount.ofTrial(trial)) + fun trialDiscount(appliesToPriceIds: List) = + discount( + TrialDiscount.builder() + .discountType(TrialDiscount.DiscountType.TRIAL) + .appliesToPriceIds(appliesToPriceIds) + .build() + ) + fun discount(usage: Discount.UsageDiscount) = discount(Discount.ofUsage(usage)) fun discount(amount: AmountDiscount) = discount(Discount.ofAmount(amount)) @@ -347,34 +504,58 @@ private constructor( */ fun grouping(grouping: JsonField) = apply { this.grouping = grouping } + /** This field is deprecated in favor of `adjustments`. */ + @Deprecated("deprecated") fun maximum(maximum: Maximum?) = maximum(JsonField.ofNullable(maximum)) + /** This field is deprecated in favor of `adjustments`. */ + @Deprecated("deprecated") fun maximum(maximum: Optional) = maximum(maximum.orElse(null)) + /** This field is deprecated in favor of `adjustments`. */ + @Deprecated("deprecated") fun maximum(maximum: JsonField) = apply { this.maximum = maximum } + /** This field is deprecated in favor of `adjustments`. */ + @Deprecated("deprecated") fun maximumAmount(maximumAmount: String?) = maximumAmount(JsonField.ofNullable(maximumAmount)) + /** This field is deprecated in favor of `adjustments`. */ + @Deprecated("deprecated") fun maximumAmount(maximumAmount: Optional) = maximumAmount(maximumAmount.orElse(null)) + /** This field is deprecated in favor of `adjustments`. */ + @Deprecated("deprecated") fun maximumAmount(maximumAmount: JsonField) = apply { this.maximumAmount = maximumAmount } + /** This field is deprecated in favor of `adjustments`. */ + @Deprecated("deprecated") fun minimum(minimum: Minimum?) = minimum(JsonField.ofNullable(minimum)) + /** This field is deprecated in favor of `adjustments`. */ + @Deprecated("deprecated") fun minimum(minimum: Optional) = minimum(minimum.orElse(null)) + /** This field is deprecated in favor of `adjustments`. */ + @Deprecated("deprecated") fun minimum(minimum: JsonField) = apply { this.minimum = minimum } + /** This field is deprecated in favor of `adjustments`. */ + @Deprecated("deprecated") fun minimumAmount(minimumAmount: String?) = minimumAmount(JsonField.ofNullable(minimumAmount)) + /** This field is deprecated in favor of `adjustments`. */ + @Deprecated("deprecated") fun minimumAmount(minimumAmount: Optional) = minimumAmount(minimumAmount.orElse(null)) + /** This field is deprecated in favor of `adjustments`. */ + @Deprecated("deprecated") fun minimumAmount(minimumAmount: JsonField) = apply { this.minimumAmount = minimumAmount } @@ -385,6 +566,15 @@ private constructor( /** The name of the price associated with this line item. */ fun name(name: JsonField) = apply { this.name = name } + /** Any amount applied from a partial invoice */ + fun partiallyInvoicedAmount(partiallyInvoicedAmount: String) = + partiallyInvoicedAmount(JsonField.of(partiallyInvoicedAmount)) + + /** Any amount applied from a partial invoice */ + fun partiallyInvoicedAmount(partiallyInvoicedAmount: JsonField) = apply { + this.partiallyInvoicedAmount = partiallyInvoicedAmount + } + /** * 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 @@ -794,6 +984,36 @@ private constructor( fun price(maxGroupTieredPackage: Price.MaxGroupTieredPackagePrice) = price(Price.ofMaxGroupTieredPackage(maxGroupTieredPackage)) + /** + * The Price resource represents a price that can be billed on a subscription, resulting in + * a charge on an invoice in the form of an invoice line item. Prices take a quantity and + * determine an amount to bill. + * + * Orb supports a few different pricing models out of the box. Each of these models is + * serialized differently in a given Price object. The model_type field determines the key + * for the configuration object that is present. + * + * For more on the types of prices, see + * [the core concepts documentation](/core-concepts#plan-and-price) + */ + fun price(scalableMatrixWithUnitPricing: Price.ScalableMatrixWithUnitPricingPrice) = + price(Price.ofScalableMatrixWithUnitPricing(scalableMatrixWithUnitPricing)) + + /** + * The Price resource represents a price that can be billed on a subscription, resulting in + * a charge on an invoice in the form of an invoice line item. Prices take a quantity and + * determine an amount to bill. + * + * Orb supports a few different pricing models out of the box. Each of these models is + * serialized differently in a given Price object. The model_type field determines the key + * for the configuration object that is present. + * + * For more on the types of prices, see + * [the core concepts documentation](/core-concepts#plan-and-price) + */ + fun price(scalableMatrixWithTieredPricing: Price.ScalableMatrixWithTieredPricingPrice) = + price(Price.ofScalableMatrixWithTieredPricing(scalableMatrixWithTieredPricing)) + fun quantity(quantity: Double) = quantity(JsonField.of(quantity)) fun quantity(quantity: JsonField) = apply { this.quantity = quantity } @@ -915,7 +1135,10 @@ private constructor( fun build(): InvoiceLineItemCreateResponse = InvoiceLineItemCreateResponse( checkRequired("id", id), + checkRequired("adjustedSubtotal", adjustedSubtotal), + checkRequired("adjustments", adjustments).map { it.toImmutable() }, checkRequired("amount", amount), + checkRequired("creditsApplied", creditsApplied), checkRequired("discount", discount), checkRequired("endDate", endDate), checkRequired("grouping", grouping), @@ -924,6 +1147,7 @@ private constructor( checkRequired("minimum", minimum), checkRequired("minimumAmount", minimumAmount), checkRequired("name", name), + checkRequired("partiallyInvoicedAmount", partiallyInvoicedAmount), checkRequired("price", price), checkRequired("quantity", quantity), checkRequired("startDate", startDate), @@ -934,144 +1158,98 @@ private constructor( ) } - @NoAutoDetect - class Maximum - @JsonCreator + @JsonDeserialize(using = Adjustment.Deserializer::class) + @JsonSerialize(using = Adjustment.Serializer::class) + class Adjustment 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(), + private val amountDiscount: AmountDiscountAdjustment? = null, + private val percentageDiscount: PercentageDiscountAdjustment? = null, + private val usageDiscount: UsageDiscountAdjustment? = null, + private val minimum: MinimumAdjustment? = null, + private val maximum: MaximumAdjustment? = null, + private val _json: JsonValue? = null, ) { - /** - * 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") + fun amountDiscount(): Optional = + Optional.ofNullable(amountDiscount) - /** Maximum amount applied */ - fun maximumAmount(): String = maximumAmount.getRequired("maximum_amount") + fun percentageDiscount(): Optional = + Optional.ofNullable(percentageDiscount) - /** - * 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 + fun usageDiscount(): Optional = Optional.ofNullable(usageDiscount) - /** Maximum amount applied */ - @JsonProperty("maximum_amount") - @ExcludeMissing - fun _maximumAmount(): JsonField = maximumAmount + fun minimum(): Optional = Optional.ofNullable(minimum) - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = additionalProperties + fun maximum(): Optional = Optional.ofNullable(maximum) - private var validated: Boolean = false + fun isAmountDiscount(): Boolean = amountDiscount != null - fun validate(): Maximum = apply { - if (validated) { - return@apply - } + fun isPercentageDiscount(): Boolean = percentageDiscount != null - appliesToPriceIds() - maximumAmount() - validated = true - } + fun isUsageDiscount(): Boolean = usageDiscount != null - fun toBuilder() = Builder().from(this) + fun isMinimum(): Boolean = minimum != null - companion object { + fun isMaximum(): Boolean = maximum != null - @JvmStatic fun builder() = Builder() - } + fun asAmountDiscount(): AmountDiscountAdjustment = + amountDiscount.getOrThrow("amountDiscount") - class Builder { + fun asPercentageDiscount(): PercentageDiscountAdjustment = + percentageDiscount.getOrThrow("percentageDiscount") - private var appliesToPriceIds: JsonField>? = null - private var maximumAmount: JsonField? = null - private var additionalProperties: MutableMap = mutableMapOf() + fun asUsageDiscount(): UsageDiscountAdjustment = usageDiscount.getOrThrow("usageDiscount") - @JvmSynthetic - internal fun from(maximum: Maximum) = apply { - appliesToPriceIds = maximum.appliesToPriceIds.map { it.toMutableList() } - maximumAmount = maximum.maximumAmount - additionalProperties = maximum.additionalProperties.toMutableMap() - } + fun asMinimum(): MinimumAdjustment = minimum.getOrThrow("minimum") - /** - * 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)) + fun asMaximum(): MaximumAdjustment = maximum.getOrThrow("maximum") - /** - * 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() } - } + fun _json(): Optional = Optional.ofNullable(_json) - /** - * 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) - } + fun accept(visitor: Visitor): T { + return when { + amountDiscount != null -> visitor.visitAmountDiscount(amountDiscount) + percentageDiscount != null -> visitor.visitPercentageDiscount(percentageDiscount) + usageDiscount != null -> visitor.visitUsageDiscount(usageDiscount) + minimum != null -> visitor.visitMinimum(minimum) + maximum != null -> visitor.visitMaximum(maximum) + else -> visitor.unknown(_json) } + } - /** Maximum amount applied */ - fun maximumAmount(maximumAmount: String) = maximumAmount(JsonField.of(maximumAmount)) - - /** Maximum amount applied */ - fun maximumAmount(maximumAmount: JsonField) = apply { - this.maximumAmount = maximumAmount - } + private var validated: Boolean = false - fun additionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.clear() - putAllAdditionalProperties(additionalProperties) + fun validate(): Adjustment = apply { + if (validated) { + return@apply } - fun putAdditionalProperty(key: String, value: JsonValue) = apply { - additionalProperties.put(key, value) - } + accept( + object : Visitor { + override fun visitAmountDiscount(amountDiscount: AmountDiscountAdjustment) { + amountDiscount.validate() + } - fun putAllAdditionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.putAll(additionalProperties) - } + override fun visitPercentageDiscount( + percentageDiscount: PercentageDiscountAdjustment + ) { + percentageDiscount.validate() + } - fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + override fun visitUsageDiscount(usageDiscount: UsageDiscountAdjustment) { + usageDiscount.validate() + } - fun removeAllAdditionalProperties(keys: Set) = apply { - keys.forEach(::removeAdditionalProperty) - } + override fun visitMinimum(minimum: MinimumAdjustment) { + minimum.validate() + } - fun build(): Maximum = - Maximum( - checkRequired("appliesToPriceIds", appliesToPriceIds).map { it.toImmutable() }, - checkRequired("maximumAmount", maximumAmount), - additionalProperties.toImmutable(), - ) + override fun visitMaximum(maximum: MaximumAdjustment) { + maximum.validate() + } + } + ) + validated = true } override fun equals(other: Any?): Boolean { @@ -1079,55 +1257,2266 @@ private constructor( return true } - return /* spotless:off */ other is Maximum && appliesToPriceIds == other.appliesToPriceIds && maximumAmount == other.maximumAmount && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Adjustment && amountDiscount == other.amountDiscount && percentageDiscount == other.percentageDiscount && usageDiscount == other.usageDiscount && minimum == other.minimum && maximum == other.maximum /* spotless:on */ } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, maximumAmount, additionalProperties) } - /* spotless:on */ + override fun hashCode(): Int = /* spotless:off */ Objects.hash(amountDiscount, percentageDiscount, usageDiscount, minimum, maximum) /* spotless:on */ - override fun hashCode(): Int = hashCode + override fun toString(): String = + when { + amountDiscount != null -> "Adjustment{amountDiscount=$amountDiscount}" + percentageDiscount != null -> "Adjustment{percentageDiscount=$percentageDiscount}" + usageDiscount != null -> "Adjustment{usageDiscount=$usageDiscount}" + minimum != null -> "Adjustment{minimum=$minimum}" + maximum != null -> "Adjustment{maximum=$maximum}" + _json != null -> "Adjustment{_unknown=$_json}" + else -> throw IllegalStateException("Invalid Adjustment") + } - override fun toString() = - "Maximum{appliesToPriceIds=$appliesToPriceIds, maximumAmount=$maximumAmount, additionalProperties=$additionalProperties}" - } + companion object { - @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(), - ) { + @JvmStatic + fun ofAmountDiscount(amountDiscount: AmountDiscountAdjustment) = + Adjustment(amountDiscount = amountDiscount) - /** - * 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") + @JvmStatic + fun ofPercentageDiscount(percentageDiscount: PercentageDiscountAdjustment) = + Adjustment(percentageDiscount = percentageDiscount) - /** Minimum amount applied */ - fun minimumAmount(): String = minimumAmount.getRequired("minimum_amount") + @JvmStatic + fun ofUsageDiscount(usageDiscount: UsageDiscountAdjustment) = + Adjustment(usageDiscount = usageDiscount) + + @JvmStatic fun ofMinimum(minimum: MinimumAdjustment) = Adjustment(minimum = minimum) + + @JvmStatic fun ofMaximum(maximum: MaximumAdjustment) = Adjustment(maximum = maximum) + } /** - * List of price_ids that this minimum amount applies to. For plan/plan phase minimums, this - * can be a subset of prices. + * An interface that defines how to map each variant of [Adjustment] to a value of type [T]. */ - @JsonProperty("applies_to_price_ids") - @ExcludeMissing - fun _appliesToPriceIds(): JsonField> = appliesToPriceIds + interface Visitor { - /** Minimum amount applied */ - @JsonProperty("minimum_amount") - @ExcludeMissing - fun _minimumAmount(): JsonField = minimumAmount + fun visitAmountDiscount(amountDiscount: AmountDiscountAdjustment): T + + fun visitPercentageDiscount(percentageDiscount: PercentageDiscountAdjustment): T + + fun visitUsageDiscount(usageDiscount: UsageDiscountAdjustment): T + + fun visitMinimum(minimum: MinimumAdjustment): T + + fun visitMaximum(maximum: MaximumAdjustment): T + + /** + * Maps an unknown variant of [Adjustment] to a value of type [T]. + * + * An instance of [Adjustment] can contain an unknown variant if it was deserialized + * from data that doesn't match any known variant. For example, if the SDK is on an + * older version than the API, then the API may respond with new variants that the SDK + * is unaware of. + * + * @throws OrbInvalidDataException in the default implementation. + */ + fun unknown(json: JsonValue?): T { + throw OrbInvalidDataException("Unknown Adjustment: $json") + } + } + + internal class Deserializer : BaseDeserializer(Adjustment::class) { + + override fun ObjectCodec.deserialize(node: JsonNode): Adjustment { + val json = JsonValue.fromJsonNode(node) + val adjustmentType = + json.asObject().getOrNull()?.get("adjustment_type")?.asString()?.getOrNull() + + when (adjustmentType) { + "amount_discount" -> { + tryDeserialize(node, jacksonTypeRef()) { + it.validate() + } + ?.let { + return Adjustment(amountDiscount = it, _json = json) + } + } + "percentage_discount" -> { + tryDeserialize(node, jacksonTypeRef()) { + it.validate() + } + ?.let { + return Adjustment(percentageDiscount = it, _json = json) + } + } + "usage_discount" -> { + tryDeserialize(node, jacksonTypeRef()) { + it.validate() + } + ?.let { + return Adjustment(usageDiscount = it, _json = json) + } + } + "minimum" -> { + tryDeserialize(node, jacksonTypeRef()) { it.validate() } + ?.let { + return Adjustment(minimum = it, _json = json) + } + } + "maximum" -> { + tryDeserialize(node, jacksonTypeRef()) { it.validate() } + ?.let { + return Adjustment(maximum = it, _json = json) + } + } + } + + return Adjustment(_json = json) + } + } + + internal class Serializer : BaseSerializer(Adjustment::class) { + + override fun serialize( + value: Adjustment, + generator: JsonGenerator, + provider: SerializerProvider + ) { + when { + value.amountDiscount != null -> generator.writeObject(value.amountDiscount) + value.percentageDiscount != null -> + generator.writeObject(value.percentageDiscount) + value.usageDiscount != null -> generator.writeObject(value.usageDiscount) + value.minimum != null -> generator.writeObject(value.minimum) + value.maximum != null -> generator.writeObject(value.maximum) + value._json != null -> generator.writeObject(value._json) + else -> throw IllegalStateException("Invalid Adjustment") + } + } + } + + @NoAutoDetect + class AmountDiscountAdjustment + @JsonCreator + private constructor( + @JsonProperty("id") + @ExcludeMissing + private val id: JsonField = JsonMissing.of(), + @JsonProperty("adjustment_type") + @ExcludeMissing + private val adjustmentType: JsonField = JsonMissing.of(), + @JsonProperty("amount_discount") + @ExcludeMissing + private val amountDiscount: JsonField = JsonMissing.of(), + @JsonProperty("applies_to_price_ids") + @ExcludeMissing + private val appliesToPriceIds: JsonField> = JsonMissing.of(), + @JsonProperty("is_invoice_level") + @ExcludeMissing + private val isInvoiceLevel: JsonField = JsonMissing.of(), + @JsonProperty("plan_phase_order") + @ExcludeMissing + private val planPhaseOrder: JsonField = JsonMissing.of(), + @JsonProperty("reason") + @ExcludeMissing + private val reason: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { + + fun id(): String = id.getRequired("id") + + fun adjustmentType(): AdjustmentType = adjustmentType.getRequired("adjustment_type") + + /** + * The amount by which to discount the prices this adjustment applies to in a given + * billing period. + */ + fun amountDiscount(): String = amountDiscount.getRequired("amount_discount") + + /** The price IDs that this adjustment applies to. */ + fun appliesToPriceIds(): List = + appliesToPriceIds.getRequired("applies_to_price_ids") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + + /** The reason for the adjustment. */ + fun reason(): Optional = Optional.ofNullable(reason.getNullable("reason")) + + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + @JsonProperty("adjustment_type") + @ExcludeMissing + fun _adjustmentType(): JsonField = adjustmentType + + /** + * The amount by which to discount the prices this adjustment applies to in a given + * billing period. + */ + @JsonProperty("amount_discount") + @ExcludeMissing + fun _amountDiscount(): JsonField = amountDiscount + + /** The price IDs that this adjustment applies to. */ + @JsonProperty("applies_to_price_ids") + @ExcludeMissing + fun _appliesToPriceIds(): JsonField> = appliesToPriceIds + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel(): JsonField = isInvoiceLevel + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun _planPhaseOrder(): JsonField = planPhaseOrder + + /** The reason for the adjustment. */ + @JsonProperty("reason") @ExcludeMissing fun _reason(): JsonField = reason + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): AmountDiscountAdjustment = apply { + if (validated) { + return@apply + } + + id() + adjustmentType() + amountDiscount() + appliesToPriceIds() + isInvoiceLevel() + planPhaseOrder() + reason() + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + /** A builder for [AmountDiscountAdjustment]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var adjustmentType: JsonField? = null + private var amountDiscount: JsonField? = null + private var appliesToPriceIds: JsonField>? = null + private var isInvoiceLevel: JsonField? = null + private var planPhaseOrder: JsonField? = null + private var reason: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(amountDiscountAdjustment: AmountDiscountAdjustment) = apply { + id = amountDiscountAdjustment.id + adjustmentType = amountDiscountAdjustment.adjustmentType + amountDiscount = amountDiscountAdjustment.amountDiscount + appliesToPriceIds = + amountDiscountAdjustment.appliesToPriceIds.map { it.toMutableList() } + isInvoiceLevel = amountDiscountAdjustment.isInvoiceLevel + planPhaseOrder = amountDiscountAdjustment.planPhaseOrder + reason = amountDiscountAdjustment.reason + additionalProperties = + amountDiscountAdjustment.additionalProperties.toMutableMap() + } + + fun id(id: String) = id(JsonField.of(id)) + + fun id(id: JsonField) = apply { this.id = id } + + fun adjustmentType(adjustmentType: AdjustmentType) = + adjustmentType(JsonField.of(adjustmentType)) + + fun adjustmentType(adjustmentType: JsonField) = apply { + this.adjustmentType = adjustmentType + } + + /** + * The amount by which to discount the prices this adjustment applies to in a given + * billing period. + */ + fun amountDiscount(amountDiscount: String) = + amountDiscount(JsonField.of(amountDiscount)) + + /** + * The amount by which to discount the prices this adjustment applies to in a given + * billing period. + */ + fun amountDiscount(amountDiscount: JsonField) = apply { + this.amountDiscount = amountDiscount + } + + /** The price IDs that this adjustment applies to. */ + fun appliesToPriceIds(appliesToPriceIds: List) = + appliesToPriceIds(JsonField.of(appliesToPriceIds)) + + /** The price IDs that this adjustment applies to. */ + fun appliesToPriceIds(appliesToPriceIds: JsonField>) = apply { + this.appliesToPriceIds = appliesToPriceIds.map { it.toMutableList() } + } + + /** The price IDs that this adjustment applies to. */ + 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) + } + } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long?) = + planPhaseOrder(JsonField.ofNullable(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = planPhaseOrder(planPhaseOrder as Long?) + + /** The plan phase in which this adjustment is active. */ + @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 + fun planPhaseOrder(planPhaseOrder: Optional) = + planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + + /** The reason for the adjustment. */ + fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) + + /** The reason for the adjustment. */ + fun reason(reason: Optional) = reason(reason.orElse(null)) + + /** The reason for the adjustment. */ + fun reason(reason: JsonField) = apply { this.reason = reason } + + 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(): AmountDiscountAdjustment = + AmountDiscountAdjustment( + checkRequired("id", id), + checkRequired("adjustmentType", adjustmentType), + checkRequired("amountDiscount", amountDiscount), + checkRequired("appliesToPriceIds", appliesToPriceIds).map { + it.toImmutable() + }, + checkRequired("isInvoiceLevel", isInvoiceLevel), + checkRequired("planPhaseOrder", planPhaseOrder), + checkRequired("reason", reason), + additionalProperties.toImmutable(), + ) + } + + class AdjustmentType + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val AMOUNT_DISCOUNT = of("amount_discount") + + @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) + } + + /** An enum containing [AdjustmentType]'s known values. */ + enum class Known { + AMOUNT_DISCOUNT, + } + + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + AMOUNT_DISCOUNT, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + AMOUNT_DISCOUNT -> Value.AMOUNT_DISCOUNT + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + AMOUNT_DISCOUNT -> Known.AMOUNT_DISCOUNT + else -> throw OrbInvalidDataException("Unknown AdjustmentType: $value") + } + + fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is AdjustmentType && 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 AmountDiscountAdjustment && id == other.id && adjustmentType == other.adjustmentType && amountDiscount == other.amountDiscount && appliesToPriceIds == other.appliesToPriceIds && isInvoiceLevel == other.isInvoiceLevel && planPhaseOrder == other.planPhaseOrder && reason == other.reason && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(id, adjustmentType, amountDiscount, appliesToPriceIds, isInvoiceLevel, planPhaseOrder, reason, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "AmountDiscountAdjustment{id=$id, adjustmentType=$adjustmentType, amountDiscount=$amountDiscount, appliesToPriceIds=$appliesToPriceIds, isInvoiceLevel=$isInvoiceLevel, planPhaseOrder=$planPhaseOrder, reason=$reason, additionalProperties=$additionalProperties}" + } + + @NoAutoDetect + class PercentageDiscountAdjustment + @JsonCreator + private constructor( + @JsonProperty("id") + @ExcludeMissing + private val id: JsonField = JsonMissing.of(), + @JsonProperty("adjustment_type") + @ExcludeMissing + private val adjustmentType: JsonField = JsonMissing.of(), + @JsonProperty("applies_to_price_ids") + @ExcludeMissing + private val appliesToPriceIds: JsonField> = JsonMissing.of(), + @JsonProperty("is_invoice_level") + @ExcludeMissing + private val isInvoiceLevel: JsonField = JsonMissing.of(), + @JsonProperty("percentage_discount") + @ExcludeMissing + private val percentageDiscount: JsonField = JsonMissing.of(), + @JsonProperty("plan_phase_order") + @ExcludeMissing + private val planPhaseOrder: JsonField = JsonMissing.of(), + @JsonProperty("reason") + @ExcludeMissing + private val reason: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { + + fun id(): String = id.getRequired("id") + + fun adjustmentType(): AdjustmentType = adjustmentType.getRequired("adjustment_type") + + /** The price IDs that this adjustment applies to. */ + fun appliesToPriceIds(): List = + appliesToPriceIds.getRequired("applies_to_price_ids") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** + * The percentage (as a value between 0 and 1) by which to discount the price intervals + * this adjustment applies to in a given billing period. + */ + fun percentageDiscount(): Double = percentageDiscount.getRequired("percentage_discount") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + + /** The reason for the adjustment. */ + fun reason(): Optional = Optional.ofNullable(reason.getNullable("reason")) + + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + @JsonProperty("adjustment_type") + @ExcludeMissing + fun _adjustmentType(): JsonField = adjustmentType + + /** The price IDs that this adjustment applies to. */ + @JsonProperty("applies_to_price_ids") + @ExcludeMissing + fun _appliesToPriceIds(): JsonField> = appliesToPriceIds + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel(): JsonField = isInvoiceLevel + + /** + * The percentage (as a value between 0 and 1) by which to discount the price intervals + * this adjustment applies to in a given billing period. + */ + @JsonProperty("percentage_discount") + @ExcludeMissing + fun _percentageDiscount(): JsonField = percentageDiscount + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun _planPhaseOrder(): JsonField = planPhaseOrder + + /** The reason for the adjustment. */ + @JsonProperty("reason") @ExcludeMissing fun _reason(): JsonField = reason + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): PercentageDiscountAdjustment = apply { + if (validated) { + return@apply + } + + id() + adjustmentType() + appliesToPriceIds() + isInvoiceLevel() + percentageDiscount() + planPhaseOrder() + reason() + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + /** A builder for [PercentageDiscountAdjustment]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var adjustmentType: JsonField? = null + private var appliesToPriceIds: JsonField>? = null + private var isInvoiceLevel: JsonField? = null + private var percentageDiscount: JsonField? = null + private var planPhaseOrder: JsonField? = null + private var reason: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(percentageDiscountAdjustment: PercentageDiscountAdjustment) = + apply { + id = percentageDiscountAdjustment.id + adjustmentType = percentageDiscountAdjustment.adjustmentType + appliesToPriceIds = + percentageDiscountAdjustment.appliesToPriceIds.map { + it.toMutableList() + } + isInvoiceLevel = percentageDiscountAdjustment.isInvoiceLevel + percentageDiscount = percentageDiscountAdjustment.percentageDiscount + planPhaseOrder = percentageDiscountAdjustment.planPhaseOrder + reason = percentageDiscountAdjustment.reason + additionalProperties = + percentageDiscountAdjustment.additionalProperties.toMutableMap() + } + + fun id(id: String) = id(JsonField.of(id)) + + fun id(id: JsonField) = apply { this.id = id } + + fun adjustmentType(adjustmentType: AdjustmentType) = + adjustmentType(JsonField.of(adjustmentType)) + + fun adjustmentType(adjustmentType: JsonField) = apply { + this.adjustmentType = adjustmentType + } + + /** The price IDs that this adjustment applies to. */ + fun appliesToPriceIds(appliesToPriceIds: List) = + appliesToPriceIds(JsonField.of(appliesToPriceIds)) + + /** The price IDs that this adjustment applies to. */ + fun appliesToPriceIds(appliesToPriceIds: JsonField>) = apply { + this.appliesToPriceIds = appliesToPriceIds.map { it.toMutableList() } + } + + /** The price IDs that this adjustment applies to. */ + 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) + } + } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** + * The percentage (as a value between 0 and 1) by which to discount the price + * intervals this adjustment applies to in a given billing period. + */ + fun percentageDiscount(percentageDiscount: Double) = + percentageDiscount(JsonField.of(percentageDiscount)) + + /** + * The percentage (as a value between 0 and 1) by which to discount the price + * intervals this adjustment applies to in a given billing period. + */ + fun percentageDiscount(percentageDiscount: JsonField) = apply { + this.percentageDiscount = percentageDiscount + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long?) = + planPhaseOrder(JsonField.ofNullable(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = planPhaseOrder(planPhaseOrder as Long?) + + /** The plan phase in which this adjustment is active. */ + @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 + fun planPhaseOrder(planPhaseOrder: Optional) = + planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + + /** The reason for the adjustment. */ + fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) + + /** The reason for the adjustment. */ + fun reason(reason: Optional) = reason(reason.orElse(null)) + + /** The reason for the adjustment. */ + fun reason(reason: JsonField) = apply { this.reason = reason } + + 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(): PercentageDiscountAdjustment = + PercentageDiscountAdjustment( + checkRequired("id", id), + checkRequired("adjustmentType", adjustmentType), + checkRequired("appliesToPriceIds", appliesToPriceIds).map { + it.toImmutable() + }, + checkRequired("isInvoiceLevel", isInvoiceLevel), + checkRequired("percentageDiscount", percentageDiscount), + checkRequired("planPhaseOrder", planPhaseOrder), + checkRequired("reason", reason), + additionalProperties.toImmutable(), + ) + } + + class AdjustmentType + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val PERCENTAGE_DISCOUNT = of("percentage_discount") + + @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) + } + + /** An enum containing [AdjustmentType]'s known values. */ + enum class Known { + PERCENTAGE_DISCOUNT, + } + + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + PERCENTAGE_DISCOUNT, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + PERCENTAGE_DISCOUNT -> Value.PERCENTAGE_DISCOUNT + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + PERCENTAGE_DISCOUNT -> Known.PERCENTAGE_DISCOUNT + else -> throw OrbInvalidDataException("Unknown AdjustmentType: $value") + } + + fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is AdjustmentType && 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 PercentageDiscountAdjustment && id == other.id && adjustmentType == other.adjustmentType && appliesToPriceIds == other.appliesToPriceIds && isInvoiceLevel == other.isInvoiceLevel && percentageDiscount == other.percentageDiscount && planPhaseOrder == other.planPhaseOrder && reason == other.reason && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(id, adjustmentType, appliesToPriceIds, isInvoiceLevel, percentageDiscount, planPhaseOrder, reason, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "PercentageDiscountAdjustment{id=$id, adjustmentType=$adjustmentType, appliesToPriceIds=$appliesToPriceIds, isInvoiceLevel=$isInvoiceLevel, percentageDiscount=$percentageDiscount, planPhaseOrder=$planPhaseOrder, reason=$reason, additionalProperties=$additionalProperties}" + } + + @NoAutoDetect + class UsageDiscountAdjustment + @JsonCreator + private constructor( + @JsonProperty("id") + @ExcludeMissing + private val id: JsonField = JsonMissing.of(), + @JsonProperty("adjustment_type") + @ExcludeMissing + private val adjustmentType: JsonField = JsonMissing.of(), + @JsonProperty("applies_to_price_ids") + @ExcludeMissing + private val appliesToPriceIds: JsonField> = JsonMissing.of(), + @JsonProperty("is_invoice_level") + @ExcludeMissing + private val isInvoiceLevel: JsonField = JsonMissing.of(), + @JsonProperty("plan_phase_order") + @ExcludeMissing + private val planPhaseOrder: JsonField = JsonMissing.of(), + @JsonProperty("reason") + @ExcludeMissing + private val reason: JsonField = JsonMissing.of(), + @JsonProperty("usage_discount") + @ExcludeMissing + private val usageDiscount: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { + + fun id(): String = id.getRequired("id") + + fun adjustmentType(): AdjustmentType = adjustmentType.getRequired("adjustment_type") + + /** The price IDs that this adjustment applies to. */ + fun appliesToPriceIds(): List = + appliesToPriceIds.getRequired("applies_to_price_ids") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + + /** The reason for the adjustment. */ + fun reason(): Optional = Optional.ofNullable(reason.getNullable("reason")) + + /** + * The number of usage units by which to discount the price this adjustment applies to + * in a given billing period. + */ + fun usageDiscount(): Double = usageDiscount.getRequired("usage_discount") + + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + @JsonProperty("adjustment_type") + @ExcludeMissing + fun _adjustmentType(): JsonField = adjustmentType + + /** The price IDs that this adjustment applies to. */ + @JsonProperty("applies_to_price_ids") + @ExcludeMissing + fun _appliesToPriceIds(): JsonField> = appliesToPriceIds + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel(): JsonField = isInvoiceLevel + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun _planPhaseOrder(): JsonField = planPhaseOrder + + /** The reason for the adjustment. */ + @JsonProperty("reason") @ExcludeMissing fun _reason(): JsonField = reason + + /** + * The number of usage units by which to discount the price this adjustment applies to + * in a given billing period. + */ + @JsonProperty("usage_discount") + @ExcludeMissing + fun _usageDiscount(): JsonField = usageDiscount + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): UsageDiscountAdjustment = apply { + if (validated) { + return@apply + } + + id() + adjustmentType() + appliesToPriceIds() + isInvoiceLevel() + planPhaseOrder() + reason() + usageDiscount() + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + /** A builder for [UsageDiscountAdjustment]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var adjustmentType: JsonField? = null + private var appliesToPriceIds: JsonField>? = null + private var isInvoiceLevel: JsonField? = null + private var planPhaseOrder: JsonField? = null + private var reason: JsonField? = null + private var usageDiscount: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(usageDiscountAdjustment: UsageDiscountAdjustment) = apply { + id = usageDiscountAdjustment.id + adjustmentType = usageDiscountAdjustment.adjustmentType + appliesToPriceIds = + usageDiscountAdjustment.appliesToPriceIds.map { it.toMutableList() } + isInvoiceLevel = usageDiscountAdjustment.isInvoiceLevel + planPhaseOrder = usageDiscountAdjustment.planPhaseOrder + reason = usageDiscountAdjustment.reason + usageDiscount = usageDiscountAdjustment.usageDiscount + additionalProperties = + usageDiscountAdjustment.additionalProperties.toMutableMap() + } + + fun id(id: String) = id(JsonField.of(id)) + + fun id(id: JsonField) = apply { this.id = id } + + fun adjustmentType(adjustmentType: AdjustmentType) = + adjustmentType(JsonField.of(adjustmentType)) + + fun adjustmentType(adjustmentType: JsonField) = apply { + this.adjustmentType = adjustmentType + } + + /** The price IDs that this adjustment applies to. */ + fun appliesToPriceIds(appliesToPriceIds: List) = + appliesToPriceIds(JsonField.of(appliesToPriceIds)) + + /** The price IDs that this adjustment applies to. */ + fun appliesToPriceIds(appliesToPriceIds: JsonField>) = apply { + this.appliesToPriceIds = appliesToPriceIds.map { it.toMutableList() } + } + + /** The price IDs that this adjustment applies to. */ + 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) + } + } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long?) = + planPhaseOrder(JsonField.ofNullable(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = planPhaseOrder(planPhaseOrder as Long?) + + /** The plan phase in which this adjustment is active. */ + @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 + fun planPhaseOrder(planPhaseOrder: Optional) = + planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + + /** The reason for the adjustment. */ + fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) + + /** The reason for the adjustment. */ + fun reason(reason: Optional) = reason(reason.orElse(null)) + + /** The reason for the adjustment. */ + fun reason(reason: JsonField) = apply { this.reason = reason } + + /** + * The number of usage units by which to discount the price this adjustment applies + * to in a given billing period. + */ + fun usageDiscount(usageDiscount: Double) = + usageDiscount(JsonField.of(usageDiscount)) + + /** + * The number of usage units by which to discount the price this adjustment applies + * to in a given billing period. + */ + fun usageDiscount(usageDiscount: JsonField) = apply { + this.usageDiscount = usageDiscount + } + + 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(): UsageDiscountAdjustment = + UsageDiscountAdjustment( + checkRequired("id", id), + checkRequired("adjustmentType", adjustmentType), + checkRequired("appliesToPriceIds", appliesToPriceIds).map { + it.toImmutable() + }, + checkRequired("isInvoiceLevel", isInvoiceLevel), + checkRequired("planPhaseOrder", planPhaseOrder), + checkRequired("reason", reason), + checkRequired("usageDiscount", usageDiscount), + additionalProperties.toImmutable(), + ) + } + + class AdjustmentType + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val USAGE_DISCOUNT = of("usage_discount") + + @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) + } + + /** An enum containing [AdjustmentType]'s known values. */ + enum class Known { + USAGE_DISCOUNT, + } + + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + USAGE_DISCOUNT, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + USAGE_DISCOUNT -> Value.USAGE_DISCOUNT + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + USAGE_DISCOUNT -> Known.USAGE_DISCOUNT + else -> throw OrbInvalidDataException("Unknown AdjustmentType: $value") + } + + fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is AdjustmentType && 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 UsageDiscountAdjustment && id == other.id && adjustmentType == other.adjustmentType && appliesToPriceIds == other.appliesToPriceIds && isInvoiceLevel == other.isInvoiceLevel && planPhaseOrder == other.planPhaseOrder && reason == other.reason && usageDiscount == other.usageDiscount && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(id, adjustmentType, appliesToPriceIds, isInvoiceLevel, planPhaseOrder, reason, usageDiscount, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "UsageDiscountAdjustment{id=$id, adjustmentType=$adjustmentType, appliesToPriceIds=$appliesToPriceIds, isInvoiceLevel=$isInvoiceLevel, planPhaseOrder=$planPhaseOrder, reason=$reason, usageDiscount=$usageDiscount, additionalProperties=$additionalProperties}" + } + + @NoAutoDetect + class MinimumAdjustment + @JsonCreator + private constructor( + @JsonProperty("id") + @ExcludeMissing + private val id: JsonField = JsonMissing.of(), + @JsonProperty("adjustment_type") + @ExcludeMissing + private val adjustmentType: JsonField = JsonMissing.of(), + @JsonProperty("applies_to_price_ids") + @ExcludeMissing + private val appliesToPriceIds: JsonField> = JsonMissing.of(), + @JsonProperty("is_invoice_level") + @ExcludeMissing + private val isInvoiceLevel: JsonField = JsonMissing.of(), + @JsonProperty("item_id") + @ExcludeMissing + private val itemId: JsonField = JsonMissing.of(), + @JsonProperty("minimum_amount") + @ExcludeMissing + private val minimumAmount: JsonField = JsonMissing.of(), + @JsonProperty("plan_phase_order") + @ExcludeMissing + private val planPhaseOrder: JsonField = JsonMissing.of(), + @JsonProperty("reason") + @ExcludeMissing + private val reason: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { + + fun id(): String = id.getRequired("id") + + fun adjustmentType(): AdjustmentType = adjustmentType.getRequired("adjustment_type") + + /** The price IDs that this adjustment applies to. */ + fun appliesToPriceIds(): List = + appliesToPriceIds.getRequired("applies_to_price_ids") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** The item ID that revenue from this minimum will be attributed to. */ + fun itemId(): String = itemId.getRequired("item_id") + + /** + * The minimum amount to charge in a given billing period for the prices this adjustment + * applies to. + */ + fun minimumAmount(): String = minimumAmount.getRequired("minimum_amount") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + + /** The reason for the adjustment. */ + fun reason(): Optional = Optional.ofNullable(reason.getNullable("reason")) + + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + @JsonProperty("adjustment_type") + @ExcludeMissing + fun _adjustmentType(): JsonField = adjustmentType + + /** The price IDs that this adjustment applies to. */ + @JsonProperty("applies_to_price_ids") + @ExcludeMissing + fun _appliesToPriceIds(): JsonField> = appliesToPriceIds + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel(): JsonField = isInvoiceLevel + + /** The item ID that revenue from this minimum will be attributed to. */ + @JsonProperty("item_id") @ExcludeMissing fun _itemId(): JsonField = itemId + + /** + * The minimum amount to charge in a given billing period for the prices this adjustment + * applies to. + */ + @JsonProperty("minimum_amount") + @ExcludeMissing + fun _minimumAmount(): JsonField = minimumAmount + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun _planPhaseOrder(): JsonField = planPhaseOrder + + /** The reason for the adjustment. */ + @JsonProperty("reason") @ExcludeMissing fun _reason(): JsonField = reason + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): MinimumAdjustment = apply { + if (validated) { + return@apply + } + + id() + adjustmentType() + appliesToPriceIds() + isInvoiceLevel() + itemId() + minimumAmount() + planPhaseOrder() + reason() + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + /** A builder for [MinimumAdjustment]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var adjustmentType: JsonField? = null + private var appliesToPriceIds: JsonField>? = null + private var isInvoiceLevel: JsonField? = null + private var itemId: JsonField? = null + private var minimumAmount: JsonField? = null + private var planPhaseOrder: JsonField? = null + private var reason: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(minimumAdjustment: MinimumAdjustment) = apply { + id = minimumAdjustment.id + adjustmentType = minimumAdjustment.adjustmentType + appliesToPriceIds = + minimumAdjustment.appliesToPriceIds.map { it.toMutableList() } + isInvoiceLevel = minimumAdjustment.isInvoiceLevel + itemId = minimumAdjustment.itemId + minimumAmount = minimumAdjustment.minimumAmount + planPhaseOrder = minimumAdjustment.planPhaseOrder + reason = minimumAdjustment.reason + additionalProperties = minimumAdjustment.additionalProperties.toMutableMap() + } + + fun id(id: String) = id(JsonField.of(id)) + + fun id(id: JsonField) = apply { this.id = id } + + fun adjustmentType(adjustmentType: AdjustmentType) = + adjustmentType(JsonField.of(adjustmentType)) + + fun adjustmentType(adjustmentType: JsonField) = apply { + this.adjustmentType = adjustmentType + } + + /** The price IDs that this adjustment applies to. */ + fun appliesToPriceIds(appliesToPriceIds: List) = + appliesToPriceIds(JsonField.of(appliesToPriceIds)) + + /** The price IDs that this adjustment applies to. */ + fun appliesToPriceIds(appliesToPriceIds: JsonField>) = apply { + this.appliesToPriceIds = appliesToPriceIds.map { it.toMutableList() } + } + + /** The price IDs that this adjustment applies to. */ + 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) + } + } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** The item ID that revenue from this minimum will be attributed to. */ + fun itemId(itemId: String) = itemId(JsonField.of(itemId)) + + /** The item ID that revenue from this minimum will be attributed to. */ + fun itemId(itemId: JsonField) = apply { this.itemId = itemId } + + /** + * The minimum amount to charge in a given billing period for the prices this + * adjustment applies to. + */ + fun minimumAmount(minimumAmount: String) = + minimumAmount(JsonField.of(minimumAmount)) + + /** + * The minimum amount to charge in a given billing period for the prices this + * adjustment applies to. + */ + fun minimumAmount(minimumAmount: JsonField) = apply { + this.minimumAmount = minimumAmount + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long?) = + planPhaseOrder(JsonField.ofNullable(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = planPhaseOrder(planPhaseOrder as Long?) + + /** The plan phase in which this adjustment is active. */ + @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 + fun planPhaseOrder(planPhaseOrder: Optional) = + planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + + /** The reason for the adjustment. */ + fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) + + /** The reason for the adjustment. */ + fun reason(reason: Optional) = reason(reason.orElse(null)) + + /** The reason for the adjustment. */ + fun reason(reason: JsonField) = apply { this.reason = reason } + + 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(): MinimumAdjustment = + MinimumAdjustment( + checkRequired("id", id), + checkRequired("adjustmentType", adjustmentType), + checkRequired("appliesToPriceIds", appliesToPriceIds).map { + it.toImmutable() + }, + checkRequired("isInvoiceLevel", isInvoiceLevel), + checkRequired("itemId", itemId), + checkRequired("minimumAmount", minimumAmount), + checkRequired("planPhaseOrder", planPhaseOrder), + checkRequired("reason", reason), + additionalProperties.toImmutable(), + ) + } + + class AdjustmentType + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val MINIMUM = of("minimum") + + @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) + } + + /** An enum containing [AdjustmentType]'s known values. */ + enum class Known { + MINIMUM, + } + + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + MINIMUM, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + MINIMUM -> Value.MINIMUM + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + MINIMUM -> Known.MINIMUM + else -> throw OrbInvalidDataException("Unknown AdjustmentType: $value") + } + + fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is AdjustmentType && 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 MinimumAdjustment && id == other.id && adjustmentType == other.adjustmentType && appliesToPriceIds == other.appliesToPriceIds && isInvoiceLevel == other.isInvoiceLevel && itemId == other.itemId && minimumAmount == other.minimumAmount && planPhaseOrder == other.planPhaseOrder && reason == other.reason && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(id, adjustmentType, appliesToPriceIds, isInvoiceLevel, itemId, minimumAmount, planPhaseOrder, reason, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "MinimumAdjustment{id=$id, adjustmentType=$adjustmentType, appliesToPriceIds=$appliesToPriceIds, isInvoiceLevel=$isInvoiceLevel, itemId=$itemId, minimumAmount=$minimumAmount, planPhaseOrder=$planPhaseOrder, reason=$reason, additionalProperties=$additionalProperties}" + } + + @NoAutoDetect + class MaximumAdjustment + @JsonCreator + private constructor( + @JsonProperty("id") + @ExcludeMissing + private val id: JsonField = JsonMissing.of(), + @JsonProperty("adjustment_type") + @ExcludeMissing + private val adjustmentType: JsonField = JsonMissing.of(), + @JsonProperty("applies_to_price_ids") + @ExcludeMissing + private val appliesToPriceIds: JsonField> = JsonMissing.of(), + @JsonProperty("is_invoice_level") + @ExcludeMissing + private val isInvoiceLevel: JsonField = JsonMissing.of(), + @JsonProperty("maximum_amount") + @ExcludeMissing + private val maximumAmount: JsonField = JsonMissing.of(), + @JsonProperty("plan_phase_order") + @ExcludeMissing + private val planPhaseOrder: JsonField = JsonMissing.of(), + @JsonProperty("reason") + @ExcludeMissing + private val reason: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { + + fun id(): String = id.getRequired("id") + + fun adjustmentType(): AdjustmentType = adjustmentType.getRequired("adjustment_type") + + /** The price IDs that this adjustment applies to. */ + fun appliesToPriceIds(): List = + appliesToPriceIds.getRequired("applies_to_price_ids") + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(): Boolean = isInvoiceLevel.getRequired("is_invoice_level") + + /** + * The maximum amount to charge in a given billing period for the prices this adjustment + * applies to. + */ + fun maximumAmount(): String = maximumAmount.getRequired("maximum_amount") + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(): Optional = + Optional.ofNullable(planPhaseOrder.getNullable("plan_phase_order")) + + /** The reason for the adjustment. */ + fun reason(): Optional = Optional.ofNullable(reason.getNullable("reason")) + + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + @JsonProperty("adjustment_type") + @ExcludeMissing + fun _adjustmentType(): JsonField = adjustmentType + + /** The price IDs that this adjustment applies to. */ + @JsonProperty("applies_to_price_ids") + @ExcludeMissing + fun _appliesToPriceIds(): JsonField> = appliesToPriceIds + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + @JsonProperty("is_invoice_level") + @ExcludeMissing + fun _isInvoiceLevel(): JsonField = isInvoiceLevel + + /** + * The maximum amount to charge in a given billing period for the prices this adjustment + * applies to. + */ + @JsonProperty("maximum_amount") + @ExcludeMissing + fun _maximumAmount(): JsonField = maximumAmount + + /** The plan phase in which this adjustment is active. */ + @JsonProperty("plan_phase_order") + @ExcludeMissing + fun _planPhaseOrder(): JsonField = planPhaseOrder + + /** The reason for the adjustment. */ + @JsonProperty("reason") @ExcludeMissing fun _reason(): JsonField = reason + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): MaximumAdjustment = apply { + if (validated) { + return@apply + } + + id() + adjustmentType() + appliesToPriceIds() + isInvoiceLevel() + maximumAmount() + planPhaseOrder() + reason() + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + /** A builder for [MaximumAdjustment]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var adjustmentType: JsonField? = null + private var appliesToPriceIds: JsonField>? = null + private var isInvoiceLevel: JsonField? = null + private var maximumAmount: JsonField? = null + private var planPhaseOrder: JsonField? = null + private var reason: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(maximumAdjustment: MaximumAdjustment) = apply { + id = maximumAdjustment.id + adjustmentType = maximumAdjustment.adjustmentType + appliesToPriceIds = + maximumAdjustment.appliesToPriceIds.map { it.toMutableList() } + isInvoiceLevel = maximumAdjustment.isInvoiceLevel + maximumAmount = maximumAdjustment.maximumAmount + planPhaseOrder = maximumAdjustment.planPhaseOrder + reason = maximumAdjustment.reason + additionalProperties = maximumAdjustment.additionalProperties.toMutableMap() + } + + fun id(id: String) = id(JsonField.of(id)) + + fun id(id: JsonField) = apply { this.id = id } + + fun adjustmentType(adjustmentType: AdjustmentType) = + adjustmentType(JsonField.of(adjustmentType)) + + fun adjustmentType(adjustmentType: JsonField) = apply { + this.adjustmentType = adjustmentType + } + + /** The price IDs that this adjustment applies to. */ + fun appliesToPriceIds(appliesToPriceIds: List) = + appliesToPriceIds(JsonField.of(appliesToPriceIds)) + + /** The price IDs that this adjustment applies to. */ + fun appliesToPriceIds(appliesToPriceIds: JsonField>) = apply { + this.appliesToPriceIds = appliesToPriceIds.map { it.toMutableList() } + } + + /** The price IDs that this adjustment applies to. */ + 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) + } + } + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: Boolean) = + isInvoiceLevel(JsonField.of(isInvoiceLevel)) + + /** + * True for adjustments that apply to an entire invocice, false for adjustments that + * apply to only one price. + */ + fun isInvoiceLevel(isInvoiceLevel: JsonField) = apply { + this.isInvoiceLevel = isInvoiceLevel + } + + /** + * The maximum amount to charge in a given billing period for the prices this + * adjustment applies to. + */ + fun maximumAmount(maximumAmount: String) = + maximumAmount(JsonField.of(maximumAmount)) + + /** + * The maximum amount to charge in a given billing period for the prices this + * adjustment applies to. + */ + fun maximumAmount(maximumAmount: JsonField) = apply { + this.maximumAmount = maximumAmount + } + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long?) = + planPhaseOrder(JsonField.ofNullable(planPhaseOrder)) + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: Long) = planPhaseOrder(planPhaseOrder as Long?) + + /** The plan phase in which this adjustment is active. */ + @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 + fun planPhaseOrder(planPhaseOrder: Optional) = + planPhaseOrder(planPhaseOrder.orElse(null) as Long?) + + /** The plan phase in which this adjustment is active. */ + fun planPhaseOrder(planPhaseOrder: JsonField) = apply { + this.planPhaseOrder = planPhaseOrder + } + + /** The reason for the adjustment. */ + fun reason(reason: String?) = reason(JsonField.ofNullable(reason)) + + /** The reason for the adjustment. */ + fun reason(reason: Optional) = reason(reason.orElse(null)) + + /** The reason for the adjustment. */ + fun reason(reason: JsonField) = apply { this.reason = reason } + + 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(): MaximumAdjustment = + MaximumAdjustment( + checkRequired("id", id), + checkRequired("adjustmentType", adjustmentType), + checkRequired("appliesToPriceIds", appliesToPriceIds).map { + it.toImmutable() + }, + checkRequired("isInvoiceLevel", isInvoiceLevel), + checkRequired("maximumAmount", maximumAmount), + checkRequired("planPhaseOrder", planPhaseOrder), + checkRequired("reason", reason), + additionalProperties.toImmutable(), + ) + } + + class AdjustmentType + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val MAXIMUM = of("maximum") + + @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) + } + + /** An enum containing [AdjustmentType]'s known values. */ + enum class Known { + MAXIMUM, + } + + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + MAXIMUM, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + MAXIMUM -> Value.MAXIMUM + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + MAXIMUM -> Known.MAXIMUM + else -> throw OrbInvalidDataException("Unknown AdjustmentType: $value") + } + + fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is AdjustmentType && 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 MaximumAdjustment && id == other.id && adjustmentType == other.adjustmentType && appliesToPriceIds == other.appliesToPriceIds && isInvoiceLevel == other.isInvoiceLevel && maximumAmount == other.maximumAmount && planPhaseOrder == other.planPhaseOrder && reason == other.reason && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(id, adjustmentType, appliesToPriceIds, isInvoiceLevel, maximumAmount, planPhaseOrder, reason, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "MaximumAdjustment{id=$id, adjustmentType=$adjustmentType, appliesToPriceIds=$appliesToPriceIds, isInvoiceLevel=$isInvoiceLevel, maximumAmount=$maximumAmount, planPhaseOrder=$planPhaseOrder, reason=$reason, additionalProperties=$additionalProperties}" + } + } + + /** This field is deprecated in favor of `adjustments`. */ + @Deprecated("deprecated") + @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() + } + + /** A builder for [Maximum]. */ + class Builder internal constructor() { + + 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}" + } + + /** This field is deprecated in favor of `adjustments`. */ + @Deprecated("deprecated") + @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 @@ -1152,7 +3541,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Minimum]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var minimumAmount: JsonField? = null @@ -1342,6 +3732,10 @@ private constructor( @JvmStatic fun ofOther(other: OtherSubLineItem) = SubLineItem(other = other) } + /** + * An interface that defines how to map each variant of [SubLineItem] to a value of type + * [T]. + */ interface Visitor { fun visitMatrix(matrix: MatrixSubLineItem): T @@ -1350,12 +3744,22 @@ private constructor( fun visitOther(other: OtherSubLineItem): T + /** + * Maps an unknown variant of [SubLineItem] to a value of type [T]. + * + * An instance of [SubLineItem] can contain an unknown variant if it was deserialized + * from data that doesn't match any known variant. For example, if the SDK is on an + * older version than the API, then the API may respond with new variants that the SDK + * is unaware of. + * + * @throws OrbInvalidDataException in the default implementation. + */ fun unknown(json: JsonValue?): T { throw OrbInvalidDataException("Unknown SubLineItem: $json") } } - class Deserializer : BaseDeserializer(SubLineItem::class) { + internal class Deserializer : BaseDeserializer(SubLineItem::class) { override fun ObjectCodec.deserialize(node: JsonNode): SubLineItem { val json = JsonValue.fromJsonNode(node) @@ -1386,7 +3790,7 @@ private constructor( } } - class Serializer : BaseSerializer(SubLineItem::class) { + internal class Serializer : BaseSerializer(SubLineItem::class) { override fun serialize( value: SubLineItem, @@ -1487,7 +3891,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MatrixSubLineItem]. */ + class Builder internal constructor() { private var amount: JsonField? = null private var grouping: JsonField? = null @@ -1620,7 +4025,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Grouping]. */ + class Builder internal constructor() { private var key: JsonField? = null private var value: JsonField? = null @@ -1736,7 +4142,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MatrixConfig]. */ + class Builder internal constructor() { private var dimensionValues: JsonField>? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -1825,6 +4232,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -1834,21 +4249,50 @@ private constructor( @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } + /** An enum containing [Type]'s known values. */ enum class Known { MATRIX, } + /** + * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Type] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { MATRIX, + /** + * An enum member indicating that [Type] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { MATRIX -> Value.MATRIX else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { MATRIX -> Known.MATRIX @@ -1972,7 +4416,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TierSubLineItem]. */ + class Builder internal constructor() { private var amount: JsonField? = null private var grouping: JsonField? = null @@ -2104,7 +4549,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Grouping]. */ + class Builder internal constructor() { private var key: JsonField? = null private var value: JsonField? = null @@ -2238,7 +4684,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TierConfig]. */ + class Builder internal constructor() { private var firstUnit: JsonField? = null private var lastUnit: JsonField? = null @@ -2330,6 +4777,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -2339,21 +4794,50 @@ private constructor( @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } + /** An enum containing [Type]'s known values. */ enum class Known { TIER, } + /** + * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Type] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { TIER, + /** + * An enum member indicating that [Type] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { TIER -> Value.TIER else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { TIER -> Known.TIER @@ -2467,7 +4951,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [OtherSubLineItem]. */ + class Builder internal constructor() { private var amount: JsonField? = null private var grouping: JsonField? = null @@ -2590,7 +5075,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Grouping]. */ + class Builder internal constructor() { private var key: JsonField? = null private var value: JsonField? = null @@ -2670,6 +5156,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -2679,21 +5173,50 @@ private constructor( @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } + /** An enum containing [Type]'s known values. */ enum class Known { NULL, } + /** + * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Type] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { NULL, + /** + * An enum member indicating that [Type] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { NULL -> Value.NULL else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { NULL -> Known.NULL @@ -2798,7 +5321,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TaxAmount]. */ + class Builder internal constructor() { private var amount: JsonField? = null private var taxRateDescription: JsonField? = null @@ -2892,15 +5416,15 @@ private constructor( return true } - return /* spotless:off */ other is InvoiceLineItemCreateResponse && id == other.id && amount == other.amount && discount == other.discount && endDate == other.endDate && grouping == other.grouping && maximum == other.maximum && maximumAmount == other.maximumAmount && minimum == other.minimum && minimumAmount == other.minimumAmount && name == other.name && price == other.price && quantity == other.quantity && startDate == other.startDate && subLineItems == other.subLineItems && subtotal == other.subtotal && taxAmounts == other.taxAmounts && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is InvoiceLineItemCreateResponse && id == other.id && adjustedSubtotal == other.adjustedSubtotal && adjustments == other.adjustments && amount == other.amount && creditsApplied == other.creditsApplied && discount == other.discount && endDate == other.endDate && grouping == other.grouping && maximum == other.maximum && maximumAmount == other.maximumAmount && minimum == other.minimum && minimumAmount == other.minimumAmount && name == other.name && partiallyInvoicedAmount == other.partiallyInvoicedAmount && price == other.price && quantity == other.quantity && startDate == other.startDate && subLineItems == other.subLineItems && subtotal == other.subtotal && taxAmounts == other.taxAmounts && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, amount, discount, endDate, grouping, maximum, maximumAmount, minimum, minimumAmount, name, price, quantity, startDate, subLineItems, subtotal, taxAmounts, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, adjustedSubtotal, adjustments, amount, creditsApplied, discount, endDate, grouping, maximum, maximumAmount, minimum, minimumAmount, name, partiallyInvoicedAmount, price, quantity, startDate, subLineItems, subtotal, taxAmounts, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "InvoiceLineItemCreateResponse{id=$id, amount=$amount, discount=$discount, endDate=$endDate, grouping=$grouping, maximum=$maximum, maximumAmount=$maximumAmount, minimum=$minimum, minimumAmount=$minimumAmount, name=$name, price=$price, quantity=$quantity, startDate=$startDate, subLineItems=$subLineItems, subtotal=$subtotal, taxAmounts=$taxAmounts, additionalProperties=$additionalProperties}" + "InvoiceLineItemCreateResponse{id=$id, adjustedSubtotal=$adjustedSubtotal, adjustments=$adjustments, amount=$amount, creditsApplied=$creditsApplied, discount=$discount, endDate=$endDate, grouping=$grouping, maximum=$maximum, maximumAmount=$maximumAmount, minimum=$minimum, minimumAmount=$minimumAmount, name=$name, partiallyInvoicedAmount=$partiallyInvoicedAmount, price=$price, quantity=$quantity, startDate=$startDate, subLineItems=$subLineItems, subtotal=$subtotal, taxAmounts=$taxAmounts, additionalProperties=$additionalProperties}" } 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 e1f38bfa..af3b4778 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 @@ -193,8 +193,7 @@ private constructor( } } - class AutoPager - constructor( + class AutoPager( private val firstPage: InvoiceListPage, ) : Iterable { 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 e11d16e9..2ccfd686 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 @@ -200,8 +200,7 @@ private constructor( } } - class AutoPager - constructor( + class AutoPager( private val firstPage: InvoiceListPageAsync, ) { 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 638dfec3..d3e1944e 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 @@ -6,6 +6,7 @@ import com.fasterxml.jackson.annotation.JsonCreator import com.withorb.api.core.Enum import com.withorb.api.core.JsonField import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams import com.withorb.api.core.toImmutable @@ -31,7 +32,7 @@ import java.util.Optional * asynchronously. */ class InvoiceListParams -constructor( +private constructor( private val amount: String?, private val amountGt: String?, private val amountLt: String?, @@ -53,7 +54,7 @@ constructor( private val subscriptionId: String?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun amount(): Optional = Optional.ofNullable(amount) @@ -107,10 +108,9 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic - internal fun getQueryParams(): QueryParams { + override fun _queryParams(): QueryParams { val queryParams = QueryParams.builder() this.amount?.let { queryParams.put("amount", listOf(it.toString())) } this.amountGt?.let { queryParams.put("amount[gt]", listOf(it.toString())) } @@ -164,8 +164,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [InvoiceListParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var amount: String? = null private var amountGt: String? = null @@ -469,6 +470,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -480,17 +489,35 @@ constructor( @JvmStatic fun of(value: String) = DateType(JsonField.of(value)) } + /** An enum containing [DateType]'s known values. */ enum class Known { DUE_DATE, INVOICE_DATE, } + /** + * An enum containing [DateType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [DateType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DUE_DATE, INVOICE_DATE, + /** An enum member indicating that [DateType] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { DUE_DATE -> Value.DUE_DATE @@ -498,6 +525,14 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { DUE_DATE -> Known.DUE_DATE @@ -526,6 +561,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -543,6 +586,7 @@ constructor( @JvmStatic fun of(value: String) = Status(JsonField.of(value)) } + /** An enum containing [Status]'s known values. */ enum class Known { DRAFT, ISSUED, @@ -551,15 +595,32 @@ constructor( VOID, } + /** + * An enum containing [Status]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Status] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DRAFT, ISSUED, PAID, SYNCED, VOID, + /** An enum member indicating that [Status] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { DRAFT -> Value.DRAFT @@ -570,6 +631,14 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { DRAFT -> Known.DRAFT diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceMarkPaidParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceMarkPaidParams.kt index 3532eb31..d688b6fa 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceMarkPaidParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceMarkPaidParams.kt @@ -11,6 +11,7 @@ import com.withorb.api.core.JsonField import com.withorb.api.core.JsonMissing import com.withorb.api.core.JsonValue import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -25,12 +26,12 @@ import java.util.Optional * invoices that are in the `issued` status. */ class InvoiceMarkPaidParams -constructor( +private constructor( private val invoiceId: String, private val body: InvoiceMarkPaidBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun invoiceId(): String = invoiceId @@ -58,11 +59,11 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getBody(): InvoiceMarkPaidBody = body + @JvmSynthetic internal fun _body(): InvoiceMarkPaidBody = body - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun getPathParam(index: Int): String { return when (index) { @@ -136,7 +137,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoiceMarkPaidBody]. */ + class Builder internal constructor() { private var paymentReceivedDate: JsonField? = null private var externalId: JsonField = JsonMissing.of() @@ -231,8 +233,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [InvoiceMarkPaidParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var invoiceId: String? = null private var body: InvoiceMarkPaidBody.Builder = InvoiceMarkPaidBody.builder() diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoicePayParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoicePayParams.kt index 26c3c999..c6a544b6 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoicePayParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoicePayParams.kt @@ -4,6 +4,7 @@ package com.withorb.api.models import com.withorb.api.core.JsonValue import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -16,12 +17,12 @@ import java.util.Optional * action can only be taken on invoices with status "issued". */ class InvoicePayParams -constructor( +private constructor( private val invoiceId: String, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, private val additionalBodyProperties: Map, -) { +) : Params { fun invoiceId(): String = invoiceId @@ -32,12 +33,12 @@ constructor( fun _additionalBodyProperties(): Map = additionalBodyProperties @JvmSynthetic - internal fun getBody(): Optional> = + internal fun _body(): Optional> = Optional.ofNullable(additionalBodyProperties.ifEmpty { null }) - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun getPathParam(index: Int): String { return when (index) { @@ -53,8 +54,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [InvoicePayParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var invoiceId: String? = null private var additionalHeaders: Headers.Builder = Headers.builder() diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceUpdateParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceUpdateParams.kt index 6989e8e4..f792e307 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceUpdateParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceUpdateParams.kt @@ -11,6 +11,7 @@ import com.withorb.api.core.JsonField import com.withorb.api.core.JsonMissing import com.withorb.api.core.JsonValue import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -26,12 +27,12 @@ import java.util.Optional * `metadata` can be modified regardless of invoice state. */ class InvoiceUpdateParams -constructor( +private constructor( private val invoiceId: String, private val body: InvoiceUpdateBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun invoiceId(): String = invoiceId @@ -55,11 +56,11 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getBody(): InvoiceUpdateBody = body + @JvmSynthetic internal fun _body(): InvoiceUpdateBody = body - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun getPathParam(index: Int): String { return when (index) { @@ -115,7 +116,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoiceUpdateBody]. */ + class Builder internal constructor() { private var metadata: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -195,8 +197,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [InvoiceUpdateParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var invoiceId: String? = null private var body: InvoiceUpdateBody.Builder = InvoiceUpdateBody.builder() @@ -394,7 +397,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceVoidInvoiceParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceVoidInvoiceParams.kt index 20802750..0cc740ae 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceVoidInvoiceParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/InvoiceVoidInvoiceParams.kt @@ -4,6 +4,7 @@ package com.withorb.api.models import com.withorb.api.core.JsonValue import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -20,12 +21,12 @@ import java.util.Optional * that amount will be added back to the customer balance upon voiding. */ class InvoiceVoidInvoiceParams -constructor( +private constructor( private val invoiceId: String, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, private val additionalBodyProperties: Map, -) { +) : Params { fun invoiceId(): String = invoiceId @@ -36,12 +37,12 @@ constructor( fun _additionalBodyProperties(): Map = additionalBodyProperties @JvmSynthetic - internal fun getBody(): Optional> = + internal fun _body(): Optional> = Optional.ofNullable(additionalBodyProperties.ifEmpty { null }) - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun getPathParam(index: Int): String { return when (index) { @@ -57,8 +58,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [InvoiceVoidInvoiceParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var invoiceId: String? = null private var additionalHeaders: Headers.Builder = Headers.builder() diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/Item.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/Item.kt index 03bfaf10..30b71168 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/Item.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/Item.kt @@ -85,7 +85,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Item]. */ + class Builder internal constructor() { private var id: JsonField? = null private var createdAt: JsonField? = null @@ -213,7 +214,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [ExternalConnection]. */ + class Builder internal constructor() { private var externalConnectionName: JsonField? = null private var externalEntityId: JsonField? = null @@ -274,6 +276,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -295,6 +305,7 @@ private constructor( @JvmStatic fun of(value: String) = ExternalConnectionName(JsonField.of(value)) } + /** An enum containing [ExternalConnectionName]'s known values. */ enum class Known { STRIPE, QUICKBOOKS, @@ -305,6 +316,17 @@ private constructor( ANROK, } + /** + * An enum containing [ExternalConnectionName]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ExternalConnectionName] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { STRIPE, QUICKBOOKS, @@ -313,9 +335,20 @@ private constructor( TAXJAR, AVALARA, ANROK, + /** + * An enum member indicating that [ExternalConnectionName] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { STRIPE -> Value.STRIPE @@ -328,6 +361,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { STRIPE -> Known.STRIPE 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 afb248f1..64b30fef 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 @@ -11,6 +11,7 @@ import com.withorb.api.core.JsonField import com.withorb.api.core.JsonMissing import com.withorb.api.core.JsonValue import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -20,11 +21,11 @@ import java.util.Objects /** This endpoint is used to create an [Item](/core-concepts#item). */ class ItemCreateParams -constructor( +private constructor( private val body: ItemCreateBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { /** The name of the item. */ fun name(): String = body.name() @@ -38,11 +39,11 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getBody(): ItemCreateBody = body + @JvmSynthetic internal fun _body(): ItemCreateBody = body - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams @NoAutoDetect class ItemCreateBody @@ -83,7 +84,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [ItemCreateBody]. */ + class Builder internal constructor() { private var name: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -148,8 +150,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [ItemCreateParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var body: ItemCreateBody.Builder = ItemCreateBody.builder() private var additionalHeaders: Headers.Builder = Headers.builder() diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/ItemFetchParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/ItemFetchParams.kt index 9f34f123..e0d9388e 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/ItemFetchParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/ItemFetchParams.kt @@ -3,6 +3,7 @@ package com.withorb.api.models import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -10,11 +11,11 @@ import java.util.Objects /** This endpoint returns an item identified by its item_id. */ class ItemFetchParams -constructor( +private constructor( private val itemId: String, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun itemId(): String = itemId @@ -22,9 +23,9 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun getPathParam(index: Int): String { return when (index) { @@ -40,8 +41,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [ItemFetchParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var itemId: String? = null private var additionalHeaders: Headers.Builder = Headers.builder() 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 9f9e6278..54f26e64 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 @@ -180,8 +180,7 @@ private constructor( } } - class AutoPager - constructor( + class AutoPager( private val firstPage: ItemListPage, ) : Iterable { 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 318ae80c..152272c2 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 @@ -183,8 +183,7 @@ private constructor( } } - class AutoPager - constructor( + class AutoPager( private val firstPage: ItemListPageAsync, ) { diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/ItemListParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/ItemListParams.kt index f6b58d0a..fc997715 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/ItemListParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/ItemListParams.kt @@ -3,6 +3,7 @@ package com.withorb.api.models import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams import java.util.Objects @@ -10,12 +11,12 @@ import java.util.Optional /** This endpoint returns a list of all Items, ordered in descending order by creation time. */ class ItemListParams -constructor( +private constructor( private val cursor: String?, private val limit: Long?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { /** * Cursor for pagination. This can be populated by the `next_cursor` value returned from the @@ -30,10 +31,9 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic - internal fun getQueryParams(): QueryParams { + override fun _queryParams(): QueryParams { val queryParams = QueryParams.builder() this.cursor?.let { queryParams.put("cursor", listOf(it.toString())) } this.limit?.let { queryParams.put("limit", listOf(it.toString())) } @@ -48,8 +48,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [ItemListParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var cursor: String? = null private var limit: Long? = null diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/ItemUpdateParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/ItemUpdateParams.kt index fa621c45..8d66d5d5 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/ItemUpdateParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/ItemUpdateParams.kt @@ -12,6 +12,7 @@ import com.withorb.api.core.JsonField import com.withorb.api.core.JsonMissing import com.withorb.api.core.JsonValue import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -23,12 +24,12 @@ import java.util.Optional /** This endpoint can be used to update properties on the Item. */ class ItemUpdateParams -constructor( +private constructor( private val itemId: String, private val body: ItemUpdateBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun itemId(): String = itemId @@ -46,11 +47,11 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getBody(): ItemUpdateBody = body + @JvmSynthetic internal fun _body(): ItemUpdateBody = body - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun getPathParam(index: Int): String { return when (index) { @@ -112,7 +113,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [ItemUpdateBody]. */ + class Builder internal constructor() { private var externalConnections: JsonField>? = null private var name: JsonField = JsonMissing.of() @@ -207,8 +209,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [ItemUpdateParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var itemId: String? = null private var body: ItemUpdateBody.Builder = ItemUpdateBody.builder() @@ -422,7 +425,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [ExternalConnection]. */ + class Builder internal constructor() { private var externalConnectionName: JsonField? = null private var externalEntityId: JsonField? = null @@ -483,6 +487,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -504,6 +516,7 @@ constructor( @JvmStatic fun of(value: String) = ExternalConnectionName(JsonField.of(value)) } + /** An enum containing [ExternalConnectionName]'s known values. */ enum class Known { STRIPE, QUICKBOOKS, @@ -514,6 +527,17 @@ constructor( ANROK, } + /** + * An enum containing [ExternalConnectionName]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ExternalConnectionName] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { STRIPE, QUICKBOOKS, @@ -522,9 +546,20 @@ constructor( TAXJAR, AVALARA, ANROK, + /** + * An enum member indicating that [ExternalConnectionName] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { STRIPE -> Value.STRIPE @@ -537,6 +572,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { STRIPE -> Known.STRIPE 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 93f04dbb..daf97f25 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 @@ -11,6 +11,7 @@ import com.withorb.api.core.JsonField import com.withorb.api.core.JsonMissing import com.withorb.api.core.JsonValue import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -25,11 +26,11 @@ import java.util.Optional * queries with examples. */ class MetricCreateParams -constructor( +private constructor( private val body: MetricCreateBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { /** A description of the metric. */ fun description(): Optional = body.description() @@ -75,11 +76,11 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getBody(): MetricCreateBody = body + @JvmSynthetic internal fun _body(): MetricCreateBody = body - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams @NoAutoDetect class MetricCreateBody @@ -169,7 +170,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MetricCreateBody]. */ + class Builder internal constructor() { private var description: JsonField? = null private var itemId: JsonField? = null @@ -293,8 +295,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [MetricCreateParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var body: MetricCreateBody.Builder = MetricCreateBody.builder() private var additionalHeaders: Headers.Builder = Headers.builder() @@ -514,7 +517,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() 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 5d248bcf..5323bc8f 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 @@ -3,6 +3,7 @@ package com.withorb.api.models import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -13,11 +14,11 @@ import java.util.Objects * metrics including its name, description, and item. */ class MetricFetchParams -constructor( +private constructor( private val metricId: String, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun metricId(): String = metricId @@ -25,9 +26,9 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun getPathParam(index: Int): String { return when (index) { @@ -43,8 +44,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [MetricFetchParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var metricId: String? = null private var additionalHeaders: Headers.Builder = Headers.builder() 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 a6da357b..81c0c83e 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 @@ -183,8 +183,7 @@ private constructor( } } - class AutoPager - constructor( + class AutoPager( private val firstPage: MetricListPage, ) : Iterable { 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 ef1e160e..f0cc24fe 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 @@ -186,8 +186,7 @@ private constructor( } } - class AutoPager - constructor( + class AutoPager( private val firstPage: MetricListPageAsync, ) { 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 a6ff3d27..85e7291d 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 @@ -3,6 +3,7 @@ package com.withorb.api.models import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams import java.time.OffsetDateTime @@ -15,7 +16,7 @@ import java.util.Optional * identifier. It returns information about the metrics including its name, description, and item. */ class MetricListParams -constructor( +private constructor( private val createdAtGt: OffsetDateTime?, private val createdAtGte: OffsetDateTime?, private val createdAtLt: OffsetDateTime?, @@ -24,7 +25,7 @@ constructor( private val limit: Long?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun createdAtGt(): Optional = Optional.ofNullable(createdAtGt) @@ -47,10 +48,9 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic - internal fun getQueryParams(): QueryParams { + override fun _queryParams(): QueryParams { val queryParams = QueryParams.builder() this.createdAtGt?.let { queryParams.put( @@ -89,8 +89,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [MetricListParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var createdAtGt: OffsetDateTime? = null private var createdAtGte: OffsetDateTime? = null diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/MetricUpdateParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/MetricUpdateParams.kt index 799ca484..a5b29388 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/MetricUpdateParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/MetricUpdateParams.kt @@ -11,6 +11,7 @@ import com.withorb.api.core.JsonField import com.withorb.api.core.JsonMissing import com.withorb.api.core.JsonValue import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -24,12 +25,12 @@ import java.util.Optional * the metadata value, it will clear any existing metadata for that invoice. */ class MetricUpdateParams -constructor( +private constructor( private val metricId: String, private val body: MetricUpdateBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun metricId(): String = metricId @@ -53,11 +54,11 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getBody(): MetricUpdateBody = body + @JvmSynthetic internal fun _body(): MetricUpdateBody = body - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun getPathParam(index: Int): String { return when (index) { @@ -113,7 +114,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MetricUpdateBody]. */ + class Builder internal constructor() { private var metadata: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -193,8 +195,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [MetricUpdateParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var metricId: String? = null private var body: MetricUpdateBody.Builder = MetricUpdateBody.builder() @@ -392,7 +395,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/PaginationMetadata.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/PaginationMetadata.kt index 2c931ef2..c012514d 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/PaginationMetadata.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/PaginationMetadata.kt @@ -61,7 +61,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [PaginationMetadata]. */ + class Builder internal constructor() { private var hasMore: JsonField? = null private var nextCursor: JsonField? = null diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/PercentageDiscount.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/PercentageDiscount.kt index 0c431676..c9342abd 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/PercentageDiscount.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/PercentageDiscount.kt @@ -95,7 +95,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [PercentageDiscount]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var discountType: JsonField? = null @@ -200,6 +201,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -209,21 +218,49 @@ private constructor( @JvmStatic fun of(value: String) = DiscountType(JsonField.of(value)) } + /** An enum containing [DiscountType]'s known values. */ enum class Known { PERCENTAGE, } + /** + * An enum containing [DiscountType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [DiscountType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PERCENTAGE, + /** + * An enum member indicating that [DiscountType] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { PERCENTAGE -> Value.PERCENTAGE else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { PERCENTAGE -> Known.PERCENTAGE 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 d979c82c..b9d3f0cf 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 @@ -350,7 +350,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Plan]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustments: JsonField>? = null @@ -552,6 +553,14 @@ private constructor( fun discount(trial: TrialDiscount) = discount(Discount.ofTrial(trial)) + fun trialDiscount(appliesToPriceIds: List) = + discount( + TrialDiscount.builder() + .discountType(TrialDiscount.DiscountType.TRIAL) + .appliesToPriceIds(appliesToPriceIds) + .build() + ) + fun discount(usage: Discount.UsageDiscount) = discount(Discount.ofUsage(usage)) fun discount(amount: AmountDiscount) = discount(Discount.ofAmount(amount)) @@ -899,6 +908,20 @@ private constructor( fun addPrice(maxGroupTieredPackage: Price.MaxGroupTieredPackagePrice) = addPrice(Price.ofMaxGroupTieredPackage(maxGroupTieredPackage)) + /** + * Prices for this plan. If the plan has phases, this includes prices across all phases of + * the plan. + */ + fun addPrice(scalableMatrixWithUnitPricing: Price.ScalableMatrixWithUnitPricingPrice) = + addPrice(Price.ofScalableMatrixWithUnitPricing(scalableMatrixWithUnitPricing)) + + /** + * Prices for this plan. If the plan has phases, this includes prices across all phases of + * the plan. + */ + fun addPrice(scalableMatrixWithTieredPricing: Price.ScalableMatrixWithTieredPricingPrice) = + addPrice(Price.ofScalableMatrixWithTieredPricing(scalableMatrixWithTieredPricing)) + fun product(product: Product) = product(JsonField.of(product)) fun product(product: JsonField) = apply { this.product = product } @@ -1100,6 +1123,9 @@ private constructor( @JvmStatic fun ofMaximum(maximum: MaximumAdjustment) = Adjustment(maximum = maximum) } + /** + * An interface that defines how to map each variant of [Adjustment] to a value of type [T]. + */ interface Visitor { fun visitAmountDiscount(amountDiscount: AmountDiscountAdjustment): T @@ -1112,12 +1138,22 @@ private constructor( fun visitMaximum(maximum: MaximumAdjustment): T + /** + * Maps an unknown variant of [Adjustment] to a value of type [T]. + * + * An instance of [Adjustment] can contain an unknown variant if it was deserialized + * from data that doesn't match any known variant. For example, if the SDK is on an + * older version than the API, then the API may respond with new variants that the SDK + * is unaware of. + * + * @throws OrbInvalidDataException in the default implementation. + */ fun unknown(json: JsonValue?): T { throw OrbInvalidDataException("Unknown Adjustment: $json") } } - class Deserializer : BaseDeserializer(Adjustment::class) { + internal class Deserializer : BaseDeserializer(Adjustment::class) { override fun ObjectCodec.deserialize(node: JsonNode): Adjustment { val json = JsonValue.fromJsonNode(node) @@ -1167,7 +1203,7 @@ private constructor( } } - class Serializer : BaseSerializer(Adjustment::class) { + internal class Serializer : BaseSerializer(Adjustment::class) { override fun serialize( value: Adjustment, @@ -1306,7 +1342,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AmountDiscountAdjustment]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustmentType: JsonField? = null @@ -1464,6 +1501,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -1473,21 +1518,53 @@ private constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { AMOUNT_DISCOUNT, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { AMOUNT_DISCOUNT, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { AMOUNT_DISCOUNT -> Value.AMOUNT_DISCOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { AMOUNT_DISCOUNT -> Known.AMOUNT_DISCOUNT @@ -1646,7 +1723,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [PercentageDiscountAdjustment]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustmentType: JsonField? = null @@ -1807,6 +1885,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -1816,21 +1902,53 @@ private constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { PERCENTAGE_DISCOUNT, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PERCENTAGE_DISCOUNT, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { PERCENTAGE_DISCOUNT -> Value.PERCENTAGE_DISCOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { PERCENTAGE_DISCOUNT -> Known.PERCENTAGE_DISCOUNT @@ -1989,7 +2107,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [UsageDiscountAdjustment]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustmentType: JsonField? = null @@ -2147,6 +2266,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -2156,21 +2283,53 @@ private constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { USAGE_DISCOUNT, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { USAGE_DISCOUNT, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { USAGE_DISCOUNT -> Value.USAGE_DISCOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { USAGE_DISCOUNT -> Known.USAGE_DISCOUNT @@ -2339,7 +2498,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MinimumAdjustment]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustmentType: JsonField? = null @@ -2505,6 +2665,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -2514,21 +2682,53 @@ private constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { MINIMUM, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { MINIMUM, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { MINIMUM -> Value.MINIMUM else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { MINIMUM -> Known.MINIMUM @@ -2687,7 +2887,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MaximumAdjustment]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustmentType: JsonField? = null @@ -2844,6 +3045,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -2853,21 +3062,53 @@ private constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { MAXIMUM, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { MAXIMUM, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { MAXIMUM -> Value.MAXIMUM else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { MAXIMUM -> Known.MAXIMUM @@ -2972,7 +3213,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BasePlan]. */ + class Builder internal constructor() { private var id: JsonField? = null private var externalPlanId: JsonField? = null @@ -3130,7 +3372,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Maximum]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var maximumAmount: JsonField? = null @@ -3262,7 +3505,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -3370,7 +3614,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Minimum]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var minimumAmount: JsonField? = null @@ -3605,7 +3850,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [PlanPhase]. */ + class Builder internal constructor() { private var id: JsonField? = null private var description: JsonField? = null @@ -3659,6 +3905,14 @@ private constructor( fun discount(trial: TrialDiscount) = discount(Discount.ofTrial(trial)) + fun trialDiscount(appliesToPriceIds: List) = + discount( + TrialDiscount.builder() + .discountType(TrialDiscount.DiscountType.TRIAL) + .appliesToPriceIds(appliesToPriceIds) + .build() + ) + fun discount(usage: Discount.UsageDiscount) = discount(Discount.ofUsage(usage)) fun discount(amount: AmountDiscount) = discount(Discount.ofAmount(amount)) @@ -3782,6 +4036,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -3799,6 +4061,7 @@ private constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAILY, MONTHLY, @@ -3807,15 +4070,35 @@ private constructor( ANNUAL, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAILY, MONTHLY, QUARTERLY, SEMI_ANNUAL, ANNUAL, + /** + * An enum member indicating that [DurationUnit] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { DAILY -> Value.DAILY @@ -3826,6 +4109,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAILY -> Known.DAILY @@ -3911,7 +4203,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Maximum]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var maximumAmount: JsonField? = null @@ -4075,7 +4368,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Minimum]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var minimumAmount: JsonField? = null @@ -4250,7 +4544,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Product]. */ + class Builder internal constructor() { private var id: JsonField? = null private var createdAt: JsonField? = null @@ -4331,6 +4626,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -4344,19 +4647,37 @@ private constructor( @JvmStatic fun of(value: String) = Status(JsonField.of(value)) } + /** An enum containing [Status]'s known values. */ enum class Known { ACTIVE, ARCHIVED, DRAFT, } + /** + * An enum containing [Status]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Status] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ACTIVE, ARCHIVED, DRAFT, + /** An enum member indicating that [Status] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { ACTIVE -> Value.ACTIVE @@ -4365,6 +4686,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { ACTIVE -> Known.ACTIVE @@ -4438,7 +4767,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TrialConfig]. */ + class Builder internal constructor() { private var trialPeriod: JsonField? = null private var trialPeriodUnit: JsonField? = null @@ -4501,6 +4831,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -4510,21 +4848,51 @@ private constructor( @JvmStatic fun of(value: String) = TrialPeriodUnit(JsonField.of(value)) } + /** An enum containing [TrialPeriodUnit]'s known values. */ enum class Known { DAYS, } + /** + * An enum containing [TrialPeriodUnit]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [TrialPeriodUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAYS, + /** + * An enum member indicating that [TrialPeriodUnit] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { DAYS -> Value.DAYS else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAYS -> Known.DAYS 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 389431b1..7e3c5dab 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 @@ -21,6 +21,7 @@ import com.withorb.api.core.JsonField import com.withorb.api.core.JsonMissing import com.withorb.api.core.JsonValue import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.getOrThrow import com.withorb.api.core.http.Headers @@ -34,11 +35,11 @@ import kotlin.jvm.optionals.getOrNull /** This endpoint allows creation of plans including their prices. */ class PlanCreateParams -constructor( +private constructor( private val body: PlanCreateBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { /** An ISO 4217 currency string for invoices generated by subscriptions on this plan. */ fun currency(): String = body.currency() @@ -116,11 +117,11 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getBody(): PlanCreateBody = body + @JvmSynthetic internal fun _body(): PlanCreateBody = body - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams @NoAutoDetect class PlanCreateBody @@ -259,7 +260,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [PlanCreateBody]. */ + class Builder internal constructor() { private var currency: JsonField? = null private var name: JsonField? = null @@ -484,6 +486,34 @@ constructor( fun addPrice(newPlanMaxGroupTieredPackage: Price.NewPlanMaxGroupTieredPackagePrice) = addPrice(Price.ofNewPlanMaxGroupTieredPackage(newPlanMaxGroupTieredPackage)) + /** + * Prices for this plan. If the plan has phases, this includes prices across all phases + * of the plan. + */ + fun addPrice( + newPlanScalableMatrixWithUnitPricing: + Price.NewPlanScalableMatrixWithUnitPricingPrice + ) = + addPrice( + Price.ofNewPlanScalableMatrixWithUnitPricing( + newPlanScalableMatrixWithUnitPricing + ) + ) + + /** + * Prices for this plan. If the plan has phases, this includes prices across all phases + * of the plan. + */ + fun addPrice( + newPlanScalableMatrixWithTieredPricing: + Price.NewPlanScalableMatrixWithTieredPricingPrice + ) = + addPrice( + Price.ofNewPlanScalableMatrixWithTieredPricing( + newPlanScalableMatrixWithTieredPricing + ) + ) + /** Free-form text which is available on the invoice PDF and the Orb invoice portal. */ fun defaultInvoiceMemo(defaultInvoiceMemo: String?) = defaultInvoiceMemo(JsonField.ofNullable(defaultInvoiceMemo)) @@ -623,8 +653,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [PlanCreateParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var body: PlanCreateBody.Builder = PlanCreateBody.builder() private var additionalHeaders: Headers.Builder = Headers.builder() @@ -838,6 +869,23 @@ constructor( body.addPrice(newPlanMaxGroupTieredPackage) } + /** + * Prices for this plan. If the plan has phases, this includes prices across all phases of + * the plan. + */ + fun addPrice( + newPlanScalableMatrixWithUnitPricing: Price.NewPlanScalableMatrixWithUnitPricingPrice + ) = apply { body.addPrice(newPlanScalableMatrixWithUnitPricing) } + + /** + * Prices for this plan. If the plan has phases, this includes prices across all phases of + * the plan. + */ + fun addPrice( + newPlanScalableMatrixWithTieredPricing: + Price.NewPlanScalableMatrixWithTieredPricingPrice + ) = apply { body.addPrice(newPlanScalableMatrixWithTieredPricing) } + /** Free-form text which is available on the invoice PDF and the Orb invoice portal. */ fun defaultInvoiceMemo(defaultInvoiceMemo: String?) = apply { body.defaultInvoiceMemo(defaultInvoiceMemo) @@ -1071,6 +1119,12 @@ constructor( private val newPlanBulkWithProration: NewPlanBulkWithProrationPrice? = null, private val newPlanGroupedTieredPackage: NewPlanGroupedTieredPackagePrice? = null, private val newPlanMaxGroupTieredPackage: NewPlanMaxGroupTieredPackagePrice? = null, + private val newPlanScalableMatrixWithUnitPricing: + NewPlanScalableMatrixWithUnitPricingPrice? = + null, + private val newPlanScalableMatrixWithTieredPricing: + NewPlanScalableMatrixWithTieredPricingPrice? = + null, private val _json: JsonValue? = null, ) { @@ -1133,6 +1187,14 @@ constructor( fun newPlanMaxGroupTieredPackage(): Optional = Optional.ofNullable(newPlanMaxGroupTieredPackage) + fun newPlanScalableMatrixWithUnitPricing(): + Optional = + Optional.ofNullable(newPlanScalableMatrixWithUnitPricing) + + fun newPlanScalableMatrixWithTieredPricing(): + Optional = + Optional.ofNullable(newPlanScalableMatrixWithTieredPricing) + fun isNewPlanUnit(): Boolean = newPlanUnit != null fun isNewPlanPackage(): Boolean = newPlanPackage != null @@ -1178,6 +1240,12 @@ constructor( fun isNewPlanMaxGroupTieredPackage(): Boolean = newPlanMaxGroupTieredPackage != null + fun isNewPlanScalableMatrixWithUnitPricing(): Boolean = + newPlanScalableMatrixWithUnitPricing != null + + fun isNewPlanScalableMatrixWithTieredPricing(): Boolean = + newPlanScalableMatrixWithTieredPricing != null + fun asNewPlanUnit(): NewPlanUnitPrice = newPlanUnit.getOrThrow("newPlanUnit") fun asNewPlanPackage(): NewPlanPackagePrice = newPlanPackage.getOrThrow("newPlanPackage") @@ -1237,6 +1305,15 @@ constructor( fun asNewPlanMaxGroupTieredPackage(): NewPlanMaxGroupTieredPackagePrice = newPlanMaxGroupTieredPackage.getOrThrow("newPlanMaxGroupTieredPackage") + fun asNewPlanScalableMatrixWithUnitPricing(): NewPlanScalableMatrixWithUnitPricingPrice = + newPlanScalableMatrixWithUnitPricing.getOrThrow("newPlanScalableMatrixWithUnitPricing") + + fun asNewPlanScalableMatrixWithTieredPricing(): + NewPlanScalableMatrixWithTieredPricingPrice = + newPlanScalableMatrixWithTieredPricing.getOrThrow( + "newPlanScalableMatrixWithTieredPricing" + ) + fun _json(): Optional = Optional.ofNullable(_json) fun accept(visitor: Visitor): T { @@ -1279,6 +1356,14 @@ constructor( visitor.visitNewPlanGroupedTieredPackage(newPlanGroupedTieredPackage) newPlanMaxGroupTieredPackage != null -> visitor.visitNewPlanMaxGroupTieredPackage(newPlanMaxGroupTieredPackage) + newPlanScalableMatrixWithUnitPricing != null -> + visitor.visitNewPlanScalableMatrixWithUnitPricing( + newPlanScalableMatrixWithUnitPricing + ) + newPlanScalableMatrixWithTieredPricing != null -> + visitor.visitNewPlanScalableMatrixWithTieredPricing( + newPlanScalableMatrixWithTieredPricing + ) else -> visitor.unknown(_json) } } @@ -1407,6 +1492,20 @@ constructor( ) { newPlanMaxGroupTieredPackage.validate() } + + override fun visitNewPlanScalableMatrixWithUnitPricing( + newPlanScalableMatrixWithUnitPricing: + NewPlanScalableMatrixWithUnitPricingPrice + ) { + newPlanScalableMatrixWithUnitPricing.validate() + } + + override fun visitNewPlanScalableMatrixWithTieredPricing( + newPlanScalableMatrixWithTieredPricing: + NewPlanScalableMatrixWithTieredPricingPrice + ) { + newPlanScalableMatrixWithTieredPricing.validate() + } } ) validated = true @@ -1417,10 +1516,10 @@ constructor( return true } - return /* spotless:off */ other is Price && newPlanUnit == other.newPlanUnit && newPlanPackage == other.newPlanPackage && newPlanMatrix == other.newPlanMatrix && newPlanTiered == other.newPlanTiered && newPlanTieredBps == other.newPlanTieredBps && newPlanBps == other.newPlanBps && newPlanBulkBps == other.newPlanBulkBps && newPlanBulk == other.newPlanBulk && newPlanThresholdTotalAmount == other.newPlanThresholdTotalAmount && newPlanTieredPackage == other.newPlanTieredPackage && newPlanTieredWithMinimum == other.newPlanTieredWithMinimum && newPlanUnitWithPercent == other.newPlanUnitWithPercent && newPlanPackageWithAllocation == other.newPlanPackageWithAllocation && newPlanTierWithProration == other.newPlanTierWithProration && newPlanUnitWithProration == other.newPlanUnitWithProration && newPlanGroupedAllocation == other.newPlanGroupedAllocation && newPlanGroupedWithProratedMinimum == other.newPlanGroupedWithProratedMinimum && newPlanGroupedWithMeteredMinimum == other.newPlanGroupedWithMeteredMinimum && newPlanMatrixWithDisplayName == other.newPlanMatrixWithDisplayName && newPlanBulkWithProration == other.newPlanBulkWithProration && newPlanGroupedTieredPackage == other.newPlanGroupedTieredPackage && newPlanMaxGroupTieredPackage == other.newPlanMaxGroupTieredPackage /* spotless:on */ + return /* spotless:off */ other is Price && newPlanUnit == other.newPlanUnit && newPlanPackage == other.newPlanPackage && newPlanMatrix == other.newPlanMatrix && newPlanTiered == other.newPlanTiered && newPlanTieredBps == other.newPlanTieredBps && newPlanBps == other.newPlanBps && newPlanBulkBps == other.newPlanBulkBps && newPlanBulk == other.newPlanBulk && newPlanThresholdTotalAmount == other.newPlanThresholdTotalAmount && newPlanTieredPackage == other.newPlanTieredPackage && newPlanTieredWithMinimum == other.newPlanTieredWithMinimum && newPlanUnitWithPercent == other.newPlanUnitWithPercent && newPlanPackageWithAllocation == other.newPlanPackageWithAllocation && newPlanTierWithProration == other.newPlanTierWithProration && newPlanUnitWithProration == other.newPlanUnitWithProration && newPlanGroupedAllocation == other.newPlanGroupedAllocation && newPlanGroupedWithProratedMinimum == other.newPlanGroupedWithProratedMinimum && newPlanGroupedWithMeteredMinimum == other.newPlanGroupedWithMeteredMinimum && newPlanMatrixWithDisplayName == other.newPlanMatrixWithDisplayName && newPlanBulkWithProration == other.newPlanBulkWithProration && newPlanGroupedTieredPackage == other.newPlanGroupedTieredPackage && newPlanMaxGroupTieredPackage == other.newPlanMaxGroupTieredPackage && newPlanScalableMatrixWithUnitPricing == other.newPlanScalableMatrixWithUnitPricing && newPlanScalableMatrixWithTieredPricing == other.newPlanScalableMatrixWithTieredPricing /* spotless:on */ } - override fun hashCode(): Int = /* spotless:off */ Objects.hash(newPlanUnit, newPlanPackage, newPlanMatrix, newPlanTiered, newPlanTieredBps, newPlanBps, newPlanBulkBps, newPlanBulk, newPlanThresholdTotalAmount, newPlanTieredPackage, newPlanTieredWithMinimum, newPlanUnitWithPercent, newPlanPackageWithAllocation, newPlanTierWithProration, newPlanUnitWithProration, newPlanGroupedAllocation, newPlanGroupedWithProratedMinimum, newPlanGroupedWithMeteredMinimum, newPlanMatrixWithDisplayName, newPlanBulkWithProration, newPlanGroupedTieredPackage, newPlanMaxGroupTieredPackage) /* spotless:on */ + override fun hashCode(): Int = /* spotless:off */ Objects.hash(newPlanUnit, newPlanPackage, newPlanMatrix, newPlanTiered, newPlanTieredBps, newPlanBps, newPlanBulkBps, newPlanBulk, newPlanThresholdTotalAmount, newPlanTieredPackage, newPlanTieredWithMinimum, newPlanUnitWithPercent, newPlanPackageWithAllocation, newPlanTierWithProration, newPlanUnitWithProration, newPlanGroupedAllocation, newPlanGroupedWithProratedMinimum, newPlanGroupedWithMeteredMinimum, newPlanMatrixWithDisplayName, newPlanBulkWithProration, newPlanGroupedTieredPackage, newPlanMaxGroupTieredPackage, newPlanScalableMatrixWithUnitPricing, newPlanScalableMatrixWithTieredPricing) /* spotless:on */ override fun toString(): String = when { @@ -1459,6 +1558,10 @@ constructor( "Price{newPlanGroupedTieredPackage=$newPlanGroupedTieredPackage}" newPlanMaxGroupTieredPackage != null -> "Price{newPlanMaxGroupTieredPackage=$newPlanMaxGroupTieredPackage}" + newPlanScalableMatrixWithUnitPricing != null -> + "Price{newPlanScalableMatrixWithUnitPricing=$newPlanScalableMatrixWithUnitPricing}" + newPlanScalableMatrixWithTieredPricing != null -> + "Price{newPlanScalableMatrixWithTieredPricing=$newPlanScalableMatrixWithTieredPricing}" _json != null -> "Price{_unknown=$_json}" else -> throw IllegalStateException("Invalid Price") } @@ -1561,8 +1664,22 @@ constructor( fun ofNewPlanMaxGroupTieredPackage( newPlanMaxGroupTieredPackage: NewPlanMaxGroupTieredPackagePrice ) = Price(newPlanMaxGroupTieredPackage = newPlanMaxGroupTieredPackage) + + @JvmStatic + fun ofNewPlanScalableMatrixWithUnitPricing( + newPlanScalableMatrixWithUnitPricing: NewPlanScalableMatrixWithUnitPricingPrice + ) = Price(newPlanScalableMatrixWithUnitPricing = newPlanScalableMatrixWithUnitPricing) + + @JvmStatic + fun ofNewPlanScalableMatrixWithTieredPricing( + newPlanScalableMatrixWithTieredPricing: NewPlanScalableMatrixWithTieredPricingPrice + ) = + Price( + newPlanScalableMatrixWithTieredPricing = newPlanScalableMatrixWithTieredPricing + ) } + /** An interface that defines how to map each variant of [Price] to a value of type [T]. */ interface Visitor { fun visitNewPlanUnit(newPlanUnit: NewPlanUnitPrice): T @@ -1633,12 +1750,30 @@ constructor( newPlanMaxGroupTieredPackage: NewPlanMaxGroupTieredPackagePrice ): T + fun visitNewPlanScalableMatrixWithUnitPricing( + newPlanScalableMatrixWithUnitPricing: NewPlanScalableMatrixWithUnitPricingPrice + ): T + + fun visitNewPlanScalableMatrixWithTieredPricing( + newPlanScalableMatrixWithTieredPricing: NewPlanScalableMatrixWithTieredPricingPrice + ): T + + /** + * Maps an unknown variant of [Price] to a value of type [T]. + * + * An instance of [Price] can contain an unknown variant if it was deserialized from + * data that doesn't match any known variant. For example, if the SDK is on an older + * version than the API, then the API may respond with new variants that the SDK is + * unaware of. + * + * @throws OrbInvalidDataException in the default implementation. + */ fun unknown(json: JsonValue?): T { throw OrbInvalidDataException("Unknown Price: $json") } } - class Deserializer : BaseDeserializer(Price::class) { + internal class Deserializer : BaseDeserializer(Price::class) { override fun ObjectCodec.deserialize(node: JsonNode): Price { val json = JsonValue.fromJsonNode(node) @@ -1818,13 +1953,41 @@ constructor( return Price(newPlanMaxGroupTieredPackage = it, _json = json) } } + "scalable_matrix_with_unit_pricing" -> { + tryDeserialize( + node, + jacksonTypeRef() + ) { + it.validate() + } + ?.let { + return Price( + newPlanScalableMatrixWithUnitPricing = it, + _json = json + ) + } + } + "scalable_matrix_with_tiered_pricing" -> { + tryDeserialize( + node, + jacksonTypeRef() + ) { + it.validate() + } + ?.let { + return Price( + newPlanScalableMatrixWithTieredPricing = it, + _json = json + ) + } + } } return Price(_json = json) } } - class Serializer : BaseSerializer(Price::class) { + internal class Serializer : BaseSerializer(Price::class) { override fun serialize( value: Price, @@ -1868,6 +2031,10 @@ constructor( generator.writeObject(value.newPlanGroupedTieredPackage) value.newPlanMaxGroupTieredPackage != null -> generator.writeObject(value.newPlanMaxGroupTieredPackage) + value.newPlanScalableMatrixWithUnitPricing != null -> + generator.writeObject(value.newPlanScalableMatrixWithUnitPricing) + value.newPlanScalableMatrixWithTieredPricing != null -> + generator.writeObject(value.newPlanScalableMatrixWithTieredPricing) value._json != null -> generator.writeObject(value._json) else -> throw IllegalStateException("Invalid Price") } @@ -2126,7 +2293,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewPlanUnitPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var itemId: JsonField? = null @@ -2460,6 +2628,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -2479,6 +2655,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -2488,6 +2665,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -2495,9 +2681,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -2509,6 +2706,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -2541,6 +2747,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -2550,21 +2764,51 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { UNIT, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { UNIT, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { UNIT -> Value.UNIT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { UNIT -> Known.UNIT @@ -2627,7 +2871,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [UnitConfig]. */ + class Builder internal constructor() { private var unitAmount: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -2749,7 +2994,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -2816,6 +3062,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -2828,17 +3082,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -2846,6 +3123,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -2943,7 +3229,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -3010,6 +3297,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -3022,17 +3317,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -3040,6 +3358,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -3114,7 +3441,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -3435,7 +3763,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewPlanPackagePrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var itemId: JsonField? = null @@ -3770,6 +4099,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -3789,6 +4126,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -3798,6 +4136,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -3805,9 +4152,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -3819,6 +4177,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -3851,6 +4218,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -3860,21 +4235,51 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { PACKAGE, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PACKAGE, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { PACKAGE -> Value.PACKAGE else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { PACKAGE -> Known.PACKAGE @@ -3955,7 +4360,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [PackageConfig]. */ + class Builder internal constructor() { private var packageAmount: JsonField? = null private var packageSize: JsonField? = null @@ -4095,7 +4501,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -4162,6 +4569,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -4174,17 +4589,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -4192,6 +4630,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -4289,7 +4736,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -4356,6 +4804,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -4368,17 +4824,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -4386,6 +4865,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -4460,7 +4948,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -4781,7 +5270,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewPlanMatrixPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var itemId: JsonField? = null @@ -5116,6 +5606,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -5135,6 +5633,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -5144,6 +5643,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -5151,9 +5659,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -5165,6 +5684,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -5261,7 +5789,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MatrixConfig]. */ + class Builder internal constructor() { private var defaultUnitAmount: JsonField? = null private var dimensions: JsonField>? = null @@ -5429,7 +5958,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MatrixValue]. */ + class Builder internal constructor() { private var dimensionValues: JsonField>? = null private var unitAmount: JsonField? = null @@ -5560,6 +6090,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -5569,21 +6107,51 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { MATRIX, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { MATRIX, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { MATRIX -> Value.MATRIX else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { MATRIX -> Known.MATRIX @@ -5661,7 +6229,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -5728,6 +6297,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -5740,17 +6317,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -5758,6 +6358,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -5855,7 +6464,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -5922,6 +6532,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -5934,17 +6552,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -5952,6 +6593,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -6026,7 +6676,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -6347,7 +6998,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewPlanTieredPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var itemId: JsonField? = null @@ -6682,6 +7334,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -6701,6 +7361,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -6710,6 +7371,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -6717,9 +7387,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -6731,6 +7412,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -6763,6 +7453,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -6772,21 +7470,51 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { TIERED, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { TIERED, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { TIERED -> Value.TIERED else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { TIERED -> Known.TIERED @@ -6847,7 +7575,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TieredConfig]. */ + class Builder internal constructor() { private var tiers: JsonField>? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -6975,7 +7704,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Tier]. */ + class Builder internal constructor() { private var firstUnit: JsonField? = null private var unitAmount: JsonField? = null @@ -7156,7 +7886,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -7223,6 +7954,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -7235,17 +7974,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -7253,6 +8015,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -7350,7 +8121,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -7417,6 +8189,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -7429,17 +8209,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -7447,6 +8250,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -7521,7 +8333,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -7843,7 +8656,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewPlanTieredBpsPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var itemId: JsonField? = null @@ -8178,6 +8992,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -8197,6 +9019,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -8206,6 +9029,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -8213,9 +9045,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -8227,6 +9070,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -8259,6 +9111,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -8268,21 +9128,51 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { TIERED_BPS, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { TIERED_BPS, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { TIERED_BPS -> Value.TIERED_BPS else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { TIERED_BPS -> Known.TIERED_BPS @@ -8349,7 +9239,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TieredBpsConfig]. */ + class Builder internal constructor() { private var tiers: JsonField>? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -8497,7 +9388,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Tier]. */ + class Builder internal constructor() { private var bps: JsonField? = null private var minimumAmount: JsonField? = null @@ -8680,7 +9572,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -8747,6 +9640,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -8759,17 +9660,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -8777,6 +9701,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -8874,7 +9807,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -8941,6 +9875,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -8953,17 +9895,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -8971,6 +9936,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -9045,7 +10019,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -9366,7 +10341,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewPlanBpsPrice]. */ + class Builder internal constructor() { private var bpsConfig: JsonField? = null private var cadence: JsonField? = null @@ -9745,7 +10721,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BpsConfig]. */ + class Builder internal constructor() { private var bps: JsonField? = null private var perUnitMaximum: JsonField = JsonMissing.of() @@ -9832,6 +10809,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -9851,6 +10836,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -9860,6 +10846,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -9867,9 +10862,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -9881,6 +10887,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -9913,6 +10928,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -9922,21 +10945,51 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { BPS, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { BPS, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { BPS -> Value.BPS else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { BPS -> Known.BPS @@ -10014,7 +11067,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -10081,6 +11135,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -10093,17 +11155,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -10111,6 +11196,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -10208,7 +11302,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -10275,6 +11370,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -10287,17 +11390,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -10305,6 +11431,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -10379,7 +11514,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -10700,7 +11836,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewPlanBulkBpsPrice]. */ + class Builder internal constructor() { private var bulkBpsConfig: JsonField? = null private var cadence: JsonField? = null @@ -11073,7 +12210,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BulkBpsConfig]. */ + class Builder internal constructor() { private var tiers: JsonField>? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -11209,7 +12347,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Tier]. */ + class Builder internal constructor() { private var bps: JsonField? = null private var maximumAmount: JsonField = JsonMissing.of() @@ -11331,6 +12470,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -11350,6 +12497,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -11359,6 +12507,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -11366,9 +12523,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -11380,6 +12548,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -11412,6 +12589,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -11421,21 +12606,51 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { BULK_BPS, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { BULK_BPS, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { BULK_BPS -> Value.BULK_BPS else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { BULK_BPS -> Known.BULK_BPS @@ -11513,7 +12728,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -11580,6 +12796,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -11592,17 +12816,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -11610,6 +12857,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -11707,7 +12963,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -11774,6 +13031,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -11786,17 +13051,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -11804,6 +13092,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -11878,7 +13175,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -12199,7 +13497,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewPlanBulkPrice]. */ + class Builder internal constructor() { private var bulkConfig: JsonField? = null private var cadence: JsonField? = null @@ -12565,7 +13864,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BulkConfig]. */ + class Builder internal constructor() { private var tiers: JsonField>? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -12681,7 +13981,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Tier]. */ + class Builder internal constructor() { private var unitAmount: JsonField? = null private var maximumUnits: JsonField = JsonMissing.of() @@ -12796,6 +14097,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -12815,6 +14124,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -12824,6 +14134,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -12831,9 +14150,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -12845,6 +14175,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -12877,6 +14216,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -12886,21 +14233,51 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { BULK, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { BULK, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { BULK -> Value.BULK else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { BULK -> Known.BULK @@ -12978,7 +14355,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -13045,6 +14423,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -13057,17 +14443,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -13075,6 +14484,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -13172,7 +14590,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -13239,6 +14658,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -13251,17 +14678,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -13269,6 +14719,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -13343,7 +14802,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -13667,7 +15127,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewPlanThresholdTotalAmountPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var itemId: JsonField? = null @@ -14010,6 +15471,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -14029,6 +15498,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -14038,6 +15508,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -14045,9 +15524,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -14059,6 +15549,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -14091,6 +15590,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -14100,21 +15607,51 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { THRESHOLD_TOTAL_AMOUNT, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { THRESHOLD_TOTAL_AMOUNT, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { THRESHOLD_TOTAL_AMOUNT -> Value.THRESHOLD_TOTAL_AMOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { THRESHOLD_TOTAL_AMOUNT -> Known.THRESHOLD_TOTAL_AMOUNT @@ -14165,7 +15702,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [ThresholdTotalAmountConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -14276,7 +15814,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -14343,6 +15882,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -14355,17 +15902,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -14373,6 +15943,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -14470,7 +16049,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -14537,6 +16117,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -14549,17 +16137,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -14567,6 +16178,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -14641,7 +16261,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -14963,7 +16584,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewPlanTieredPackagePrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var itemId: JsonField? = null @@ -15301,6 +16923,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -15320,6 +16950,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -15329,6 +16960,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -15336,9 +16976,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -15350,6 +17001,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -15382,6 +17042,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -15391,21 +17059,51 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { TIERED_PACKAGE, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { TIERED_PACKAGE, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { TIERED_PACKAGE -> Value.TIERED_PACKAGE else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { TIERED_PACKAGE -> Known.TIERED_PACKAGE @@ -15456,7 +17154,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TieredPackageConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -15566,7 +17265,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -15633,6 +17333,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -15645,17 +17353,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -15663,6 +17394,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -15760,7 +17500,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -15827,6 +17568,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -15839,17 +17588,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -15857,6 +17629,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -15931,7 +17712,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -16255,7 +18037,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewPlanTieredWithMinimumPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var itemId: JsonField? = null @@ -16595,6 +18378,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -16614,6 +18405,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -16623,6 +18415,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -16630,9 +18431,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -16644,6 +18456,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -16676,6 +18497,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -16685,21 +18514,51 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { TIERED_WITH_MINIMUM, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { TIERED_WITH_MINIMUM, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { TIERED_WITH_MINIMUM -> Value.TIERED_WITH_MINIMUM else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { TIERED_WITH_MINIMUM -> Known.TIERED_WITH_MINIMUM @@ -16750,7 +18609,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TieredWithMinimumConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -16860,7 +18720,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -16927,6 +18788,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -16939,17 +18808,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -16957,6 +18849,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -17054,7 +18955,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -17121,6 +19023,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -17133,17 +19043,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -17151,6 +19084,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -17225,7 +19167,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -17547,7 +19490,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewPlanUnitWithPercentPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var itemId: JsonField? = null @@ -17887,6 +19831,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -17906,6 +19858,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -17915,6 +19868,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -17922,9 +19884,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -17936,6 +19909,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -17968,6 +19950,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -17977,21 +19967,51 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { UNIT_WITH_PERCENT, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { UNIT_WITH_PERCENT, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { UNIT_WITH_PERCENT -> Value.UNIT_WITH_PERCENT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { UNIT_WITH_PERCENT -> Known.UNIT_WITH_PERCENT @@ -18042,7 +20062,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [UnitWithPercentConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -18152,7 +20173,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -18219,6 +20241,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -18231,17 +20261,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -18249,6 +20302,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -18346,7 +20408,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -18413,6 +20476,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -18425,17 +20496,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -18443,6 +20537,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -18517,7 +20620,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -18841,7 +20945,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewPlanPackageWithAllocationPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var itemId: JsonField? = null @@ -19184,6 +21289,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -19203,6 +21316,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -19212,6 +21326,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -19219,9 +21342,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -19233,6 +21367,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -19265,6 +21408,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -19274,21 +21425,51 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { PACKAGE_WITH_ALLOCATION, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PACKAGE_WITH_ALLOCATION, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { PACKAGE_WITH_ALLOCATION -> Value.PACKAGE_WITH_ALLOCATION else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { PACKAGE_WITH_ALLOCATION -> Known.PACKAGE_WITH_ALLOCATION @@ -19339,7 +21520,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [PackageWithAllocationConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -19450,7 +21632,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -19517,6 +21700,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -19529,17 +21720,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -19547,6 +21761,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -19644,7 +21867,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -19711,6 +21935,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -19723,17 +21955,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -19741,6 +21996,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -19815,7 +22079,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -20139,7 +22404,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewPlanTierWithProrationPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var itemId: JsonField? = null @@ -20480,6 +22746,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -20499,6 +22773,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -20508,6 +22783,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -20515,9 +22799,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -20529,6 +22824,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -20561,6 +22865,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -20570,21 +22882,51 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { TIERED_WITH_PRORATION, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { TIERED_WITH_PRORATION, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { TIERED_WITH_PRORATION -> Value.TIERED_WITH_PRORATION else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { TIERED_WITH_PRORATION -> Known.TIERED_WITH_PRORATION @@ -20635,7 +22977,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TieredWithProrationConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -20746,7 +23089,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -20813,6 +23157,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -20825,17 +23177,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -20843,6 +23218,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -20940,7 +23324,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -21007,6 +23392,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -21019,17 +23412,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -21037,6 +23453,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -21111,7 +23536,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -21435,7 +23861,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewPlanUnitWithProrationPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var itemId: JsonField? = null @@ -21775,6 +24202,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -21794,6 +24229,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -21803,6 +24239,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -21810,9 +24255,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -21824,6 +24280,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -21856,6 +24321,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -21865,21 +24338,51 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { UNIT_WITH_PRORATION, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { UNIT_WITH_PRORATION, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { UNIT_WITH_PRORATION -> Value.UNIT_WITH_PRORATION else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { UNIT_WITH_PRORATION -> Known.UNIT_WITH_PRORATION @@ -21930,7 +24433,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [UnitWithProrationConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -22040,7 +24544,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -22107,6 +24612,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -22119,17 +24632,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -22137,6 +24673,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -22234,7 +24779,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -22301,6 +24847,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -22313,17 +24867,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -22331,6 +24908,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -22405,7 +24991,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -22729,7 +25316,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewPlanGroupedAllocationPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var groupedAllocationConfig: JsonField? = null @@ -23069,6 +25657,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -23088,6 +25684,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -23097,6 +25694,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -23104,9 +25710,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -23118,6 +25735,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -23173,7 +25799,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [GroupedAllocationConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -23233,6 +25860,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -23242,21 +25877,51 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { GROUPED_ALLOCATION, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { GROUPED_ALLOCATION, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { GROUPED_ALLOCATION -> Value.GROUPED_ALLOCATION else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { GROUPED_ALLOCATION -> Known.GROUPED_ALLOCATION @@ -23334,7 +25999,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -23401,6 +26067,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -23413,17 +26087,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -23431,6 +26128,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -23528,7 +26234,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -23595,6 +26302,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -23607,17 +26322,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -23625,6 +26363,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -23699,7 +26446,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -24024,7 +26772,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewPlanGroupedWithProratedMinimumPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var groupedWithProratedMinimumConfig: @@ -24373,6 +27122,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -24392,6 +27149,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -24401,6 +27159,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -24408,9 +27175,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -24422,6 +27200,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -24477,7 +27264,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [GroupedWithProratedMinimumConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -24539,6 +27327,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -24549,21 +27345,51 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { GROUPED_WITH_PRORATED_MINIMUM, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { GROUPED_WITH_PRORATED_MINIMUM, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { GROUPED_WITH_PRORATED_MINIMUM -> Value.GROUPED_WITH_PRORATED_MINIMUM else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { GROUPED_WITH_PRORATED_MINIMUM -> Known.GROUPED_WITH_PRORATED_MINIMUM @@ -24641,7 +27467,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -24708,6 +27535,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -24720,17 +27555,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -24738,6 +27596,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -24835,7 +27702,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -24902,6 +27770,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -24914,17 +27790,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -24932,6 +27831,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -25006,7 +27914,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -25331,7 +28240,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewPlanGroupedWithMeteredMinimumPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var groupedWithMeteredMinimumConfig: @@ -25678,6 +28588,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -25697,6 +28615,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -25706,6 +28625,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -25713,9 +28641,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -25727,6 +28666,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -25782,7 +28730,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [GroupedWithMeteredMinimumConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -25844,6 +28793,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -25853,21 +28810,51 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { GROUPED_WITH_METERED_MINIMUM, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { GROUPED_WITH_METERED_MINIMUM, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { GROUPED_WITH_METERED_MINIMUM -> Value.GROUPED_WITH_METERED_MINIMUM else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { GROUPED_WITH_METERED_MINIMUM -> Known.GROUPED_WITH_METERED_MINIMUM @@ -25945,7 +28932,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -26012,6 +29000,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -26024,17 +29020,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -26042,6 +29061,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -26139,7 +29167,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -26206,6 +29235,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -26218,17 +29255,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -26236,6 +29296,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -26310,7 +29379,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -26634,7 +29704,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewPlanMatrixWithDisplayNamePrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var itemId: JsonField? = null @@ -26977,6 +30048,2928 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ + @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)) + } + + /** An enum containing [Cadence]'s known values. */ + enum class Known { + ANNUAL, + SEMI_ANNUAL, + MONTHLY, + QUARTERLY, + ONE_TIME, + CUSTOM, + } + + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + ANNUAL, + SEMI_ANNUAL, + MONTHLY, + QUARTERLY, + ONE_TIME, + CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ + 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 + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ + 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 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() + } + + /** A builder for [MatrixWithDisplayNameConfig]. */ + class Builder internal constructor() { + + 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( + private val value: JsonField, + ) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val MATRIX_WITH_DISPLAY_NAME = of("matrix_with_display_name") + + @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) + } + + /** An enum containing [ModelType]'s known values. */ + enum class Known { + MATRIX_WITH_DISPLAY_NAME, + } + + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + MATRIX_WITH_DISPLAY_NAME, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + MATRIX_WITH_DISPLAY_NAME -> Value.MATRIX_WITH_DISPLAY_NAME + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + MATRIX_WITH_DISPLAY_NAME -> Known.MATRIX_WITH_DISPLAY_NAME + 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() + } + + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { + + 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(), + ) + } + + /** The unit of billing period duration. */ + class DurationUnit + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ + @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)) + } + + /** An enum containing [DurationUnit]'s known values. */ + enum class Known { + DAY, + MONTH, + } + + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + DAY, + MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + DAY -> Value.DAY + MONTH -> Value.MONTH + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ + 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() + } + + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { + + 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(), + ) + } + + /** The unit of billing period duration. */ + class DurationUnit + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ + @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)) + } + + /** An enum containing [DurationUnit]'s known values. */ + enum class Known { + DAY, + MONTH, + } + + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + DAY, + MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + DAY -> Value.DAY + MONTH -> Value.MONTH + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ + 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() + } + + /** A builder for [Metadata]. */ + class Builder internal constructor() { + + 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 NewPlanMatrixWithDisplayNamePrice && cadence == other.cadence && itemId == other.itemId && matrixWithDisplayNameConfig == other.matrixWithDisplayNameConfig && 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, matrixWithDisplayNameConfig, modelType, name, billableMetricId, billedInAdvance, billingCycleConfiguration, conversionRate, currency, externalPriceId, fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, metadata, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "NewPlanMatrixWithDisplayNamePrice{cadence=$cadence, itemId=$itemId, matrixWithDisplayNameConfig=$matrixWithDisplayNameConfig, 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 NewPlanBulkWithProrationPrice + @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("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("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(), + ) { + + fun bulkWithProrationConfig(): BulkWithProrationConfig = + bulkWithProrationConfig.getRequired("bulk_with_proration_config") + + /** The cadence to bill for this price on. */ + fun cadence(): Cadence = cadence.getRequired("cadence") + + /** 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 ISO 4217 currency string, or custom pricing unit identifier, in which this price + * is billed. + */ + fun currency(): Optional = Optional.ofNullable(currency.getNullable("currency")) + + /** 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")) + + @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 + + /** 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 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(): NewPlanBulkWithProrationPrice = apply { + if (validated) { + return@apply + } + + bulkWithProrationConfig().validate() + cadence() + itemId() + 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() + } + + /** A builder for [NewPlanBulkWithProrationPrice]. */ + class Builder internal constructor() { + + private var bulkWithProrationConfig: JsonField? = null + private var cadence: 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 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(newPlanBulkWithProrationPrice: NewPlanBulkWithProrationPrice) = + apply { + bulkWithProrationConfig = + newPlanBulkWithProrationPrice.bulkWithProrationConfig + cadence = newPlanBulkWithProrationPrice.cadence + itemId = newPlanBulkWithProrationPrice.itemId + modelType = newPlanBulkWithProrationPrice.modelType + name = newPlanBulkWithProrationPrice.name + billableMetricId = newPlanBulkWithProrationPrice.billableMetricId + billedInAdvance = newPlanBulkWithProrationPrice.billedInAdvance + billingCycleConfiguration = + newPlanBulkWithProrationPrice.billingCycleConfiguration + conversionRate = newPlanBulkWithProrationPrice.conversionRate + currency = newPlanBulkWithProrationPrice.currency + externalPriceId = newPlanBulkWithProrationPrice.externalPriceId + fixedPriceQuantity = newPlanBulkWithProrationPrice.fixedPriceQuantity + invoiceGroupingKey = newPlanBulkWithProrationPrice.invoiceGroupingKey + invoicingCycleConfiguration = + newPlanBulkWithProrationPrice.invoicingCycleConfiguration + metadata = newPlanBulkWithProrationPrice.metadata + additionalProperties = + newPlanBulkWithProrationPrice.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)) + + /** 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 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(): NewPlanBulkWithProrationPrice = + NewPlanBulkWithProrationPrice( + checkRequired("bulkWithProrationConfig", bulkWithProrationConfig), + checkRequired("cadence", cadence), + checkRequired("itemId", itemId), + checkRequired("modelType", modelType), + checkRequired("name", name), + billableMetricId, + billedInAdvance, + billingCycleConfiguration, + conversionRate, + currency, + externalPriceId, + fixedPriceQuantity, + invoiceGroupingKey, + invoicingCycleConfiguration, + metadata, + additionalProperties.toImmutable(), + ) + } + + @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() + } + + /** A builder for [BulkWithProrationConfig]. */ + class Builder internal constructor() { + + 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( + private val value: JsonField, + ) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ + @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)) + } + + /** An enum containing [Cadence]'s known values. */ + enum class Known { + ANNUAL, + SEMI_ANNUAL, + MONTHLY, + QUARTERLY, + ONE_TIME, + CUSTOM, + } + + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + ANNUAL, + SEMI_ANNUAL, + MONTHLY, + QUARTERLY, + ONE_TIME, + CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ + 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 + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ + 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() + } + + class ModelType + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val BULK_WITH_PRORATION = of("bulk_with_proration") + + @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) + } + + /** An enum containing [ModelType]'s known values. */ + enum class Known { + BULK_WITH_PRORATION, + } + + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + BULK_WITH_PRORATION, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + BULK_WITH_PRORATION -> Value.BULK_WITH_PRORATION + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + BULK_WITH_PRORATION -> Known.BULK_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() + } + + /** + * 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() + } + + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { + + 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(), + ) + } + + /** The unit of billing period duration. */ + class DurationUnit + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ + @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)) + } + + /** An enum containing [DurationUnit]'s known values. */ + enum class Known { + DAY, + MONTH, + } + + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + DAY, + MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + DAY -> Value.DAY + MONTH -> Value.MONTH + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ + 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() + } + + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { + + 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(), + ) + } + + /** The unit of billing period duration. */ + class DurationUnit + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ + @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)) + } + + /** An enum containing [DurationUnit]'s known values. */ + enum class Known { + DAY, + MONTH, + } + + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + DAY, + MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + DAY -> Value.DAY + MONTH -> Value.MONTH + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ + 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() + } + + /** A builder for [Metadata]. */ + class Builder internal constructor() { + + 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 NewPlanBulkWithProrationPrice && bulkWithProrationConfig == other.bulkWithProrationConfig && cadence == other.cadence && itemId == other.itemId && 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(bulkWithProrationConfig, cadence, itemId, modelType, name, billableMetricId, billedInAdvance, billingCycleConfiguration, conversionRate, currency, externalPriceId, fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, metadata, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "NewPlanBulkWithProrationPrice{bulkWithProrationConfig=$bulkWithProrationConfig, cadence=$cadence, 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 NewPlanGroupedTieredPackagePrice + @JsonCreator + private constructor( + @JsonProperty("cadence") + @ExcludeMissing + private val cadence: 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("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(), + ) { + + /** The cadence to bill for this price on. */ + fun cadence(): Cadence = cadence.getRequired("cadence") + + 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 ISO 4217 currency string, or custom pricing unit identifier, in which this price + * is billed. + */ + fun currency(): Optional = Optional.ofNullable(currency.getNullable("currency")) + + /** 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 + + @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 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(): NewPlanGroupedTieredPackagePrice = apply { + if (validated) { + return@apply + } + + cadence() + groupedTieredPackageConfig().validate() + itemId() + 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() + } + + /** A builder for [NewPlanGroupedTieredPackagePrice]. */ + class Builder internal constructor() { + + private var cadence: 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 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( + newPlanGroupedTieredPackagePrice: NewPlanGroupedTieredPackagePrice + ) = apply { + cadence = newPlanGroupedTieredPackagePrice.cadence + groupedTieredPackageConfig = + newPlanGroupedTieredPackagePrice.groupedTieredPackageConfig + itemId = newPlanGroupedTieredPackagePrice.itemId + modelType = newPlanGroupedTieredPackagePrice.modelType + name = newPlanGroupedTieredPackagePrice.name + billableMetricId = newPlanGroupedTieredPackagePrice.billableMetricId + billedInAdvance = newPlanGroupedTieredPackagePrice.billedInAdvance + billingCycleConfiguration = + newPlanGroupedTieredPackagePrice.billingCycleConfiguration + conversionRate = newPlanGroupedTieredPackagePrice.conversionRate + currency = newPlanGroupedTieredPackagePrice.currency + externalPriceId = newPlanGroupedTieredPackagePrice.externalPriceId + fixedPriceQuantity = newPlanGroupedTieredPackagePrice.fixedPriceQuantity + invoiceGroupingKey = newPlanGroupedTieredPackagePrice.invoiceGroupingKey + invoicingCycleConfiguration = + newPlanGroupedTieredPackagePrice.invoicingCycleConfiguration + metadata = newPlanGroupedTieredPackagePrice.metadata + additionalProperties = + newPlanGroupedTieredPackagePrice.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 } + + 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 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(): NewPlanGroupedTieredPackagePrice = + NewPlanGroupedTieredPackagePrice( + checkRequired("cadence", cadence), + checkRequired("groupedTieredPackageConfig", groupedTieredPackageConfig), + checkRequired("itemId", itemId), + checkRequired("modelType", modelType), + checkRequired("name", name), + billableMetricId, + billedInAdvance, + billingCycleConfiguration, + conversionRate, + currency, + externalPriceId, + fixedPriceQuantity, + invoiceGroupingKey, + invoicingCycleConfiguration, + metadata, + additionalProperties.toImmutable(), + ) + } + + /** The cadence to bill for this price on. */ + class Cadence + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -26996,6 +32989,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -27005,6 +32999,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -27012,9 +33015,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -27026,6 +33040,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -27053,7 +33076,7 @@ constructor( } @NoAutoDetect - class MatrixWithDisplayNameConfig + class GroupedTieredPackageConfig @JsonCreator private constructor( @JsonAnySetter @@ -27066,7 +33089,7 @@ constructor( private var validated: Boolean = false - fun validate(): MatrixWithDisplayNameConfig = apply { + fun validate(): GroupedTieredPackageConfig = apply { if (validated) { return@apply } @@ -27081,15 +33104,16 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [GroupedTieredPackageConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(matrixWithDisplayNameConfig: MatrixWithDisplayNameConfig) = + internal fun from(groupedTieredPackageConfig: GroupedTieredPackageConfig) = apply { additionalProperties = - matrixWithDisplayNameConfig.additionalProperties.toMutableMap() + groupedTieredPackageConfig.additionalProperties.toMutableMap() } fun additionalProperties(additionalProperties: Map) = apply { @@ -27114,8 +33138,8 @@ constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): MatrixWithDisplayNameConfig = - MatrixWithDisplayNameConfig(additionalProperties.toImmutable()) + fun build(): GroupedTieredPackageConfig = + GroupedTieredPackageConfig(additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { @@ -27123,7 +33147,7 @@ constructor( return true } - return /* spotless:off */ other is MatrixWithDisplayNameConfig && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is GroupedTieredPackageConfig && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ @@ -27133,7 +33157,7 @@ constructor( override fun hashCode(): Int = hashCode override fun toString() = - "MatrixWithDisplayNameConfig{additionalProperties=$additionalProperties}" + "GroupedTieredPackageConfig{additionalProperties=$additionalProperties}" } class ModelType @@ -27142,33 +33166,71 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { - @JvmField val MATRIX_WITH_DISPLAY_NAME = of("matrix_with_display_name") + @JvmField val GROUPED_TIERED_PACKAGE = of("grouped_tiered_package") @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { - MATRIX_WITH_DISPLAY_NAME, + GROUPED_TIERED_PACKAGE, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { - MATRIX_WITH_DISPLAY_NAME, + GROUPED_TIERED_PACKAGE, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { - MATRIX_WITH_DISPLAY_NAME -> Value.MATRIX_WITH_DISPLAY_NAME + GROUPED_TIERED_PACKAGE -> Value.GROUPED_TIERED_PACKAGE else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { - MATRIX_WITH_DISPLAY_NAME -> Known.MATRIX_WITH_DISPLAY_NAME + GROUPED_TIERED_PACKAGE -> Known.GROUPED_TIERED_PACKAGE else -> throw OrbInvalidDataException("Unknown ModelType: $value") } @@ -27243,7 +33305,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -27310,6 +33373,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -27322,17 +33393,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -27340,6 +33434,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -27437,7 +33540,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -27504,6 +33608,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -27516,17 +33628,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -27534,6 +33669,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -27608,7 +33752,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -27664,33 +33809,33 @@ constructor( return true } - return /* spotless:off */ other is NewPlanMatrixWithDisplayNamePrice && cadence == other.cadence && itemId == other.itemId && matrixWithDisplayNameConfig == other.matrixWithDisplayNameConfig && 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 */ + return /* spotless:off */ other is NewPlanGroupedTieredPackagePrice && cadence == other.cadence && groupedTieredPackageConfig == other.groupedTieredPackageConfig && itemId == other.itemId && 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, matrixWithDisplayNameConfig, modelType, name, billableMetricId, billedInAdvance, billingCycleConfiguration, conversionRate, currency, externalPriceId, fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, metadata, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(cadence, groupedTieredPackageConfig, itemId, modelType, name, billableMetricId, billedInAdvance, billingCycleConfiguration, conversionRate, currency, externalPriceId, fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, metadata, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "NewPlanMatrixWithDisplayNamePrice{cadence=$cadence, itemId=$itemId, matrixWithDisplayNameConfig=$matrixWithDisplayNameConfig, 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}" + "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 NewPlanBulkWithProrationPrice + class NewPlanMaxGroupTieredPackagePrice @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("item_id") @ExcludeMissing private val itemId: JsonField = JsonMissing.of(), + @JsonProperty("max_group_tiered_package_config") + @ExcludeMissing + private val maxGroupTieredPackageConfig: JsonField = + JsonMissing.of(), @JsonProperty("model_type") @ExcludeMissing private val modelType: JsonField = JsonMissing.of(), @@ -27733,15 +33878,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") /** The id of the item the plan will be associated with. */ fun itemId(): String = itemId.getRequired("item_id") + fun maxGroupTieredPackageConfig(): MaxGroupTieredPackageConfig = + maxGroupTieredPackageConfig.getRequired("max_group_tiered_package_config") + fun modelType(): ModelType = modelType.getRequired("model_type") /** The name of the price. */ @@ -27809,17 +33954,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 /** The id of the item the plan will be associated with. */ @JsonProperty("item_id") @ExcludeMissing fun _itemId(): JsonField = itemId + @JsonProperty("max_group_tiered_package_config") + @ExcludeMissing + fun _maxGroupTieredPackageConfig(): JsonField = + maxGroupTieredPackageConfig + @JsonProperty("model_type") @ExcludeMissing fun _modelType(): JsonField = modelType @@ -27902,14 +34047,14 @@ constructor( private var validated: Boolean = false - fun validate(): NewPlanBulkWithProrationPrice = apply { + fun validate(): NewPlanMaxGroupTieredPackagePrice = apply { if (validated) { return@apply } - bulkWithProrationConfig().validate() cadence() itemId() + maxGroupTieredPackageConfig().validate() modelType() name() billableMetricId() @@ -27932,11 +34077,13 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewPlanMaxGroupTieredPackagePrice]. */ + class Builder internal constructor() { - private var bulkWithProrationConfig: JsonField? = null private var cadence: JsonField? = null private var itemId: JsonField? = null + private var maxGroupTieredPackageConfig: JsonField? = + null private var modelType: JsonField? = null private var name: JsonField? = null private var billableMetricId: JsonField = JsonMissing.of() @@ -27954,36 +34101,30 @@ constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(newPlanBulkWithProrationPrice: NewPlanBulkWithProrationPrice) = - apply { - bulkWithProrationConfig = - newPlanBulkWithProrationPrice.bulkWithProrationConfig - cadence = newPlanBulkWithProrationPrice.cadence - itemId = newPlanBulkWithProrationPrice.itemId - modelType = newPlanBulkWithProrationPrice.modelType - name = newPlanBulkWithProrationPrice.name - billableMetricId = newPlanBulkWithProrationPrice.billableMetricId - billedInAdvance = newPlanBulkWithProrationPrice.billedInAdvance - billingCycleConfiguration = - newPlanBulkWithProrationPrice.billingCycleConfiguration - conversionRate = newPlanBulkWithProrationPrice.conversionRate - currency = newPlanBulkWithProrationPrice.currency - externalPriceId = newPlanBulkWithProrationPrice.externalPriceId - fixedPriceQuantity = newPlanBulkWithProrationPrice.fixedPriceQuantity - invoiceGroupingKey = newPlanBulkWithProrationPrice.invoiceGroupingKey - invoicingCycleConfiguration = - newPlanBulkWithProrationPrice.invoicingCycleConfiguration - metadata = newPlanBulkWithProrationPrice.metadata - additionalProperties = - newPlanBulkWithProrationPrice.additionalProperties.toMutableMap() - } - - fun bulkWithProrationConfig(bulkWithProrationConfig: BulkWithProrationConfig) = - bulkWithProrationConfig(JsonField.of(bulkWithProrationConfig)) - - fun bulkWithProrationConfig( - bulkWithProrationConfig: JsonField - ) = apply { this.bulkWithProrationConfig = bulkWithProrationConfig } + internal fun from( + newPlanMaxGroupTieredPackagePrice: NewPlanMaxGroupTieredPackagePrice + ) = apply { + cadence = newPlanMaxGroupTieredPackagePrice.cadence + itemId = newPlanMaxGroupTieredPackagePrice.itemId + maxGroupTieredPackageConfig = + newPlanMaxGroupTieredPackagePrice.maxGroupTieredPackageConfig + modelType = newPlanMaxGroupTieredPackagePrice.modelType + name = newPlanMaxGroupTieredPackagePrice.name + billableMetricId = newPlanMaxGroupTieredPackagePrice.billableMetricId + billedInAdvance = newPlanMaxGroupTieredPackagePrice.billedInAdvance + billingCycleConfiguration = + newPlanMaxGroupTieredPackagePrice.billingCycleConfiguration + conversionRate = newPlanMaxGroupTieredPackagePrice.conversionRate + currency = newPlanMaxGroupTieredPackagePrice.currency + externalPriceId = newPlanMaxGroupTieredPackagePrice.externalPriceId + fixedPriceQuantity = newPlanMaxGroupTieredPackagePrice.fixedPriceQuantity + invoiceGroupingKey = newPlanMaxGroupTieredPackagePrice.invoiceGroupingKey + invoicingCycleConfiguration = + newPlanMaxGroupTieredPackagePrice.invoicingCycleConfiguration + metadata = newPlanMaxGroupTieredPackagePrice.metadata + additionalProperties = + newPlanMaxGroupTieredPackagePrice.additionalProperties.toMutableMap() + } /** The cadence to bill for this price on. */ fun cadence(cadence: Cadence) = cadence(JsonField.of(cadence)) @@ -27997,6 +34138,14 @@ constructor( /** The id of the item the plan will be associated with. */ fun itemId(itemId: JsonField) = apply { this.itemId = itemId } + fun maxGroupTieredPackageConfig( + maxGroupTieredPackageConfig: MaxGroupTieredPackageConfig + ) = maxGroupTieredPackageConfig(JsonField.of(maxGroupTieredPackageConfig)) + + fun maxGroupTieredPackageConfig( + maxGroupTieredPackageConfig: JsonField + ) = apply { this.maxGroupTieredPackageConfig = maxGroupTieredPackageConfig } + fun modelType(modelType: ModelType) = modelType(JsonField.of(modelType)) fun modelType(modelType: JsonField) = apply { @@ -28244,11 +34393,11 @@ constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): NewPlanBulkWithProrationPrice = - NewPlanBulkWithProrationPrice( - checkRequired("bulkWithProrationConfig", bulkWithProrationConfig), + fun build(): NewPlanMaxGroupTieredPackagePrice = + NewPlanMaxGroupTieredPackagePrice( checkRequired("cadence", cadence), checkRequired("itemId", itemId), + checkRequired("maxGroupTieredPackageConfig", maxGroupTieredPackageConfig), checkRequired("modelType", modelType), checkRequired("name", name), billableMetricId, @@ -28265,89 +34414,6 @@ 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 @@ -28355,6 +34421,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -28374,6 +34448,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -28383,6 +34458,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -28390,9 +34474,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -28404,6 +34499,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -28430,39 +34534,162 @@ constructor( override fun toString() = value.toString() } + @NoAutoDetect + class MaxGroupTieredPackageConfig + @JsonCreator + private constructor( + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): MaxGroupTieredPackageConfig = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + /** A builder for [MaxGroupTieredPackageConfig]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(maxGroupTieredPackageConfig: MaxGroupTieredPackageConfig) = + apply { + additionalProperties = + maxGroupTieredPackageConfig.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(): MaxGroupTieredPackageConfig = + MaxGroupTieredPackageConfig(additionalProperties.toImmutable()) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is MaxGroupTieredPackageConfig && 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() = + "MaxGroupTieredPackageConfig{additionalProperties=$additionalProperties}" + } + class ModelType @JsonCreator private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { - @JvmField val BULK_WITH_PRORATION = of("bulk_with_proration") + @JvmField val MAX_GROUP_TIERED_PACKAGE = of("max_group_tiered_package") @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { - BULK_WITH_PRORATION, + MAX_GROUP_TIERED_PACKAGE, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { - BULK_WITH_PRORATION, + MAX_GROUP_TIERED_PACKAGE, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { - BULK_WITH_PRORATION -> Value.BULK_WITH_PRORATION + MAX_GROUP_TIERED_PACKAGE -> Value.MAX_GROUP_TIERED_PACKAGE else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { - BULK_WITH_PRORATION -> Known.BULK_WITH_PRORATION + MAX_GROUP_TIERED_PACKAGE -> Known.MAX_GROUP_TIERED_PACKAGE else -> throw OrbInvalidDataException("Unknown ModelType: $value") } @@ -28537,7 +34764,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -28604,6 +34832,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -28616,17 +34852,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -28634,6 +34893,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -28731,7 +34999,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -28798,6 +35067,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -28810,17 +35087,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -28828,6 +35128,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -28902,7 +35211,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -28958,30 +35268,26 @@ constructor( return true } - return /* spotless:off */ other is NewPlanBulkWithProrationPrice && bulkWithProrationConfig == other.bulkWithProrationConfig && cadence == other.cadence && itemId == other.itemId && 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 */ + return /* spotless:off */ other is NewPlanMaxGroupTieredPackagePrice && cadence == other.cadence && itemId == other.itemId && maxGroupTieredPackageConfig == other.maxGroupTieredPackageConfig && 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(bulkWithProrationConfig, cadence, itemId, modelType, name, billableMetricId, billedInAdvance, billingCycleConfiguration, conversionRate, currency, externalPriceId, fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, metadata, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(cadence, itemId, maxGroupTieredPackageConfig, modelType, name, billableMetricId, billedInAdvance, billingCycleConfiguration, conversionRate, currency, externalPriceId, fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, metadata, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "NewPlanBulkWithProrationPrice{bulkWithProrationConfig=$bulkWithProrationConfig, cadence=$cadence, 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}" + "NewPlanMaxGroupTieredPackagePrice{cadence=$cadence, itemId=$itemId, maxGroupTieredPackageConfig=$maxGroupTieredPackageConfig, 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 NewPlanGroupedTieredPackagePrice + class NewPlanScalableMatrixWithUnitPricingPrice @JsonCreator private constructor( @JsonProperty("cadence") @ExcludeMissing private val cadence: 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(), @@ -28991,6 +35297,11 @@ constructor( @JsonProperty("name") @ExcludeMissing private val name: JsonField = JsonMissing.of(), + @JsonProperty("scalable_matrix_with_unit_pricing_config") + @ExcludeMissing + private val scalableMatrixWithUnitPricingConfig: + JsonField = + JsonMissing.of(), @JsonProperty("billable_metric_id") @ExcludeMissing private val billableMetricId: JsonField = JsonMissing.of(), @@ -29030,9 +35341,6 @@ constructor( /** The cadence to bill for this price on. */ fun cadence(): Cadence = cadence.getRequired("cadence") - 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") @@ -29041,6 +35349,11 @@ constructor( /** The name of the price. */ fun name(): String = name.getRequired("name") + fun scalableMatrixWithUnitPricingConfig(): ScalableMatrixWithUnitPricingConfig = + scalableMatrixWithUnitPricingConfig.getRequired( + "scalable_matrix_with_unit_pricing_config" + ) + /** * The id of the billable metric for the price. Only needed if the price is usage-based. */ @@ -29106,11 +35419,6 @@ constructor( /** The cadence to bill for this price on. */ @JsonProperty("cadence") @ExcludeMissing fun _cadence(): JsonField = cadence - @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 @@ -29121,6 +35429,11 @@ constructor( /** The name of the price. */ @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + @JsonProperty("scalable_matrix_with_unit_pricing_config") + @ExcludeMissing + fun _scalableMatrixWithUnitPricingConfig(): + JsonField = scalableMatrixWithUnitPricingConfig + /** * The id of the billable metric for the price. Only needed if the price is usage-based. */ @@ -29196,16 +35509,16 @@ constructor( private var validated: Boolean = false - fun validate(): NewPlanGroupedTieredPackagePrice = apply { + fun validate(): NewPlanScalableMatrixWithUnitPricingPrice = apply { if (validated) { return@apply } cadence() - groupedTieredPackageConfig().validate() itemId() modelType() name() + scalableMatrixWithUnitPricingConfig().validate() billableMetricId() billedInAdvance() billingCycleConfiguration().ifPresent { it.validate() } @@ -29226,14 +35539,16 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewPlanScalableMatrixWithUnitPricingPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null - private var groupedTieredPackageConfig: JsonField? = - null private var itemId: JsonField? = null private var modelType: JsonField? = null private var name: JsonField? = null + private var scalableMatrixWithUnitPricingConfig: + JsonField? = + null private var billableMetricId: JsonField = JsonMissing.of() private var billedInAdvance: JsonField = JsonMissing.of() private var billingCycleConfiguration: JsonField = @@ -29250,28 +35565,33 @@ constructor( @JvmSynthetic internal fun from( - newPlanGroupedTieredPackagePrice: NewPlanGroupedTieredPackagePrice + newPlanScalableMatrixWithUnitPricingPrice: + NewPlanScalableMatrixWithUnitPricingPrice ) = apply { - cadence = newPlanGroupedTieredPackagePrice.cadence - groupedTieredPackageConfig = - newPlanGroupedTieredPackagePrice.groupedTieredPackageConfig - itemId = newPlanGroupedTieredPackagePrice.itemId - modelType = newPlanGroupedTieredPackagePrice.modelType - name = newPlanGroupedTieredPackagePrice.name - billableMetricId = newPlanGroupedTieredPackagePrice.billableMetricId - billedInAdvance = newPlanGroupedTieredPackagePrice.billedInAdvance + cadence = newPlanScalableMatrixWithUnitPricingPrice.cadence + itemId = newPlanScalableMatrixWithUnitPricingPrice.itemId + modelType = newPlanScalableMatrixWithUnitPricingPrice.modelType + name = newPlanScalableMatrixWithUnitPricingPrice.name + scalableMatrixWithUnitPricingConfig = + newPlanScalableMatrixWithUnitPricingPrice + .scalableMatrixWithUnitPricingConfig + billableMetricId = newPlanScalableMatrixWithUnitPricingPrice.billableMetricId + billedInAdvance = newPlanScalableMatrixWithUnitPricingPrice.billedInAdvance billingCycleConfiguration = - newPlanGroupedTieredPackagePrice.billingCycleConfiguration - conversionRate = newPlanGroupedTieredPackagePrice.conversionRate - currency = newPlanGroupedTieredPackagePrice.currency - externalPriceId = newPlanGroupedTieredPackagePrice.externalPriceId - fixedPriceQuantity = newPlanGroupedTieredPackagePrice.fixedPriceQuantity - invoiceGroupingKey = newPlanGroupedTieredPackagePrice.invoiceGroupingKey + newPlanScalableMatrixWithUnitPricingPrice.billingCycleConfiguration + conversionRate = newPlanScalableMatrixWithUnitPricingPrice.conversionRate + currency = newPlanScalableMatrixWithUnitPricingPrice.currency + externalPriceId = newPlanScalableMatrixWithUnitPricingPrice.externalPriceId + fixedPriceQuantity = + newPlanScalableMatrixWithUnitPricingPrice.fixedPriceQuantity + invoiceGroupingKey = + newPlanScalableMatrixWithUnitPricingPrice.invoiceGroupingKey invoicingCycleConfiguration = - newPlanGroupedTieredPackagePrice.invoicingCycleConfiguration - metadata = newPlanGroupedTieredPackagePrice.metadata + newPlanScalableMatrixWithUnitPricingPrice.invoicingCycleConfiguration + metadata = newPlanScalableMatrixWithUnitPricingPrice.metadata additionalProperties = - newPlanGroupedTieredPackagePrice.additionalProperties.toMutableMap() + newPlanScalableMatrixWithUnitPricingPrice.additionalProperties + .toMutableMap() } /** The cadence to bill for this price on. */ @@ -29280,14 +35600,6 @@ constructor( /** The cadence to bill for this price on. */ fun cadence(cadence: JsonField) = apply { this.cadence = cadence } - 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)) @@ -29306,6 +35618,20 @@ constructor( /** The name of the price. */ fun name(name: JsonField) = apply { this.name = name } + fun scalableMatrixWithUnitPricingConfig( + scalableMatrixWithUnitPricingConfig: ScalableMatrixWithUnitPricingConfig + ) = + scalableMatrixWithUnitPricingConfig( + JsonField.of(scalableMatrixWithUnitPricingConfig) + ) + + fun scalableMatrixWithUnitPricingConfig( + scalableMatrixWithUnitPricingConfig: + JsonField + ) = apply { + this.scalableMatrixWithUnitPricingConfig = scalableMatrixWithUnitPricingConfig + } + /** * The id of the billable metric for the price. Only needed if the price is * usage-based. @@ -29541,13 +35867,16 @@ constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): NewPlanGroupedTieredPackagePrice = - NewPlanGroupedTieredPackagePrice( + fun build(): NewPlanScalableMatrixWithUnitPricingPrice = + NewPlanScalableMatrixWithUnitPricingPrice( checkRequired("cadence", cadence), - checkRequired("groupedTieredPackageConfig", groupedTieredPackageConfig), checkRequired("itemId", itemId), checkRequired("modelType", modelType), checkRequired("name", name), + checkRequired( + "scalableMatrixWithUnitPricingConfig", + scalableMatrixWithUnitPricingConfig + ), billableMetricId, billedInAdvance, billingCycleConfiguration, @@ -29569,6 +35898,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -29588,6 +35925,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -29597,6 +35935,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -29604,9 +35951,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -29618,6 +35976,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -29644,8 +36011,98 @@ constructor( override fun toString() = value.toString() } + class ModelType + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField + val SCALABLE_MATRIX_WITH_UNIT_PRICING = of("scalable_matrix_with_unit_pricing") + + @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) + } + + /** An enum containing [ModelType]'s known values. */ + enum class Known { + SCALABLE_MATRIX_WITH_UNIT_PRICING, + } + + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + SCALABLE_MATRIX_WITH_UNIT_PRICING, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + SCALABLE_MATRIX_WITH_UNIT_PRICING -> Value.SCALABLE_MATRIX_WITH_UNIT_PRICING + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + SCALABLE_MATRIX_WITH_UNIT_PRICING -> Known.SCALABLE_MATRIX_WITH_UNIT_PRICING + 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 GroupedTieredPackageConfig + class ScalableMatrixWithUnitPricingConfig @JsonCreator private constructor( @JsonAnySetter @@ -29658,7 +36115,7 @@ constructor( private var validated: Boolean = false - fun validate(): GroupedTieredPackageConfig = apply { + fun validate(): ScalableMatrixWithUnitPricingConfig = apply { if (validated) { return@apply } @@ -29673,16 +36130,18 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [ScalableMatrixWithUnitPricingConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(groupedTieredPackageConfig: GroupedTieredPackageConfig) = - apply { - additionalProperties = - groupedTieredPackageConfig.additionalProperties.toMutableMap() - } + internal fun from( + scalableMatrixWithUnitPricingConfig: ScalableMatrixWithUnitPricingConfig + ) = apply { + additionalProperties = + scalableMatrixWithUnitPricingConfig.additionalProperties.toMutableMap() + } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -29706,8 +36165,8 @@ constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): GroupedTieredPackageConfig = - GroupedTieredPackageConfig(additionalProperties.toImmutable()) + fun build(): ScalableMatrixWithUnitPricingConfig = + ScalableMatrixWithUnitPricingConfig(additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { @@ -29715,7 +36174,7 @@ constructor( return true } - return /* spotless:off */ other is GroupedTieredPackageConfig && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is ScalableMatrixWithUnitPricingConfig && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ @@ -29725,58 +36184,7 @@ constructor( 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() + "ScalableMatrixWithUnitPricingConfig{additionalProperties=$additionalProperties}" } /** @@ -29835,7 +36243,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -29902,6 +36311,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -29914,17 +36331,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -29932,6 +36372,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -30029,7 +36478,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -30096,6 +36546,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -30108,17 +36566,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -30126,6 +36607,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -30200,7 +36690,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -30256,21 +36747,21 @@ constructor( return true } - return /* spotless:off */ other is NewPlanGroupedTieredPackagePrice && cadence == other.cadence && groupedTieredPackageConfig == other.groupedTieredPackageConfig && itemId == other.itemId && 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 */ + return /* spotless:off */ other is NewPlanScalableMatrixWithUnitPricingPrice && cadence == other.cadence && itemId == other.itemId && modelType == other.modelType && name == other.name && scalableMatrixWithUnitPricingConfig == other.scalableMatrixWithUnitPricingConfig && 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, groupedTieredPackageConfig, itemId, modelType, name, billableMetricId, billedInAdvance, billingCycleConfiguration, conversionRate, currency, externalPriceId, fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, metadata, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(cadence, itemId, modelType, name, scalableMatrixWithUnitPricingConfig, billableMetricId, billedInAdvance, billingCycleConfiguration, conversionRate, currency, externalPriceId, fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, metadata, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode 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}" + "NewPlanScalableMatrixWithUnitPricingPrice{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, scalableMatrixWithUnitPricingConfig=$scalableMatrixWithUnitPricingConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, currency=$currency, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" } @NoAutoDetect - class NewPlanMaxGroupTieredPackagePrice + class NewPlanScalableMatrixWithTieredPricingPrice @JsonCreator private constructor( @JsonProperty("cadence") @@ -30279,16 +36770,17 @@ constructor( @JsonProperty("item_id") @ExcludeMissing private val itemId: JsonField = JsonMissing.of(), - @JsonProperty("max_group_tiered_package_config") - @ExcludeMissing - private val maxGroupTieredPackageConfig: JsonField = - JsonMissing.of(), @JsonProperty("model_type") @ExcludeMissing private val modelType: JsonField = JsonMissing.of(), @JsonProperty("name") @ExcludeMissing private val name: JsonField = JsonMissing.of(), + @JsonProperty("scalable_matrix_with_tiered_pricing_config") + @ExcludeMissing + private val scalableMatrixWithTieredPricingConfig: + JsonField = + JsonMissing.of(), @JsonProperty("billable_metric_id") @ExcludeMissing private val billableMetricId: JsonField = JsonMissing.of(), @@ -30331,14 +36823,16 @@ constructor( /** The id of the item the plan will be associated with. */ fun itemId(): String = itemId.getRequired("item_id") - fun maxGroupTieredPackageConfig(): MaxGroupTieredPackageConfig = - maxGroupTieredPackageConfig.getRequired("max_group_tiered_package_config") - fun modelType(): ModelType = modelType.getRequired("model_type") /** The name of the price. */ fun name(): String = name.getRequired("name") + fun scalableMatrixWithTieredPricingConfig(): ScalableMatrixWithTieredPricingConfig = + scalableMatrixWithTieredPricingConfig.getRequired( + "scalable_matrix_with_tiered_pricing_config" + ) + /** * The id of the billable metric for the price. Only needed if the price is usage-based. */ @@ -30407,11 +36901,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_package_config") - @ExcludeMissing - fun _maxGroupTieredPackageConfig(): JsonField = - maxGroupTieredPackageConfig - @JsonProperty("model_type") @ExcludeMissing fun _modelType(): JsonField = modelType @@ -30419,6 +36908,12 @@ constructor( /** The name of the price. */ @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + @JsonProperty("scalable_matrix_with_tiered_pricing_config") + @ExcludeMissing + fun _scalableMatrixWithTieredPricingConfig(): + JsonField = + scalableMatrixWithTieredPricingConfig + /** * The id of the billable metric for the price. Only needed if the price is usage-based. */ @@ -30494,16 +36989,16 @@ constructor( private var validated: Boolean = false - fun validate(): NewPlanMaxGroupTieredPackagePrice = apply { + fun validate(): NewPlanScalableMatrixWithTieredPricingPrice = apply { if (validated) { return@apply } cadence() itemId() - maxGroupTieredPackageConfig().validate() modelType() name() + scalableMatrixWithTieredPricingConfig().validate() billableMetricId() billedInAdvance() billingCycleConfiguration().ifPresent { it.validate() } @@ -30524,14 +37019,16 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewPlanScalableMatrixWithTieredPricingPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var itemId: JsonField? = null - private var maxGroupTieredPackageConfig: JsonField? = - null private var modelType: JsonField? = null private var name: JsonField? = null + private var scalableMatrixWithTieredPricingConfig: + JsonField? = + null private var billableMetricId: JsonField = JsonMissing.of() private var billedInAdvance: JsonField = JsonMissing.of() private var billingCycleConfiguration: JsonField = @@ -30548,28 +37045,33 @@ constructor( @JvmSynthetic internal fun from( - newPlanMaxGroupTieredPackagePrice: NewPlanMaxGroupTieredPackagePrice + newPlanScalableMatrixWithTieredPricingPrice: + NewPlanScalableMatrixWithTieredPricingPrice ) = apply { - cadence = newPlanMaxGroupTieredPackagePrice.cadence - itemId = newPlanMaxGroupTieredPackagePrice.itemId - maxGroupTieredPackageConfig = - newPlanMaxGroupTieredPackagePrice.maxGroupTieredPackageConfig - modelType = newPlanMaxGroupTieredPackagePrice.modelType - name = newPlanMaxGroupTieredPackagePrice.name - billableMetricId = newPlanMaxGroupTieredPackagePrice.billableMetricId - billedInAdvance = newPlanMaxGroupTieredPackagePrice.billedInAdvance + cadence = newPlanScalableMatrixWithTieredPricingPrice.cadence + itemId = newPlanScalableMatrixWithTieredPricingPrice.itemId + modelType = newPlanScalableMatrixWithTieredPricingPrice.modelType + name = newPlanScalableMatrixWithTieredPricingPrice.name + scalableMatrixWithTieredPricingConfig = + newPlanScalableMatrixWithTieredPricingPrice + .scalableMatrixWithTieredPricingConfig + billableMetricId = newPlanScalableMatrixWithTieredPricingPrice.billableMetricId + billedInAdvance = newPlanScalableMatrixWithTieredPricingPrice.billedInAdvance billingCycleConfiguration = - newPlanMaxGroupTieredPackagePrice.billingCycleConfiguration - conversionRate = newPlanMaxGroupTieredPackagePrice.conversionRate - currency = newPlanMaxGroupTieredPackagePrice.currency - externalPriceId = newPlanMaxGroupTieredPackagePrice.externalPriceId - fixedPriceQuantity = newPlanMaxGroupTieredPackagePrice.fixedPriceQuantity - invoiceGroupingKey = newPlanMaxGroupTieredPackagePrice.invoiceGroupingKey + newPlanScalableMatrixWithTieredPricingPrice.billingCycleConfiguration + conversionRate = newPlanScalableMatrixWithTieredPricingPrice.conversionRate + currency = newPlanScalableMatrixWithTieredPricingPrice.currency + externalPriceId = newPlanScalableMatrixWithTieredPricingPrice.externalPriceId + fixedPriceQuantity = + newPlanScalableMatrixWithTieredPricingPrice.fixedPriceQuantity + invoiceGroupingKey = + newPlanScalableMatrixWithTieredPricingPrice.invoiceGroupingKey invoicingCycleConfiguration = - newPlanMaxGroupTieredPackagePrice.invoicingCycleConfiguration - metadata = newPlanMaxGroupTieredPackagePrice.metadata + newPlanScalableMatrixWithTieredPricingPrice.invoicingCycleConfiguration + metadata = newPlanScalableMatrixWithTieredPricingPrice.metadata additionalProperties = - newPlanMaxGroupTieredPackagePrice.additionalProperties.toMutableMap() + newPlanScalableMatrixWithTieredPricingPrice.additionalProperties + .toMutableMap() } /** The cadence to bill for this price on. */ @@ -30584,14 +37086,6 @@ constructor( /** The id of the item the plan will be associated with. */ fun itemId(itemId: JsonField) = apply { this.itemId = itemId } - fun maxGroupTieredPackageConfig( - maxGroupTieredPackageConfig: MaxGroupTieredPackageConfig - ) = maxGroupTieredPackageConfig(JsonField.of(maxGroupTieredPackageConfig)) - - fun maxGroupTieredPackageConfig( - maxGroupTieredPackageConfig: JsonField - ) = apply { this.maxGroupTieredPackageConfig = maxGroupTieredPackageConfig } - fun modelType(modelType: ModelType) = modelType(JsonField.of(modelType)) fun modelType(modelType: JsonField) = apply { @@ -30604,6 +37098,21 @@ constructor( /** The name of the price. */ fun name(name: JsonField) = apply { this.name = name } + fun scalableMatrixWithTieredPricingConfig( + scalableMatrixWithTieredPricingConfig: ScalableMatrixWithTieredPricingConfig + ) = + scalableMatrixWithTieredPricingConfig( + JsonField.of(scalableMatrixWithTieredPricingConfig) + ) + + fun scalableMatrixWithTieredPricingConfig( + scalableMatrixWithTieredPricingConfig: + JsonField + ) = apply { + this.scalableMatrixWithTieredPricingConfig = + scalableMatrixWithTieredPricingConfig + } + /** * The id of the billable metric for the price. Only needed if the price is * usage-based. @@ -30839,13 +37348,16 @@ constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): NewPlanMaxGroupTieredPackagePrice = - NewPlanMaxGroupTieredPackagePrice( + fun build(): NewPlanScalableMatrixWithTieredPricingPrice = + NewPlanScalableMatrixWithTieredPricingPrice( checkRequired("cadence", cadence), checkRequired("itemId", itemId), - checkRequired("maxGroupTieredPackageConfig", maxGroupTieredPackageConfig), checkRequired("modelType", modelType), checkRequired("name", name), + checkRequired( + "scalableMatrixWithTieredPricingConfig", + scalableMatrixWithTieredPricingConfig + ), billableMetricId, billedInAdvance, billingCycleConfiguration, @@ -30867,6 +37379,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -30886,6 +37406,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -30895,6 +37416,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -30902,9 +37432,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -30916,6 +37457,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -30942,8 +37492,101 @@ constructor( override fun toString() = value.toString() } + class ModelType + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField + val SCALABLE_MATRIX_WITH_TIERED_PRICING = + of("scalable_matrix_with_tiered_pricing") + + @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) + } + + /** An enum containing [ModelType]'s known values. */ + enum class Known { + SCALABLE_MATRIX_WITH_TIERED_PRICING, + } + + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + SCALABLE_MATRIX_WITH_TIERED_PRICING, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + SCALABLE_MATRIX_WITH_TIERED_PRICING -> + Value.SCALABLE_MATRIX_WITH_TIERED_PRICING + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + SCALABLE_MATRIX_WITH_TIERED_PRICING -> + Known.SCALABLE_MATRIX_WITH_TIERED_PRICING + 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 MaxGroupTieredPackageConfig + class ScalableMatrixWithTieredPricingConfig @JsonCreator private constructor( @JsonAnySetter @@ -30956,7 +37599,7 @@ constructor( private var validated: Boolean = false - fun validate(): MaxGroupTieredPackageConfig = apply { + fun validate(): ScalableMatrixWithTieredPricingConfig = apply { if (validated) { return@apply } @@ -30971,16 +37614,19 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [ScalableMatrixWithTieredPricingConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(maxGroupTieredPackageConfig: MaxGroupTieredPackageConfig) = - apply { - additionalProperties = - maxGroupTieredPackageConfig.additionalProperties.toMutableMap() - } + internal fun from( + scalableMatrixWithTieredPricingConfig: ScalableMatrixWithTieredPricingConfig + ) = apply { + additionalProperties = + scalableMatrixWithTieredPricingConfig.additionalProperties + .toMutableMap() + } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -31004,8 +37650,8 @@ constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): MaxGroupTieredPackageConfig = - MaxGroupTieredPackageConfig(additionalProperties.toImmutable()) + fun build(): ScalableMatrixWithTieredPricingConfig = + ScalableMatrixWithTieredPricingConfig(additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { @@ -31013,7 +37659,7 @@ constructor( return true } - return /* spotless:off */ other is MaxGroupTieredPackageConfig && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is ScalableMatrixWithTieredPricingConfig && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ @@ -31023,58 +37669,7 @@ constructor( override fun hashCode(): Int = hashCode override fun toString() = - "MaxGroupTieredPackageConfig{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_PACKAGE = of("max_group_tiered_package") - - @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) - } - - enum class Known { - MAX_GROUP_TIERED_PACKAGE, - } - - enum class Value { - MAX_GROUP_TIERED_PACKAGE, - _UNKNOWN, - } - - fun value(): Value = - when (this) { - MAX_GROUP_TIERED_PACKAGE -> Value.MAX_GROUP_TIERED_PACKAGE - else -> Value._UNKNOWN - } - - fun known(): Known = - when (this) { - MAX_GROUP_TIERED_PACKAGE -> Known.MAX_GROUP_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() + "ScalableMatrixWithTieredPricingConfig{additionalProperties=$additionalProperties}" } /** @@ -31133,7 +37728,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -31200,6 +37796,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -31212,17 +37816,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -31230,6 +37857,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -31327,7 +37963,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -31394,6 +38031,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -31406,17 +38051,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -31424,6 +38092,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -31498,7 +38175,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -31554,17 +38232,17 @@ constructor( return true } - return /* spotless:off */ other is NewPlanMaxGroupTieredPackagePrice && cadence == other.cadence && itemId == other.itemId && maxGroupTieredPackageConfig == other.maxGroupTieredPackageConfig && 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 */ + return /* spotless:off */ other is NewPlanScalableMatrixWithTieredPricingPrice && cadence == other.cadence && itemId == other.itemId && modelType == other.modelType && name == other.name && scalableMatrixWithTieredPricingConfig == other.scalableMatrixWithTieredPricingConfig && 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, maxGroupTieredPackageConfig, modelType, name, billableMetricId, billedInAdvance, billingCycleConfiguration, conversionRate, currency, externalPriceId, fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, metadata, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(cadence, itemId, modelType, name, scalableMatrixWithTieredPricingConfig, billableMetricId, billedInAdvance, billingCycleConfiguration, conversionRate, currency, externalPriceId, fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, metadata, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "NewPlanMaxGroupTieredPackagePrice{cadence=$cadence, itemId=$itemId, maxGroupTieredPackageConfig=$maxGroupTieredPackageConfig, 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}" + "NewPlanScalableMatrixWithTieredPricingPrice{cadence=$cadence, itemId=$itemId, modelType=$modelType, name=$name, scalableMatrixWithTieredPricingConfig=$scalableMatrixWithTieredPricingConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, currency=$currency, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" } } @@ -31602,7 +38280,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -31660,6 +38339,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -31671,17 +38358,35 @@ constructor( @JvmStatic fun of(value: String) = Status(JsonField.of(value)) } + /** An enum containing [Status]'s known values. */ enum class Known { ACTIVE, DRAFT, } + /** + * An enum containing [Status]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Status] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ACTIVE, DRAFT, + /** An enum member indicating that [Status] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { ACTIVE -> Value.ACTIVE @@ -31689,6 +38394,14 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { ACTIVE -> Known.ACTIVE 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 998fc69d..f78a7baf 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 @@ -3,6 +3,7 @@ package com.withorb.api.models import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -25,11 +26,11 @@ import java.util.Objects * types can be found in the [Price schema](/core-concepts#plan-and-price). " */ class PlanExternalPlanIdFetchParams -constructor( +private constructor( private val externalPlanId: String, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun externalPlanId(): String = externalPlanId @@ -37,9 +38,9 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun getPathParam(index: Int): String { return when (index) { @@ -55,8 +56,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [PlanExternalPlanIdFetchParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var externalPlanId: String? = null private var additionalHeaders: Headers.Builder = Headers.builder() diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/PlanExternalPlanIdUpdateParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/PlanExternalPlanIdUpdateParams.kt index dea8211c..d570e8e0 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/PlanExternalPlanIdUpdateParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/PlanExternalPlanIdUpdateParams.kt @@ -11,6 +11,7 @@ import com.withorb.api.core.JsonField import com.withorb.api.core.JsonMissing import com.withorb.api.core.JsonValue import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -25,12 +26,12 @@ import java.util.Optional * Other fields on a customer are currently immutable. */ class PlanExternalPlanIdUpdateParams -constructor( +private constructor( private val otherExternalPlanId: String, private val body: PlanExternalPlanIdUpdateBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun otherExternalPlanId(): String = otherExternalPlanId @@ -66,11 +67,11 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getBody(): PlanExternalPlanIdUpdateBody = body + @JvmSynthetic internal fun _body(): PlanExternalPlanIdUpdateBody = body - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun getPathParam(index: Int): String { return when (index) { @@ -147,7 +148,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [PlanExternalPlanIdUpdateBody]. */ + class Builder internal constructor() { private var externalPlanId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() @@ -259,8 +261,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [PlanExternalPlanIdUpdateParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var otherExternalPlanId: String? = null private var body: PlanExternalPlanIdUpdateBody.Builder = @@ -485,7 +488,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() 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 6a7efb9a..e4699c4e 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 @@ -3,6 +3,7 @@ package com.withorb.api.models import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -26,11 +27,11 @@ import java.util.Objects * prices refer to all prices across all phases. */ class PlanFetchParams -constructor( +private constructor( private val planId: String, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun planId(): String = planId @@ -38,9 +39,9 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun getPathParam(index: Int): String { return when (index) { @@ -56,8 +57,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [PlanFetchParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var planId: String? = null private var additionalHeaders: Headers.Builder = Headers.builder() 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 16dc93f6..3729a838 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 @@ -185,8 +185,7 @@ private constructor( } } - class AutoPager - constructor( + class AutoPager( private val firstPage: PlanListPage, ) : Iterable { 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 978b5a14..0bbcddc9 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 @@ -188,8 +188,7 @@ private constructor( } } - class AutoPager - constructor( + class AutoPager( private val firstPage: PlanListPageAsync, ) { 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 89887f8e..cbfd5902 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 @@ -6,6 +6,7 @@ import com.fasterxml.jackson.annotation.JsonCreator import com.withorb.api.core.Enum import com.withorb.api.core.JsonField import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams import com.withorb.api.errors.OrbInvalidDataException @@ -21,7 +22,7 @@ import java.util.Optional * retrieve the next page of results if they exist. */ class PlanListParams -constructor( +private constructor( private val createdAtGt: OffsetDateTime?, private val createdAtGte: OffsetDateTime?, private val createdAtLt: OffsetDateTime?, @@ -31,7 +32,7 @@ constructor( private val status: Status?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun createdAtGt(): Optional = Optional.ofNullable(createdAtGt) @@ -57,10 +58,9 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic - internal fun getQueryParams(): QueryParams { + override fun _queryParams(): QueryParams { val queryParams = QueryParams.builder() this.createdAtGt?.let { queryParams.put( @@ -100,8 +100,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [PlanListParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var createdAtGt: OffsetDateTime? = null private var createdAtGte: OffsetDateTime? = null @@ -293,6 +294,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -306,19 +315,37 @@ constructor( @JvmStatic fun of(value: String) = Status(JsonField.of(value)) } + /** An enum containing [Status]'s known values. */ enum class Known { ACTIVE, ARCHIVED, DRAFT, } + /** + * An enum containing [Status]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Status] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ACTIVE, ARCHIVED, DRAFT, + /** An enum member indicating that [Status] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { ACTIVE -> Value.ACTIVE @@ -327,6 +354,14 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { ACTIVE -> Known.ACTIVE diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/PlanUpdateParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/PlanUpdateParams.kt index c003e545..e3812e14 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/PlanUpdateParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/PlanUpdateParams.kt @@ -11,6 +11,7 @@ import com.withorb.api.core.JsonField import com.withorb.api.core.JsonMissing import com.withorb.api.core.JsonValue import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -25,12 +26,12 @@ import java.util.Optional * Other fields on a customer are currently immutable. */ class PlanUpdateParams -constructor( +private constructor( private val planId: String, private val body: PlanUpdateBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun planId(): String = planId @@ -66,11 +67,11 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getBody(): PlanUpdateBody = body + @JvmSynthetic internal fun _body(): PlanUpdateBody = body - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun getPathParam(index: Int): String { return when (index) { @@ -147,7 +148,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [PlanUpdateBody]. */ + class Builder internal constructor() { private var externalPlanId: JsonField = JsonMissing.of() private var metadata: JsonField = JsonMissing.of() @@ -258,8 +260,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [PlanUpdateParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var planId: String? = null private var body: PlanUpdateBody.Builder = PlanUpdateBody.builder() @@ -481,7 +484,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() 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 246f4808..cacdec81 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 @@ -72,6 +72,8 @@ private constructor( private val bulkWithProration: BulkWithProrationPrice? = null, private val groupedTieredPackage: GroupedTieredPackagePrice? = null, private val maxGroupTieredPackage: MaxGroupTieredPackagePrice? = null, + private val scalableMatrixWithUnitPricing: ScalableMatrixWithUnitPricingPrice? = null, + private val scalableMatrixWithTieredPricing: ScalableMatrixWithTieredPricingPrice? = null, private val _json: JsonValue? = null, ) { @@ -139,6 +141,12 @@ private constructor( fun maxGroupTieredPackage(): Optional = Optional.ofNullable(maxGroupTieredPackage) + fun scalableMatrixWithUnitPricing(): Optional = + Optional.ofNullable(scalableMatrixWithUnitPricing) + + fun scalableMatrixWithTieredPricing(): Optional = + Optional.ofNullable(scalableMatrixWithTieredPricing) + fun isUnit(): Boolean = unit != null fun isPackagePrice(): Boolean = packagePrice != null @@ -189,6 +197,10 @@ private constructor( fun isMaxGroupTieredPackage(): Boolean = maxGroupTieredPackage != null + fun isScalableMatrixWithUnitPricing(): Boolean = scalableMatrixWithUnitPricing != null + + fun isScalableMatrixWithTieredPricing(): Boolean = scalableMatrixWithTieredPricing != null + fun asUnit(): UnitPrice = unit.getOrThrow("unit") fun asPackagePrice(): PackagePrice = packagePrice.getOrThrow("packagePrice") @@ -253,6 +265,12 @@ private constructor( fun asMaxGroupTieredPackage(): MaxGroupTieredPackagePrice = maxGroupTieredPackage.getOrThrow("maxGroupTieredPackage") + fun asScalableMatrixWithUnitPricing(): ScalableMatrixWithUnitPricingPrice = + scalableMatrixWithUnitPricing.getOrThrow("scalableMatrixWithUnitPricing") + + fun asScalableMatrixWithTieredPricing(): ScalableMatrixWithTieredPricingPrice = + scalableMatrixWithTieredPricing.getOrThrow("scalableMatrixWithTieredPricing") + fun _json(): Optional = Optional.ofNullable(_json) fun accept(visitor: Visitor): T { @@ -288,6 +306,10 @@ private constructor( groupedTieredPackage != null -> visitor.visitGroupedTieredPackage(groupedTieredPackage) maxGroupTieredPackage != null -> visitor.visitMaxGroupTieredPackage(maxGroupTieredPackage) + scalableMatrixWithUnitPricing != null -> + visitor.visitScalableMatrixWithUnitPricing(scalableMatrixWithUnitPricing) + scalableMatrixWithTieredPricing != null -> + visitor.visitScalableMatrixWithTieredPricing(scalableMatrixWithTieredPricing) else -> visitor.unknown(_json) } } @@ -420,6 +442,18 @@ private constructor( ) { maxGroupTieredPackage.validate() } + + override fun visitScalableMatrixWithUnitPricing( + scalableMatrixWithUnitPricing: ScalableMatrixWithUnitPricingPrice + ) { + scalableMatrixWithUnitPricing.validate() + } + + override fun visitScalableMatrixWithTieredPricing( + scalableMatrixWithTieredPricing: ScalableMatrixWithTieredPricingPrice + ) { + scalableMatrixWithTieredPricing.validate() + } } ) validated = true @@ -430,10 +464,10 @@ private constructor( return true } - return /* spotless:off */ other is Price && unit == other.unit && packagePrice == other.packagePrice && matrix == other.matrix && tiered == other.tiered && tieredBps == other.tieredBps && bps == other.bps && bulkBps == other.bulkBps && bulk == other.bulk && thresholdTotalAmount == other.thresholdTotalAmount && tieredPackage == other.tieredPackage && groupedTiered == other.groupedTiered && tieredWithMinimum == other.tieredWithMinimum && tieredPackageWithMinimum == other.tieredPackageWithMinimum && packageWithAllocation == other.packageWithAllocation && unitWithPercent == other.unitWithPercent && matrixWithAllocation == other.matrixWithAllocation && tieredWithProration == other.tieredWithProration && unitWithProration == other.unitWithProration && groupedAllocation == other.groupedAllocation && groupedWithProratedMinimum == other.groupedWithProratedMinimum && groupedWithMeteredMinimum == other.groupedWithMeteredMinimum && matrixWithDisplayName == other.matrixWithDisplayName && bulkWithProration == other.bulkWithProration && groupedTieredPackage == other.groupedTieredPackage && maxGroupTieredPackage == other.maxGroupTieredPackage /* spotless:on */ + return /* spotless:off */ other is Price && unit == other.unit && packagePrice == other.packagePrice && matrix == other.matrix && tiered == other.tiered && tieredBps == other.tieredBps && bps == other.bps && bulkBps == other.bulkBps && bulk == other.bulk && thresholdTotalAmount == other.thresholdTotalAmount && tieredPackage == other.tieredPackage && groupedTiered == other.groupedTiered && tieredWithMinimum == other.tieredWithMinimum && tieredPackageWithMinimum == other.tieredPackageWithMinimum && packageWithAllocation == other.packageWithAllocation && unitWithPercent == other.unitWithPercent && matrixWithAllocation == other.matrixWithAllocation && tieredWithProration == other.tieredWithProration && unitWithProration == other.unitWithProration && groupedAllocation == other.groupedAllocation && groupedWithProratedMinimum == other.groupedWithProratedMinimum && groupedWithMeteredMinimum == other.groupedWithMeteredMinimum && matrixWithDisplayName == other.matrixWithDisplayName && bulkWithProration == other.bulkWithProration && groupedTieredPackage == other.groupedTieredPackage && maxGroupTieredPackage == other.maxGroupTieredPackage && scalableMatrixWithUnitPricing == other.scalableMatrixWithUnitPricing && scalableMatrixWithTieredPricing == other.scalableMatrixWithTieredPricing /* spotless:on */ } - override fun hashCode(): Int = /* spotless:off */ Objects.hash(unit, packagePrice, matrix, tiered, tieredBps, bps, bulkBps, bulk, thresholdTotalAmount, tieredPackage, groupedTiered, tieredWithMinimum, tieredPackageWithMinimum, packageWithAllocation, unitWithPercent, matrixWithAllocation, tieredWithProration, unitWithProration, groupedAllocation, groupedWithProratedMinimum, groupedWithMeteredMinimum, matrixWithDisplayName, bulkWithProration, groupedTieredPackage, maxGroupTieredPackage) /* spotless:on */ + override fun hashCode(): Int = /* spotless:off */ Objects.hash(unit, packagePrice, matrix, tiered, tieredBps, bps, bulkBps, bulk, thresholdTotalAmount, tieredPackage, groupedTiered, tieredWithMinimum, tieredPackageWithMinimum, packageWithAllocation, unitWithPercent, matrixWithAllocation, tieredWithProration, unitWithProration, groupedAllocation, groupedWithProratedMinimum, groupedWithMeteredMinimum, matrixWithDisplayName, bulkWithProration, groupedTieredPackage, maxGroupTieredPackage, scalableMatrixWithUnitPricing, scalableMatrixWithTieredPricing) /* spotless:on */ override fun toString(): String = when { @@ -465,6 +499,10 @@ private constructor( bulkWithProration != null -> "Price{bulkWithProration=$bulkWithProration}" groupedTieredPackage != null -> "Price{groupedTieredPackage=$groupedTieredPackage}" maxGroupTieredPackage != null -> "Price{maxGroupTieredPackage=$maxGroupTieredPackage}" + scalableMatrixWithUnitPricing != null -> + "Price{scalableMatrixWithUnitPricing=$scalableMatrixWithUnitPricing}" + scalableMatrixWithTieredPricing != null -> + "Price{scalableMatrixWithTieredPricing=$scalableMatrixWithTieredPricing}" _json != null -> "Price{_unknown=$_json}" else -> throw IllegalStateException("Invalid Price") } @@ -556,8 +594,19 @@ private constructor( @JvmStatic fun ofMaxGroupTieredPackage(maxGroupTieredPackage: MaxGroupTieredPackagePrice) = Price(maxGroupTieredPackage = maxGroupTieredPackage) + + @JvmStatic + fun ofScalableMatrixWithUnitPricing( + scalableMatrixWithUnitPricing: ScalableMatrixWithUnitPricingPrice + ) = Price(scalableMatrixWithUnitPricing = scalableMatrixWithUnitPricing) + + @JvmStatic + fun ofScalableMatrixWithTieredPricing( + scalableMatrixWithTieredPricing: ScalableMatrixWithTieredPricingPrice + ) = Price(scalableMatrixWithTieredPricing = scalableMatrixWithTieredPricing) } + /** An interface that defines how to map each variant of [Price] to a value of type [T]. */ interface Visitor { fun visitUnit(unit: UnitPrice): T @@ -616,12 +665,29 @@ private constructor( fun visitMaxGroupTieredPackage(maxGroupTieredPackage: MaxGroupTieredPackagePrice): T + fun visitScalableMatrixWithUnitPricing( + scalableMatrixWithUnitPricing: ScalableMatrixWithUnitPricingPrice + ): T + + fun visitScalableMatrixWithTieredPricing( + scalableMatrixWithTieredPricing: ScalableMatrixWithTieredPricingPrice + ): T + + /** + * Maps an unknown variant of [Price] to a value of type [T]. + * + * An instance of [Price] can contain an unknown variant if it was deserialized from data + * that doesn't match any known variant. For example, if the SDK is on an older version than + * the API, then the API may respond with new variants that the SDK is unaware of. + * + * @throws OrbInvalidDataException in the default implementation. + */ fun unknown(json: JsonValue?): T { throw OrbInvalidDataException("Unknown Price: $json") } } - class Deserializer : BaseDeserializer(Price::class) { + internal class Deserializer : BaseDeserializer(Price::class) { override fun ObjectCodec.deserialize(node: JsonNode): Price { val json = JsonValue.fromJsonNode(node) @@ -798,13 +864,29 @@ private constructor( return Price(maxGroupTieredPackage = it, _json = json) } } + "scalable_matrix_with_unit_pricing" -> { + tryDeserialize(node, jacksonTypeRef()) { + it.validate() + } + ?.let { + return Price(scalableMatrixWithUnitPricing = it, _json = json) + } + } + "scalable_matrix_with_tiered_pricing" -> { + tryDeserialize(node, jacksonTypeRef()) { + it.validate() + } + ?.let { + return Price(scalableMatrixWithTieredPricing = it, _json = json) + } + } } return Price(_json = json) } } - class Serializer : BaseSerializer(Price::class) { + internal class Serializer : BaseSerializer(Price::class) { override fun serialize( value: Price, @@ -847,6 +929,10 @@ private constructor( generator.writeObject(value.groupedTieredPackage) value.maxGroupTieredPackage != null -> generator.writeObject(value.maxGroupTieredPackage) + value.scalableMatrixWithUnitPricing != null -> + generator.writeObject(value.scalableMatrixWithUnitPricing) + value.scalableMatrixWithTieredPricing != null -> + generator.writeObject(value.scalableMatrixWithTieredPricing) value._json != null -> generator.writeObject(value._json) else -> throw IllegalStateException("Invalid Price") } @@ -924,6 +1010,10 @@ private constructor( @JsonProperty("unit_config") @ExcludeMissing private val unitConfig: JsonField = JsonMissing.of(), + @JsonProperty("dimensional_price_configuration") + @ExcludeMissing + private val dimensionalPriceConfiguration: JsonField = + JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { @@ -991,6 +1081,11 @@ private constructor( fun unitConfig(): UnitConfig = unitConfig.getRequired("unit_config") + fun dimensionalPriceConfiguration(): Optional = + Optional.ofNullable( + dimensionalPriceConfiguration.getNullable("dimensional_price_configuration") + ) + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id @JsonProperty("billable_metric") @@ -1072,6 +1167,11 @@ private constructor( @ExcludeMissing fun _unitConfig(): JsonField = unitConfig + @JsonProperty("dimensional_price_configuration") + @ExcludeMissing + fun _dimensionalPriceConfiguration(): JsonField = + dimensionalPriceConfiguration + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -1106,6 +1206,7 @@ private constructor( planPhaseOrder() priceType() unitConfig().validate() + dimensionalPriceConfiguration().ifPresent { it.validate() } validated = true } @@ -1116,7 +1217,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [UnitPrice]. */ + class Builder internal constructor() { private var id: JsonField? = null private var billableMetric: JsonField? = null @@ -1141,6 +1243,8 @@ private constructor( private var planPhaseOrder: JsonField? = null private var priceType: JsonField? = null private var unitConfig: JsonField? = null + private var dimensionalPriceConfiguration: JsonField = + JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -1168,6 +1272,7 @@ private constructor( planPhaseOrder = unitPrice.planPhaseOrder priceType = unitPrice.priceType unitConfig = unitPrice.unitConfig + dimensionalPriceConfiguration = unitPrice.dimensionalPriceConfiguration additionalProperties = unitPrice.additionalProperties.toMutableMap() } @@ -1240,6 +1345,14 @@ private constructor( fun discount(trial: TrialDiscount) = discount(Discount.ofTrial(trial)) + fun trialDiscount(appliesToPriceIds: List) = + discount( + TrialDiscount.builder() + .discountType(TrialDiscount.DiscountType.TRIAL) + .appliesToPriceIds(appliesToPriceIds) + .build() + ) + fun discount(usage: Discount.UsageDiscount) = discount(Discount.ofUsage(usage)) fun discount(amount: AmountDiscount) = discount(Discount.ofAmount(amount)) @@ -1361,6 +1474,18 @@ private constructor( this.unitConfig = unitConfig } + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: DimensionalPriceConfiguration? + ) = dimensionalPriceConfiguration(JsonField.ofNullable(dimensionalPriceConfiguration)) + + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: Optional + ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.orElse(null)) + + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: JsonField + ) = apply { this.dimensionalPriceConfiguration = dimensionalPriceConfiguration } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -1405,6 +1530,7 @@ private constructor( checkRequired("planPhaseOrder", planPhaseOrder), checkRequired("priceType", priceType), checkRequired("unitConfig", unitConfig), + dimensionalPriceConfiguration, additionalProperties.toImmutable(), ) } @@ -1446,7 +1572,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillableMetric]. */ + class Builder internal constructor() { private var id: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -1552,7 +1679,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -1613,6 +1741,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -1624,17 +1760,39 @@ private constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -1642,6 +1800,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -1688,6 +1855,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -1707,6 +1882,7 @@ private constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ONE_TIME, MONTHLY, @@ -1716,6 +1892,15 @@ private constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ONE_TIME, MONTHLY, @@ -1723,9 +1908,19 @@ private constructor( SEMI_ANNUAL, ANNUAL, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { ONE_TIME -> Value.ONE_TIME @@ -1737,6 +1932,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ONE_TIME -> Known.ONE_TIME @@ -1810,7 +2014,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CreditAllocation]. */ + class Builder internal constructor() { private var allowsRollover: JsonField? = null private var currency: JsonField? = null @@ -1929,7 +2134,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -1991,6 +2197,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -2002,17 +2216,39 @@ private constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -2020,6 +2256,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -2105,7 +2350,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Item]. */ + class Builder internal constructor() { private var id: JsonField? = null private var name: JsonField? = null @@ -2234,7 +2480,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Maximum]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var maximumAmount: JsonField? = null @@ -2372,7 +2619,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -2483,7 +2731,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Minimum]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var minimumAmount: JsonField? = null @@ -2593,6 +2842,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -2602,21 +2859,51 @@ private constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { UNIT, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { UNIT, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { UNIT -> Value.UNIT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { UNIT -> Known.UNIT @@ -2644,6 +2931,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -2655,17 +2950,38 @@ private constructor( @JvmStatic fun of(value: String) = PriceType(JsonField.of(value)) } + /** An enum containing [PriceType]'s known values. */ enum class Known { USAGE_PRICE, FIXED_PRICE, } + /** + * An enum containing [PriceType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [PriceType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { USAGE_PRICE, FIXED_PRICE, + /** + * An enum member indicating that [PriceType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { USAGE_PRICE -> Value.USAGE_PRICE @@ -2673,6 +2989,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { USAGE_PRICE -> Known.USAGE_PRICE @@ -2736,7 +3061,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [UnitConfig]. */ + class Builder internal constructor() { private var unitAmount: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -2802,22 +3128,165 @@ private constructor( "UnitConfig{unitAmount=$unitAmount, additionalProperties=$additionalProperties}" } + @NoAutoDetect + class DimensionalPriceConfiguration + @JsonCreator + private constructor( + @JsonProperty("dimension_values") + @ExcludeMissing + private val dimensionValues: JsonField> = JsonMissing.of(), + @JsonProperty("dimensional_price_group_id") + @ExcludeMissing + private val dimensionalPriceGroupId: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { + + fun dimensionValues(): List = dimensionValues.getRequired("dimension_values") + + fun dimensionalPriceGroupId(): String = + dimensionalPriceGroupId.getRequired("dimensional_price_group_id") + + @JsonProperty("dimension_values") + @ExcludeMissing + fun _dimensionValues(): JsonField> = dimensionValues + + @JsonProperty("dimensional_price_group_id") + @ExcludeMissing + fun _dimensionalPriceGroupId(): JsonField = dimensionalPriceGroupId + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): DimensionalPriceConfiguration = apply { + if (validated) { + return@apply + } + + dimensionValues() + dimensionalPriceGroupId() + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + /** A builder for [DimensionalPriceConfiguration]. */ + class Builder internal constructor() { + + private var dimensionValues: JsonField>? = null + private var dimensionalPriceGroupId: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(dimensionalPriceConfiguration: DimensionalPriceConfiguration) = + apply { + dimensionValues = + dimensionalPriceConfiguration.dimensionValues.map { it.toMutableList() } + dimensionalPriceGroupId = + dimensionalPriceConfiguration.dimensionalPriceGroupId + additionalProperties = + dimensionalPriceConfiguration.additionalProperties.toMutableMap() + } + + fun dimensionValues(dimensionValues: List) = + dimensionValues(JsonField.of(dimensionValues)) + + fun dimensionValues(dimensionValues: JsonField>) = apply { + this.dimensionValues = dimensionValues.map { it.toMutableList() } + } + + fun addDimensionValue(dimensionValue: String) = apply { + dimensionValues = + (dimensionValues ?: JsonField.of(mutableListOf())).apply { + asKnown() + .orElseThrow { + IllegalStateException( + "Field was set to non-list type: ${javaClass.simpleName}" + ) + } + .add(dimensionValue) + } + } + + fun dimensionalPriceGroupId(dimensionalPriceGroupId: String) = + dimensionalPriceGroupId(JsonField.of(dimensionalPriceGroupId)) + + fun dimensionalPriceGroupId(dimensionalPriceGroupId: JsonField) = apply { + this.dimensionalPriceGroupId = dimensionalPriceGroupId + } + + 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(): DimensionalPriceConfiguration = + DimensionalPriceConfiguration( + checkRequired("dimensionValues", dimensionValues).map { it.toImmutable() }, + checkRequired("dimensionalPriceGroupId", dimensionalPriceGroupId), + additionalProperties.toImmutable(), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is DimensionalPriceConfiguration && dimensionValues == other.dimensionValues && dimensionalPriceGroupId == other.dimensionalPriceGroupId && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(dimensionValues, dimensionalPriceGroupId, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "DimensionalPriceConfiguration{dimensionValues=$dimensionValues, dimensionalPriceGroupId=$dimensionalPriceGroupId, additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true } - return /* spotless:off */ other is UnitPrice && 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 && unitConfig == other.unitConfig && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is UnitPrice && 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 && unitConfig == other.unitConfig && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && 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, unitConfig, 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, unitConfig, dimensionalPriceConfiguration, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "UnitPrice{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, unitConfig=$unitConfig, additionalProperties=$additionalProperties}" + "UnitPrice{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, unitConfig=$unitConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, additionalProperties=$additionalProperties}" } @NoAutoDetect @@ -2891,6 +3360,10 @@ private constructor( @JsonProperty("price_type") @ExcludeMissing private val priceType: JsonField = JsonMissing.of(), + @JsonProperty("dimensional_price_configuration") + @ExcludeMissing + private val dimensionalPriceConfiguration: JsonField = + JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { @@ -2958,6 +3431,11 @@ private constructor( fun priceType(): PriceType = priceType.getRequired("price_type") + fun dimensionalPriceConfiguration(): Optional = + Optional.ofNullable( + dimensionalPriceConfiguration.getNullable("dimensional_price_configuration") + ) + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id @JsonProperty("billable_metric") @@ -3039,6 +3517,11 @@ private constructor( @ExcludeMissing fun _priceType(): JsonField = priceType + @JsonProperty("dimensional_price_configuration") + @ExcludeMissing + fun _dimensionalPriceConfiguration(): JsonField = + dimensionalPriceConfiguration + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -3073,6 +3556,7 @@ private constructor( packageConfig().validate() planPhaseOrder() priceType() + dimensionalPriceConfiguration().ifPresent { it.validate() } validated = true } @@ -3083,7 +3567,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [PackagePrice]. */ + class Builder internal constructor() { private var id: JsonField? = null private var billableMetric: JsonField? = null @@ -3108,6 +3593,8 @@ private constructor( private var packageConfig: JsonField? = null private var planPhaseOrder: JsonField? = null private var priceType: JsonField? = null + private var dimensionalPriceConfiguration: JsonField = + JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -3135,6 +3622,7 @@ private constructor( packageConfig = packagePrice.packageConfig planPhaseOrder = packagePrice.planPhaseOrder priceType = packagePrice.priceType + dimensionalPriceConfiguration = packagePrice.dimensionalPriceConfiguration additionalProperties = packagePrice.additionalProperties.toMutableMap() } @@ -3207,6 +3695,14 @@ private constructor( fun discount(trial: TrialDiscount) = discount(Discount.ofTrial(trial)) + fun trialDiscount(appliesToPriceIds: List) = + discount( + TrialDiscount.builder() + .discountType(TrialDiscount.DiscountType.TRIAL) + .appliesToPriceIds(appliesToPriceIds) + .build() + ) + fun discount(usage: Discount.UsageDiscount) = discount(Discount.ofUsage(usage)) fun discount(amount: AmountDiscount) = discount(Discount.ofAmount(amount)) @@ -3329,6 +3825,18 @@ private constructor( fun priceType(priceType: JsonField) = apply { this.priceType = priceType } + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: DimensionalPriceConfiguration? + ) = dimensionalPriceConfiguration(JsonField.ofNullable(dimensionalPriceConfiguration)) + + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: Optional + ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.orElse(null)) + + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: JsonField + ) = apply { this.dimensionalPriceConfiguration = dimensionalPriceConfiguration } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -3373,6 +3881,7 @@ private constructor( checkRequired("packageConfig", packageConfig), checkRequired("planPhaseOrder", planPhaseOrder), checkRequired("priceType", priceType), + dimensionalPriceConfiguration, additionalProperties.toImmutable(), ) } @@ -3414,7 +3923,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillableMetric]. */ + class Builder internal constructor() { private var id: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -3520,7 +4030,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -3581,6 +4092,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -3592,17 +4111,39 @@ private constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -3610,6 +4151,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -3656,6 +4206,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -3675,6 +4233,7 @@ private constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ONE_TIME, MONTHLY, @@ -3684,6 +4243,15 @@ private constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ONE_TIME, MONTHLY, @@ -3691,9 +4259,19 @@ private constructor( SEMI_ANNUAL, ANNUAL, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { ONE_TIME -> Value.ONE_TIME @@ -3705,6 +4283,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ONE_TIME -> Known.ONE_TIME @@ -3778,7 +4365,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CreditAllocation]. */ + class Builder internal constructor() { private var allowsRollover: JsonField? = null private var currency: JsonField? = null @@ -3897,7 +4485,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -3959,6 +4548,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -3970,17 +4567,39 @@ private constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -3988,6 +4607,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -4073,7 +4701,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Item]. */ + class Builder internal constructor() { private var id: JsonField? = null private var name: JsonField? = null @@ -4202,7 +4831,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Maximum]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var maximumAmount: JsonField? = null @@ -4340,7 +4970,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -4451,7 +5082,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Minimum]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var minimumAmount: JsonField? = null @@ -4561,6 +5193,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -4570,21 +5210,51 @@ private constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { PACKAGE, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PACKAGE, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { PACKAGE -> Value.PACKAGE else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { PACKAGE -> Known.PACKAGE @@ -4665,7 +5335,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [PackageConfig]. */ + class Builder internal constructor() { private var packageAmount: JsonField? = null private var packageSize: JsonField? = null @@ -4755,6 +5426,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -4766,17 +5445,38 @@ private constructor( @JvmStatic fun of(value: String) = PriceType(JsonField.of(value)) } + /** An enum containing [PriceType]'s known values. */ enum class Known { USAGE_PRICE, FIXED_PRICE, } + /** + * An enum containing [PriceType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [PriceType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { USAGE_PRICE, FIXED_PRICE, + /** + * An enum member indicating that [PriceType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { USAGE_PRICE -> Value.USAGE_PRICE @@ -4784,6 +5484,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { USAGE_PRICE -> Known.USAGE_PRICE @@ -4806,22 +5515,165 @@ private constructor( override fun toString() = value.toString() } + @NoAutoDetect + class DimensionalPriceConfiguration + @JsonCreator + private constructor( + @JsonProperty("dimension_values") + @ExcludeMissing + private val dimensionValues: JsonField> = JsonMissing.of(), + @JsonProperty("dimensional_price_group_id") + @ExcludeMissing + private val dimensionalPriceGroupId: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { + + fun dimensionValues(): List = dimensionValues.getRequired("dimension_values") + + fun dimensionalPriceGroupId(): String = + dimensionalPriceGroupId.getRequired("dimensional_price_group_id") + + @JsonProperty("dimension_values") + @ExcludeMissing + fun _dimensionValues(): JsonField> = dimensionValues + + @JsonProperty("dimensional_price_group_id") + @ExcludeMissing + fun _dimensionalPriceGroupId(): JsonField = dimensionalPriceGroupId + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): DimensionalPriceConfiguration = apply { + if (validated) { + return@apply + } + + dimensionValues() + dimensionalPriceGroupId() + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + /** A builder for [DimensionalPriceConfiguration]. */ + class Builder internal constructor() { + + private var dimensionValues: JsonField>? = null + private var dimensionalPriceGroupId: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(dimensionalPriceConfiguration: DimensionalPriceConfiguration) = + apply { + dimensionValues = + dimensionalPriceConfiguration.dimensionValues.map { it.toMutableList() } + dimensionalPriceGroupId = + dimensionalPriceConfiguration.dimensionalPriceGroupId + additionalProperties = + dimensionalPriceConfiguration.additionalProperties.toMutableMap() + } + + fun dimensionValues(dimensionValues: List) = + dimensionValues(JsonField.of(dimensionValues)) + + fun dimensionValues(dimensionValues: JsonField>) = apply { + this.dimensionValues = dimensionValues.map { it.toMutableList() } + } + + fun addDimensionValue(dimensionValue: String) = apply { + dimensionValues = + (dimensionValues ?: JsonField.of(mutableListOf())).apply { + asKnown() + .orElseThrow { + IllegalStateException( + "Field was set to non-list type: ${javaClass.simpleName}" + ) + } + .add(dimensionValue) + } + } + + fun dimensionalPriceGroupId(dimensionalPriceGroupId: String) = + dimensionalPriceGroupId(JsonField.of(dimensionalPriceGroupId)) + + fun dimensionalPriceGroupId(dimensionalPriceGroupId: JsonField) = apply { + this.dimensionalPriceGroupId = dimensionalPriceGroupId + } + + 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(): DimensionalPriceConfiguration = + DimensionalPriceConfiguration( + checkRequired("dimensionValues", dimensionValues).map { it.toImmutable() }, + checkRequired("dimensionalPriceGroupId", dimensionalPriceGroupId), + additionalProperties.toImmutable(), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is DimensionalPriceConfiguration && dimensionValues == other.dimensionValues && dimensionalPriceGroupId == other.dimensionalPriceGroupId && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(dimensionValues, dimensionalPriceGroupId, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "DimensionalPriceConfiguration{dimensionValues=$dimensionValues, dimensionalPriceGroupId=$dimensionalPriceGroupId, additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true } - return /* spotless:off */ other is PackagePrice && 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 && packageConfig == other.packageConfig && planPhaseOrder == other.planPhaseOrder && priceType == other.priceType && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is PackagePrice && 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 && packageConfig == other.packageConfig && planPhaseOrder == other.planPhaseOrder && priceType == other.priceType && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && 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, packageConfig, 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, packageConfig, planPhaseOrder, priceType, dimensionalPriceConfiguration, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "PackagePrice{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, packageConfig=$packageConfig, planPhaseOrder=$planPhaseOrder, priceType=$priceType, additionalProperties=$additionalProperties}" + "PackagePrice{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, packageConfig=$packageConfig, planPhaseOrder=$planPhaseOrder, priceType=$priceType, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, additionalProperties=$additionalProperties}" } @NoAutoDetect @@ -4895,6 +5747,10 @@ private constructor( @JsonProperty("price_type") @ExcludeMissing private val priceType: JsonField = JsonMissing.of(), + @JsonProperty("dimensional_price_configuration") + @ExcludeMissing + private val dimensionalPriceConfiguration: JsonField = + JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { @@ -4962,6 +5818,11 @@ private constructor( fun priceType(): PriceType = priceType.getRequired("price_type") + fun dimensionalPriceConfiguration(): Optional = + Optional.ofNullable( + dimensionalPriceConfiguration.getNullable("dimensional_price_configuration") + ) + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id @JsonProperty("billable_metric") @@ -5043,6 +5904,11 @@ private constructor( @ExcludeMissing fun _priceType(): JsonField = priceType + @JsonProperty("dimensional_price_configuration") + @ExcludeMissing + fun _dimensionalPriceConfiguration(): JsonField = + dimensionalPriceConfiguration + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -5077,6 +5943,7 @@ private constructor( name() planPhaseOrder() priceType() + dimensionalPriceConfiguration().ifPresent { it.validate() } validated = true } @@ -5087,7 +5954,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MatrixPrice]. */ + class Builder internal constructor() { private var id: JsonField? = null private var billableMetric: JsonField? = null @@ -5112,6 +5980,8 @@ private constructor( private var name: JsonField? = null private var planPhaseOrder: JsonField? = null private var priceType: JsonField? = null + private var dimensionalPriceConfiguration: JsonField = + JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -5139,6 +6009,7 @@ private constructor( name = matrixPrice.name planPhaseOrder = matrixPrice.planPhaseOrder priceType = matrixPrice.priceType + dimensionalPriceConfiguration = matrixPrice.dimensionalPriceConfiguration additionalProperties = matrixPrice.additionalProperties.toMutableMap() } @@ -5211,6 +6082,14 @@ private constructor( fun discount(trial: TrialDiscount) = discount(Discount.ofTrial(trial)) + fun trialDiscount(appliesToPriceIds: List) = + discount( + TrialDiscount.builder() + .discountType(TrialDiscount.DiscountType.TRIAL) + .appliesToPriceIds(appliesToPriceIds) + .build() + ) + fun discount(usage: Discount.UsageDiscount) = discount(Discount.ofUsage(usage)) fun discount(amount: AmountDiscount) = discount(Discount.ofAmount(amount)) @@ -5332,6 +6211,18 @@ private constructor( fun priceType(priceType: JsonField) = apply { this.priceType = priceType } + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: DimensionalPriceConfiguration? + ) = dimensionalPriceConfiguration(JsonField.ofNullable(dimensionalPriceConfiguration)) + + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: Optional + ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.orElse(null)) + + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: JsonField + ) = apply { this.dimensionalPriceConfiguration = dimensionalPriceConfiguration } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -5376,6 +6267,7 @@ private constructor( checkRequired("name", name), checkRequired("planPhaseOrder", planPhaseOrder), checkRequired("priceType", priceType), + dimensionalPriceConfiguration, additionalProperties.toImmutable(), ) } @@ -5417,7 +6309,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillableMetric]. */ + class Builder internal constructor() { private var id: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -5523,7 +6416,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -5584,6 +6478,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -5595,17 +6497,39 @@ private constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -5613,6 +6537,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -5659,6 +6592,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -5678,6 +6619,7 @@ private constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ONE_TIME, MONTHLY, @@ -5687,6 +6629,15 @@ private constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ONE_TIME, MONTHLY, @@ -5694,9 +6645,19 @@ private constructor( SEMI_ANNUAL, ANNUAL, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { ONE_TIME -> Value.ONE_TIME @@ -5708,6 +6669,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ONE_TIME -> Known.ONE_TIME @@ -5781,7 +6751,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CreditAllocation]. */ + class Builder internal constructor() { private var allowsRollover: JsonField? = null private var currency: JsonField? = null @@ -5900,7 +6871,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -5962,6 +6934,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -5973,17 +6953,39 @@ private constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -5991,6 +6993,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -6076,7 +7087,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Item]. */ + class Builder internal constructor() { private var id: JsonField? = null private var name: JsonField? = null @@ -6210,7 +7222,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MatrixConfig]. */ + class Builder internal constructor() { private var defaultUnitAmount: JsonField? = null private var dimensions: JsonField>? = null @@ -6376,7 +7389,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MatrixValue]. */ + class Builder internal constructor() { private var dimensionValues: JsonField>? = null private var unitAmount: JsonField? = null @@ -6560,7 +7574,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Maximum]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var maximumAmount: JsonField? = null @@ -6698,7 +7713,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -6809,7 +7825,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Minimum]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var minimumAmount: JsonField? = null @@ -6919,6 +7936,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -6928,21 +7953,51 @@ private constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { MATRIX, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { MATRIX, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { MATRIX -> Value.MATRIX else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { MATRIX -> Known.MATRIX @@ -6970,6 +8025,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -6981,17 +8044,38 @@ private constructor( @JvmStatic fun of(value: String) = PriceType(JsonField.of(value)) } + /** An enum containing [PriceType]'s known values. */ enum class Known { USAGE_PRICE, FIXED_PRICE, } + /** + * An enum containing [PriceType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [PriceType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { USAGE_PRICE, FIXED_PRICE, + /** + * An enum member indicating that [PriceType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { USAGE_PRICE -> Value.USAGE_PRICE @@ -6999,6 +8083,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { USAGE_PRICE -> Known.USAGE_PRICE @@ -7021,22 +8114,165 @@ private constructor( override fun toString() = value.toString() } + @NoAutoDetect + class DimensionalPriceConfiguration + @JsonCreator + private constructor( + @JsonProperty("dimension_values") + @ExcludeMissing + private val dimensionValues: JsonField> = JsonMissing.of(), + @JsonProperty("dimensional_price_group_id") + @ExcludeMissing + private val dimensionalPriceGroupId: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { + + fun dimensionValues(): List = dimensionValues.getRequired("dimension_values") + + fun dimensionalPriceGroupId(): String = + dimensionalPriceGroupId.getRequired("dimensional_price_group_id") + + @JsonProperty("dimension_values") + @ExcludeMissing + fun _dimensionValues(): JsonField> = dimensionValues + + @JsonProperty("dimensional_price_group_id") + @ExcludeMissing + fun _dimensionalPriceGroupId(): JsonField = dimensionalPriceGroupId + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): DimensionalPriceConfiguration = apply { + if (validated) { + return@apply + } + + dimensionValues() + dimensionalPriceGroupId() + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + /** A builder for [DimensionalPriceConfiguration]. */ + class Builder internal constructor() { + + private var dimensionValues: JsonField>? = null + private var dimensionalPriceGroupId: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(dimensionalPriceConfiguration: DimensionalPriceConfiguration) = + apply { + dimensionValues = + dimensionalPriceConfiguration.dimensionValues.map { it.toMutableList() } + dimensionalPriceGroupId = + dimensionalPriceConfiguration.dimensionalPriceGroupId + additionalProperties = + dimensionalPriceConfiguration.additionalProperties.toMutableMap() + } + + fun dimensionValues(dimensionValues: List) = + dimensionValues(JsonField.of(dimensionValues)) + + fun dimensionValues(dimensionValues: JsonField>) = apply { + this.dimensionValues = dimensionValues.map { it.toMutableList() } + } + + fun addDimensionValue(dimensionValue: String) = apply { + dimensionValues = + (dimensionValues ?: JsonField.of(mutableListOf())).apply { + asKnown() + .orElseThrow { + IllegalStateException( + "Field was set to non-list type: ${javaClass.simpleName}" + ) + } + .add(dimensionValue) + } + } + + fun dimensionalPriceGroupId(dimensionalPriceGroupId: String) = + dimensionalPriceGroupId(JsonField.of(dimensionalPriceGroupId)) + + fun dimensionalPriceGroupId(dimensionalPriceGroupId: JsonField) = apply { + this.dimensionalPriceGroupId = dimensionalPriceGroupId + } + + 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(): DimensionalPriceConfiguration = + DimensionalPriceConfiguration( + checkRequired("dimensionValues", dimensionValues).map { it.toImmutable() }, + checkRequired("dimensionalPriceGroupId", dimensionalPriceGroupId), + additionalProperties.toImmutable(), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is DimensionalPriceConfiguration && dimensionValues == other.dimensionValues && dimensionalPriceGroupId == other.dimensionalPriceGroupId && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(dimensionValues, dimensionalPriceGroupId, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "DimensionalPriceConfiguration{dimensionValues=$dimensionValues, dimensionalPriceGroupId=$dimensionalPriceGroupId, additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true } - return /* spotless:off */ other is MatrixPrice && 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 && matrixConfig == other.matrixConfig && 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 MatrixPrice && 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 && matrixConfig == other.matrixConfig && 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 && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && 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, matrixConfig, 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, matrixConfig, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, dimensionalPriceConfiguration, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "MatrixPrice{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, matrixConfig=$matrixConfig, maximum=$maximum, maximumAmount=$maximumAmount, metadata=$metadata, minimum=$minimum, minimumAmount=$minimumAmount, modelType=$modelType, name=$name, planPhaseOrder=$planPhaseOrder, priceType=$priceType, additionalProperties=$additionalProperties}" + "MatrixPrice{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, matrixConfig=$matrixConfig, maximum=$maximum, maximumAmount=$maximumAmount, metadata=$metadata, minimum=$minimum, minimumAmount=$minimumAmount, modelType=$modelType, name=$name, planPhaseOrder=$planPhaseOrder, priceType=$priceType, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, additionalProperties=$additionalProperties}" } @NoAutoDetect @@ -7110,6 +8346,10 @@ private constructor( @JsonProperty("tiered_config") @ExcludeMissing private val tieredConfig: JsonField = JsonMissing.of(), + @JsonProperty("dimensional_price_configuration") + @ExcludeMissing + private val dimensionalPriceConfiguration: JsonField = + JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { @@ -7177,6 +8417,11 @@ private constructor( fun tieredConfig(): TieredConfig = tieredConfig.getRequired("tiered_config") + fun dimensionalPriceConfiguration(): Optional = + Optional.ofNullable( + dimensionalPriceConfiguration.getNullable("dimensional_price_configuration") + ) + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id @JsonProperty("billable_metric") @@ -7258,6 +8503,11 @@ private constructor( @ExcludeMissing fun _tieredConfig(): JsonField = tieredConfig + @JsonProperty("dimensional_price_configuration") + @ExcludeMissing + fun _dimensionalPriceConfiguration(): JsonField = + dimensionalPriceConfiguration + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -7292,6 +8542,7 @@ private constructor( planPhaseOrder() priceType() tieredConfig().validate() + dimensionalPriceConfiguration().ifPresent { it.validate() } validated = true } @@ -7302,7 +8553,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TieredPrice]. */ + class Builder internal constructor() { private var id: JsonField? = null private var billableMetric: JsonField? = null @@ -7327,6 +8579,8 @@ private constructor( private var planPhaseOrder: JsonField? = null private var priceType: JsonField? = null private var tieredConfig: JsonField? = null + private var dimensionalPriceConfiguration: JsonField = + JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -7354,6 +8608,7 @@ private constructor( planPhaseOrder = tieredPrice.planPhaseOrder priceType = tieredPrice.priceType tieredConfig = tieredPrice.tieredConfig + dimensionalPriceConfiguration = tieredPrice.dimensionalPriceConfiguration additionalProperties = tieredPrice.additionalProperties.toMutableMap() } @@ -7426,6 +8681,14 @@ private constructor( fun discount(trial: TrialDiscount) = discount(Discount.ofTrial(trial)) + fun trialDiscount(appliesToPriceIds: List) = + discount( + TrialDiscount.builder() + .discountType(TrialDiscount.DiscountType.TRIAL) + .appliesToPriceIds(appliesToPriceIds) + .build() + ) + fun discount(usage: Discount.UsageDiscount) = discount(Discount.ofUsage(usage)) fun discount(amount: AmountDiscount) = discount(Discount.ofAmount(amount)) @@ -7547,6 +8810,18 @@ private constructor( this.tieredConfig = tieredConfig } + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: DimensionalPriceConfiguration? + ) = dimensionalPriceConfiguration(JsonField.ofNullable(dimensionalPriceConfiguration)) + + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: Optional + ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.orElse(null)) + + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: JsonField + ) = apply { this.dimensionalPriceConfiguration = dimensionalPriceConfiguration } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -7591,6 +8866,7 @@ private constructor( checkRequired("planPhaseOrder", planPhaseOrder), checkRequired("priceType", priceType), checkRequired("tieredConfig", tieredConfig), + dimensionalPriceConfiguration, additionalProperties.toImmutable(), ) } @@ -7632,7 +8908,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillableMetric]. */ + class Builder internal constructor() { private var id: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -7738,7 +9015,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -7799,6 +9077,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -7810,17 +9096,39 @@ private constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -7828,6 +9136,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -7874,6 +9191,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -7893,6 +9218,7 @@ private constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ONE_TIME, MONTHLY, @@ -7902,6 +9228,15 @@ private constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ONE_TIME, MONTHLY, @@ -7909,9 +9244,19 @@ private constructor( SEMI_ANNUAL, ANNUAL, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { ONE_TIME -> Value.ONE_TIME @@ -7923,6 +9268,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ONE_TIME -> Known.ONE_TIME @@ -7996,7 +9350,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CreditAllocation]. */ + class Builder internal constructor() { private var allowsRollover: JsonField? = null private var currency: JsonField? = null @@ -8115,7 +9470,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -8177,6 +9533,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -8188,17 +9552,39 @@ private constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -8206,6 +9592,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -8291,7 +9686,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Item]. */ + class Builder internal constructor() { private var id: JsonField? = null private var name: JsonField? = null @@ -8420,7 +9816,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Maximum]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var maximumAmount: JsonField? = null @@ -8558,7 +9955,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -8669,7 +10067,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Minimum]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var minimumAmount: JsonField? = null @@ -8779,6 +10178,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -8788,21 +10195,51 @@ private constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { TIERED, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { TIERED, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { TIERED -> Value.TIERED else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { TIERED -> Known.TIERED @@ -8830,6 +10267,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -8841,17 +10286,38 @@ private constructor( @JvmStatic fun of(value: String) = PriceType(JsonField.of(value)) } + /** An enum containing [PriceType]'s known values. */ enum class Known { USAGE_PRICE, FIXED_PRICE, } + /** + * An enum containing [PriceType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [PriceType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { USAGE_PRICE, FIXED_PRICE, + /** + * An enum member indicating that [PriceType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { USAGE_PRICE -> Value.USAGE_PRICE @@ -8859,6 +10325,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { USAGE_PRICE -> Known.USAGE_PRICE @@ -8920,7 +10395,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TieredConfig]. */ + class Builder internal constructor() { private var tiers: JsonField>? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -9048,7 +10524,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Tier]. */ + class Builder internal constructor() { private var firstUnit: JsonField? = null private var unitAmount: JsonField? = null @@ -9160,22 +10637,165 @@ private constructor( "TieredConfig{tiers=$tiers, additionalProperties=$additionalProperties}" } + @NoAutoDetect + class DimensionalPriceConfiguration + @JsonCreator + private constructor( + @JsonProperty("dimension_values") + @ExcludeMissing + private val dimensionValues: JsonField> = JsonMissing.of(), + @JsonProperty("dimensional_price_group_id") + @ExcludeMissing + private val dimensionalPriceGroupId: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { + + fun dimensionValues(): List = dimensionValues.getRequired("dimension_values") + + fun dimensionalPriceGroupId(): String = + dimensionalPriceGroupId.getRequired("dimensional_price_group_id") + + @JsonProperty("dimension_values") + @ExcludeMissing + fun _dimensionValues(): JsonField> = dimensionValues + + @JsonProperty("dimensional_price_group_id") + @ExcludeMissing + fun _dimensionalPriceGroupId(): JsonField = dimensionalPriceGroupId + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): DimensionalPriceConfiguration = apply { + if (validated) { + return@apply + } + + dimensionValues() + dimensionalPriceGroupId() + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + /** A builder for [DimensionalPriceConfiguration]. */ + class Builder internal constructor() { + + private var dimensionValues: JsonField>? = null + private var dimensionalPriceGroupId: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(dimensionalPriceConfiguration: DimensionalPriceConfiguration) = + apply { + dimensionValues = + dimensionalPriceConfiguration.dimensionValues.map { it.toMutableList() } + dimensionalPriceGroupId = + dimensionalPriceConfiguration.dimensionalPriceGroupId + additionalProperties = + dimensionalPriceConfiguration.additionalProperties.toMutableMap() + } + + fun dimensionValues(dimensionValues: List) = + dimensionValues(JsonField.of(dimensionValues)) + + fun dimensionValues(dimensionValues: JsonField>) = apply { + this.dimensionValues = dimensionValues.map { it.toMutableList() } + } + + fun addDimensionValue(dimensionValue: String) = apply { + dimensionValues = + (dimensionValues ?: JsonField.of(mutableListOf())).apply { + asKnown() + .orElseThrow { + IllegalStateException( + "Field was set to non-list type: ${javaClass.simpleName}" + ) + } + .add(dimensionValue) + } + } + + fun dimensionalPriceGroupId(dimensionalPriceGroupId: String) = + dimensionalPriceGroupId(JsonField.of(dimensionalPriceGroupId)) + + fun dimensionalPriceGroupId(dimensionalPriceGroupId: JsonField) = apply { + this.dimensionalPriceGroupId = dimensionalPriceGroupId + } + + 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(): DimensionalPriceConfiguration = + DimensionalPriceConfiguration( + checkRequired("dimensionValues", dimensionValues).map { it.toImmutable() }, + checkRequired("dimensionalPriceGroupId", dimensionalPriceGroupId), + additionalProperties.toImmutable(), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is DimensionalPriceConfiguration && dimensionValues == other.dimensionValues && dimensionalPriceGroupId == other.dimensionalPriceGroupId && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(dimensionValues, dimensionalPriceGroupId, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "DimensionalPriceConfiguration{dimensionValues=$dimensionValues, dimensionalPriceGroupId=$dimensionalPriceGroupId, additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true } - return /* spotless:off */ other is TieredPrice && 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 && tieredConfig == other.tieredConfig && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is TieredPrice && 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 && tieredConfig == other.tieredConfig && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && 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, tieredConfig, 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, tieredConfig, dimensionalPriceConfiguration, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "TieredPrice{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, tieredConfig=$tieredConfig, additionalProperties=$additionalProperties}" + "TieredPrice{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, tieredConfig=$tieredConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, additionalProperties=$additionalProperties}" } @NoAutoDetect @@ -9249,6 +10869,10 @@ private constructor( @JsonProperty("tiered_bps_config") @ExcludeMissing private val tieredBpsConfig: JsonField = JsonMissing.of(), + @JsonProperty("dimensional_price_configuration") + @ExcludeMissing + private val dimensionalPriceConfiguration: JsonField = + JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { @@ -9316,6 +10940,11 @@ private constructor( fun tieredBpsConfig(): TieredBpsConfig = tieredBpsConfig.getRequired("tiered_bps_config") + fun dimensionalPriceConfiguration(): Optional = + Optional.ofNullable( + dimensionalPriceConfiguration.getNullable("dimensional_price_configuration") + ) + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id @JsonProperty("billable_metric") @@ -9397,6 +11026,11 @@ private constructor( @ExcludeMissing fun _tieredBpsConfig(): JsonField = tieredBpsConfig + @JsonProperty("dimensional_price_configuration") + @ExcludeMissing + fun _dimensionalPriceConfiguration(): JsonField = + dimensionalPriceConfiguration + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -9431,6 +11065,7 @@ private constructor( planPhaseOrder() priceType() tieredBpsConfig().validate() + dimensionalPriceConfiguration().ifPresent { it.validate() } validated = true } @@ -9441,7 +11076,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TieredBpsPrice]. */ + class Builder internal constructor() { private var id: JsonField? = null private var billableMetric: JsonField? = null @@ -9466,6 +11102,8 @@ private constructor( private var planPhaseOrder: JsonField? = null private var priceType: JsonField? = null private var tieredBpsConfig: JsonField? = null + private var dimensionalPriceConfiguration: JsonField = + JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -9493,6 +11131,7 @@ private constructor( planPhaseOrder = tieredBpsPrice.planPhaseOrder priceType = tieredBpsPrice.priceType tieredBpsConfig = tieredBpsPrice.tieredBpsConfig + dimensionalPriceConfiguration = tieredBpsPrice.dimensionalPriceConfiguration additionalProperties = tieredBpsPrice.additionalProperties.toMutableMap() } @@ -9565,6 +11204,14 @@ private constructor( fun discount(trial: TrialDiscount) = discount(Discount.ofTrial(trial)) + fun trialDiscount(appliesToPriceIds: List) = + discount( + TrialDiscount.builder() + .discountType(TrialDiscount.DiscountType.TRIAL) + .appliesToPriceIds(appliesToPriceIds) + .build() + ) + fun discount(usage: Discount.UsageDiscount) = discount(Discount.ofUsage(usage)) fun discount(amount: AmountDiscount) = discount(Discount.ofAmount(amount)) @@ -9687,6 +11334,18 @@ private constructor( this.tieredBpsConfig = tieredBpsConfig } + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: DimensionalPriceConfiguration? + ) = dimensionalPriceConfiguration(JsonField.ofNullable(dimensionalPriceConfiguration)) + + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: Optional + ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.orElse(null)) + + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: JsonField + ) = apply { this.dimensionalPriceConfiguration = dimensionalPriceConfiguration } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -9731,6 +11390,7 @@ private constructor( checkRequired("planPhaseOrder", planPhaseOrder), checkRequired("priceType", priceType), checkRequired("tieredBpsConfig", tieredBpsConfig), + dimensionalPriceConfiguration, additionalProperties.toImmutable(), ) } @@ -9772,7 +11432,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillableMetric]. */ + class Builder internal constructor() { private var id: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -9878,7 +11539,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -9939,6 +11601,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -9950,17 +11620,39 @@ private constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -9968,6 +11660,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -10014,6 +11715,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -10033,6 +11742,7 @@ private constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ONE_TIME, MONTHLY, @@ -10042,6 +11752,15 @@ private constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ONE_TIME, MONTHLY, @@ -10049,9 +11768,19 @@ private constructor( SEMI_ANNUAL, ANNUAL, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { ONE_TIME -> Value.ONE_TIME @@ -10063,6 +11792,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ONE_TIME -> Known.ONE_TIME @@ -10136,7 +11874,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CreditAllocation]. */ + class Builder internal constructor() { private var allowsRollover: JsonField? = null private var currency: JsonField? = null @@ -10255,7 +11994,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -10317,6 +12057,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -10328,17 +12076,39 @@ private constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -10346,6 +12116,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -10431,7 +12210,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Item]. */ + class Builder internal constructor() { private var id: JsonField? = null private var name: JsonField? = null @@ -10560,7 +12340,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Maximum]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var maximumAmount: JsonField? = null @@ -10698,7 +12479,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -10809,7 +12591,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Minimum]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var minimumAmount: JsonField? = null @@ -10919,6 +12702,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -10928,21 +12719,51 @@ private constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { TIERED_BPS, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { TIERED_BPS, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { TIERED_BPS -> Value.TIERED_BPS else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { TIERED_BPS -> Known.TIERED_BPS @@ -10970,6 +12791,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -10981,17 +12810,38 @@ private constructor( @JvmStatic fun of(value: String) = PriceType(JsonField.of(value)) } + /** An enum containing [PriceType]'s known values. */ enum class Known { USAGE_PRICE, FIXED_PRICE, } + /** + * An enum containing [PriceType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [PriceType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { USAGE_PRICE, FIXED_PRICE, + /** + * An enum member indicating that [PriceType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { USAGE_PRICE -> Value.USAGE_PRICE @@ -10999,6 +12849,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { USAGE_PRICE -> Known.USAGE_PRICE @@ -11064,7 +12923,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TieredBpsConfig]. */ + class Builder internal constructor() { private var tiers: JsonField>? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -11212,7 +13072,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Tier]. */ + class Builder internal constructor() { private var bps: JsonField? = null private var minimumAmount: JsonField? = null @@ -11338,22 +13199,165 @@ private constructor( "TieredBpsConfig{tiers=$tiers, additionalProperties=$additionalProperties}" } + @NoAutoDetect + class DimensionalPriceConfiguration + @JsonCreator + private constructor( + @JsonProperty("dimension_values") + @ExcludeMissing + private val dimensionValues: JsonField> = JsonMissing.of(), + @JsonProperty("dimensional_price_group_id") + @ExcludeMissing + private val dimensionalPriceGroupId: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { + + fun dimensionValues(): List = dimensionValues.getRequired("dimension_values") + + fun dimensionalPriceGroupId(): String = + dimensionalPriceGroupId.getRequired("dimensional_price_group_id") + + @JsonProperty("dimension_values") + @ExcludeMissing + fun _dimensionValues(): JsonField> = dimensionValues + + @JsonProperty("dimensional_price_group_id") + @ExcludeMissing + fun _dimensionalPriceGroupId(): JsonField = dimensionalPriceGroupId + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): DimensionalPriceConfiguration = apply { + if (validated) { + return@apply + } + + dimensionValues() + dimensionalPriceGroupId() + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + /** A builder for [DimensionalPriceConfiguration]. */ + class Builder internal constructor() { + + private var dimensionValues: JsonField>? = null + private var dimensionalPriceGroupId: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(dimensionalPriceConfiguration: DimensionalPriceConfiguration) = + apply { + dimensionValues = + dimensionalPriceConfiguration.dimensionValues.map { it.toMutableList() } + dimensionalPriceGroupId = + dimensionalPriceConfiguration.dimensionalPriceGroupId + additionalProperties = + dimensionalPriceConfiguration.additionalProperties.toMutableMap() + } + + fun dimensionValues(dimensionValues: List) = + dimensionValues(JsonField.of(dimensionValues)) + + fun dimensionValues(dimensionValues: JsonField>) = apply { + this.dimensionValues = dimensionValues.map { it.toMutableList() } + } + + fun addDimensionValue(dimensionValue: String) = apply { + dimensionValues = + (dimensionValues ?: JsonField.of(mutableListOf())).apply { + asKnown() + .orElseThrow { + IllegalStateException( + "Field was set to non-list type: ${javaClass.simpleName}" + ) + } + .add(dimensionValue) + } + } + + fun dimensionalPriceGroupId(dimensionalPriceGroupId: String) = + dimensionalPriceGroupId(JsonField.of(dimensionalPriceGroupId)) + + fun dimensionalPriceGroupId(dimensionalPriceGroupId: JsonField) = apply { + this.dimensionalPriceGroupId = dimensionalPriceGroupId + } + + 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(): DimensionalPriceConfiguration = + DimensionalPriceConfiguration( + checkRequired("dimensionValues", dimensionValues).map { it.toImmutable() }, + checkRequired("dimensionalPriceGroupId", dimensionalPriceGroupId), + additionalProperties.toImmutable(), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is DimensionalPriceConfiguration && dimensionValues == other.dimensionValues && dimensionalPriceGroupId == other.dimensionalPriceGroupId && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(dimensionValues, dimensionalPriceGroupId, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "DimensionalPriceConfiguration{dimensionValues=$dimensionValues, dimensionalPriceGroupId=$dimensionalPriceGroupId, additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true } - return /* spotless:off */ other is TieredBpsPrice && 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 && tieredBpsConfig == other.tieredBpsConfig && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is TieredBpsPrice && 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 && tieredBpsConfig == other.tieredBpsConfig && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && 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, tieredBpsConfig, 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, tieredBpsConfig, dimensionalPriceConfiguration, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "TieredBpsPrice{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, tieredBpsConfig=$tieredBpsConfig, additionalProperties=$additionalProperties}" + "TieredBpsPrice{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, tieredBpsConfig=$tieredBpsConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, additionalProperties=$additionalProperties}" } @NoAutoDetect @@ -11427,6 +13431,10 @@ private constructor( @JsonProperty("price_type") @ExcludeMissing private val priceType: JsonField = JsonMissing.of(), + @JsonProperty("dimensional_price_configuration") + @ExcludeMissing + private val dimensionalPriceConfiguration: JsonField = + JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { @@ -11494,6 +13502,11 @@ private constructor( fun priceType(): PriceType = priceType.getRequired("price_type") + fun dimensionalPriceConfiguration(): Optional = + Optional.ofNullable( + dimensionalPriceConfiguration.getNullable("dimensional_price_configuration") + ) + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id @JsonProperty("billable_metric") @@ -11575,6 +13588,11 @@ private constructor( @ExcludeMissing fun _priceType(): JsonField = priceType + @JsonProperty("dimensional_price_configuration") + @ExcludeMissing + fun _dimensionalPriceConfiguration(): JsonField = + dimensionalPriceConfiguration + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -11609,6 +13627,7 @@ private constructor( name() planPhaseOrder() priceType() + dimensionalPriceConfiguration().ifPresent { it.validate() } validated = true } @@ -11619,7 +13638,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BpsPrice]. */ + class Builder internal constructor() { private var id: JsonField? = null private var billableMetric: JsonField? = null @@ -11644,6 +13664,8 @@ private constructor( private var name: JsonField? = null private var planPhaseOrder: JsonField? = null private var priceType: JsonField? = null + private var dimensionalPriceConfiguration: JsonField = + JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -11671,6 +13693,7 @@ private constructor( name = bpsPrice.name planPhaseOrder = bpsPrice.planPhaseOrder priceType = bpsPrice.priceType + dimensionalPriceConfiguration = bpsPrice.dimensionalPriceConfiguration additionalProperties = bpsPrice.additionalProperties.toMutableMap() } @@ -11747,6 +13770,14 @@ private constructor( fun discount(trial: TrialDiscount) = discount(Discount.ofTrial(trial)) + fun trialDiscount(appliesToPriceIds: List) = + discount( + TrialDiscount.builder() + .discountType(TrialDiscount.DiscountType.TRIAL) + .appliesToPriceIds(appliesToPriceIds) + .build() + ) + fun discount(usage: Discount.UsageDiscount) = discount(Discount.ofUsage(usage)) fun discount(amount: AmountDiscount) = discount(Discount.ofAmount(amount)) @@ -11862,6 +13893,18 @@ private constructor( fun priceType(priceType: JsonField) = apply { this.priceType = priceType } + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: DimensionalPriceConfiguration? + ) = dimensionalPriceConfiguration(JsonField.ofNullable(dimensionalPriceConfiguration)) + + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: Optional + ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.orElse(null)) + + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: JsonField + ) = apply { this.dimensionalPriceConfiguration = dimensionalPriceConfiguration } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -11906,6 +13949,7 @@ private constructor( checkRequired("name", name), checkRequired("planPhaseOrder", planPhaseOrder), checkRequired("priceType", priceType), + dimensionalPriceConfiguration, additionalProperties.toImmutable(), ) } @@ -11947,7 +13991,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillableMetric]. */ + class Builder internal constructor() { private var id: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -12053,7 +14098,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -12114,6 +14160,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -12125,17 +14179,39 @@ private constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -12143,6 +14219,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -12235,7 +14320,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BpsConfig]. */ + class Builder internal constructor() { private var bps: JsonField? = null private var perUnitMaximum: JsonField = JsonMissing.of() @@ -12321,6 +14407,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -12340,6 +14434,7 @@ private constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ONE_TIME, MONTHLY, @@ -12349,6 +14444,15 @@ private constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ONE_TIME, MONTHLY, @@ -12356,9 +14460,19 @@ private constructor( SEMI_ANNUAL, ANNUAL, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { ONE_TIME -> Value.ONE_TIME @@ -12370,6 +14484,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ONE_TIME -> Known.ONE_TIME @@ -12443,7 +14566,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CreditAllocation]. */ + class Builder internal constructor() { private var allowsRollover: JsonField? = null private var currency: JsonField? = null @@ -12562,7 +14686,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -12624,6 +14749,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -12635,17 +14768,39 @@ private constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -12653,6 +14808,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -12738,7 +14902,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Item]. */ + class Builder internal constructor() { private var id: JsonField? = null private var name: JsonField? = null @@ -12867,7 +15032,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Maximum]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var maximumAmount: JsonField? = null @@ -13005,7 +15171,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -13116,7 +15283,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Minimum]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var minimumAmount: JsonField? = null @@ -13226,6 +15394,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -13235,21 +15411,51 @@ private constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { BPS, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { BPS, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { BPS -> Value.BPS else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { BPS -> Known.BPS @@ -13277,6 +15483,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -13288,17 +15502,38 @@ private constructor( @JvmStatic fun of(value: String) = PriceType(JsonField.of(value)) } + /** An enum containing [PriceType]'s known values. */ enum class Known { USAGE_PRICE, FIXED_PRICE, } + /** + * An enum containing [PriceType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [PriceType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { USAGE_PRICE, FIXED_PRICE, + /** + * An enum member indicating that [PriceType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { USAGE_PRICE -> Value.USAGE_PRICE @@ -13306,6 +15541,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { USAGE_PRICE -> Known.USAGE_PRICE @@ -13328,22 +15572,165 @@ private constructor( override fun toString() = value.toString() } + @NoAutoDetect + class DimensionalPriceConfiguration + @JsonCreator + private constructor( + @JsonProperty("dimension_values") + @ExcludeMissing + private val dimensionValues: JsonField> = JsonMissing.of(), + @JsonProperty("dimensional_price_group_id") + @ExcludeMissing + private val dimensionalPriceGroupId: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { + + fun dimensionValues(): List = dimensionValues.getRequired("dimension_values") + + fun dimensionalPriceGroupId(): String = + dimensionalPriceGroupId.getRequired("dimensional_price_group_id") + + @JsonProperty("dimension_values") + @ExcludeMissing + fun _dimensionValues(): JsonField> = dimensionValues + + @JsonProperty("dimensional_price_group_id") + @ExcludeMissing + fun _dimensionalPriceGroupId(): JsonField = dimensionalPriceGroupId + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): DimensionalPriceConfiguration = apply { + if (validated) { + return@apply + } + + dimensionValues() + dimensionalPriceGroupId() + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + /** A builder for [DimensionalPriceConfiguration]. */ + class Builder internal constructor() { + + private var dimensionValues: JsonField>? = null + private var dimensionalPriceGroupId: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(dimensionalPriceConfiguration: DimensionalPriceConfiguration) = + apply { + dimensionValues = + dimensionalPriceConfiguration.dimensionValues.map { it.toMutableList() } + dimensionalPriceGroupId = + dimensionalPriceConfiguration.dimensionalPriceGroupId + additionalProperties = + dimensionalPriceConfiguration.additionalProperties.toMutableMap() + } + + fun dimensionValues(dimensionValues: List) = + dimensionValues(JsonField.of(dimensionValues)) + + fun dimensionValues(dimensionValues: JsonField>) = apply { + this.dimensionValues = dimensionValues.map { it.toMutableList() } + } + + fun addDimensionValue(dimensionValue: String) = apply { + dimensionValues = + (dimensionValues ?: JsonField.of(mutableListOf())).apply { + asKnown() + .orElseThrow { + IllegalStateException( + "Field was set to non-list type: ${javaClass.simpleName}" + ) + } + .add(dimensionValue) + } + } + + fun dimensionalPriceGroupId(dimensionalPriceGroupId: String) = + dimensionalPriceGroupId(JsonField.of(dimensionalPriceGroupId)) + + fun dimensionalPriceGroupId(dimensionalPriceGroupId: JsonField) = apply { + this.dimensionalPriceGroupId = dimensionalPriceGroupId + } + + 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(): DimensionalPriceConfiguration = + DimensionalPriceConfiguration( + checkRequired("dimensionValues", dimensionValues).map { it.toImmutable() }, + checkRequired("dimensionalPriceGroupId", dimensionalPriceGroupId), + additionalProperties.toImmutable(), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is DimensionalPriceConfiguration && dimensionValues == other.dimensionValues && dimensionalPriceGroupId == other.dimensionalPriceGroupId && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(dimensionValues, dimensionalPriceGroupId, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "DimensionalPriceConfiguration{dimensionValues=$dimensionValues, dimensionalPriceGroupId=$dimensionalPriceGroupId, additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true } - return /* spotless:off */ other is BpsPrice && id == other.id && billableMetric == other.billableMetric && billingCycleConfiguration == other.billingCycleConfiguration && bpsConfig == other.bpsConfig && 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 BpsPrice && id == other.id && billableMetric == other.billableMetric && billingCycleConfiguration == other.billingCycleConfiguration && bpsConfig == other.bpsConfig && 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 && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, billableMetric, billingCycleConfiguration, bpsConfig, 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, bpsConfig, cadence, conversionRate, createdAt, creditAllocation, currency, discount, externalPriceId, fixedPriceQuantity, invoicingCycleConfiguration, item, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, dimensionalPriceConfiguration, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "BpsPrice{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, bpsConfig=$bpsConfig, 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}" + "BpsPrice{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, bpsConfig=$bpsConfig, 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, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, additionalProperties=$additionalProperties}" } @NoAutoDetect @@ -13417,6 +15804,10 @@ private constructor( @JsonProperty("price_type") @ExcludeMissing private val priceType: JsonField = JsonMissing.of(), + @JsonProperty("dimensional_price_configuration") + @ExcludeMissing + private val dimensionalPriceConfiguration: JsonField = + JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { @@ -13484,6 +15875,11 @@ private constructor( fun priceType(): PriceType = priceType.getRequired("price_type") + fun dimensionalPriceConfiguration(): Optional = + Optional.ofNullable( + dimensionalPriceConfiguration.getNullable("dimensional_price_configuration") + ) + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id @JsonProperty("billable_metric") @@ -13565,6 +15961,11 @@ private constructor( @ExcludeMissing fun _priceType(): JsonField = priceType + @JsonProperty("dimensional_price_configuration") + @ExcludeMissing + fun _dimensionalPriceConfiguration(): JsonField = + dimensionalPriceConfiguration + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -13599,6 +16000,7 @@ private constructor( name() planPhaseOrder() priceType() + dimensionalPriceConfiguration().ifPresent { it.validate() } validated = true } @@ -13609,7 +16011,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BulkBpsPrice]. */ + class Builder internal constructor() { private var id: JsonField? = null private var billableMetric: JsonField? = null @@ -13634,6 +16037,8 @@ private constructor( private var name: JsonField? = null private var planPhaseOrder: JsonField? = null private var priceType: JsonField? = null + private var dimensionalPriceConfiguration: JsonField = + JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -13661,6 +16066,7 @@ private constructor( name = bulkBpsPrice.name planPhaseOrder = bulkBpsPrice.planPhaseOrder priceType = bulkBpsPrice.priceType + dimensionalPriceConfiguration = bulkBpsPrice.dimensionalPriceConfiguration additionalProperties = bulkBpsPrice.additionalProperties.toMutableMap() } @@ -13740,6 +16146,14 @@ private constructor( fun discount(trial: TrialDiscount) = discount(Discount.ofTrial(trial)) + fun trialDiscount(appliesToPriceIds: List) = + discount( + TrialDiscount.builder() + .discountType(TrialDiscount.DiscountType.TRIAL) + .appliesToPriceIds(appliesToPriceIds) + .build() + ) + fun discount(usage: Discount.UsageDiscount) = discount(Discount.ofUsage(usage)) fun discount(amount: AmountDiscount) = discount(Discount.ofAmount(amount)) @@ -13855,6 +16269,18 @@ private constructor( fun priceType(priceType: JsonField) = apply { this.priceType = priceType } + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: DimensionalPriceConfiguration? + ) = dimensionalPriceConfiguration(JsonField.ofNullable(dimensionalPriceConfiguration)) + + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: Optional + ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.orElse(null)) + + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: JsonField + ) = apply { this.dimensionalPriceConfiguration = dimensionalPriceConfiguration } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -13899,6 +16325,7 @@ private constructor( checkRequired("name", name), checkRequired("planPhaseOrder", planPhaseOrder), checkRequired("priceType", priceType), + dimensionalPriceConfiguration, additionalProperties.toImmutable(), ) } @@ -13940,7 +16367,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillableMetric]. */ + class Builder internal constructor() { private var id: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -14046,7 +16474,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -14107,6 +16536,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -14118,17 +16555,39 @@ private constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -14136,6 +16595,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -14221,7 +16689,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BulkBpsConfig]. */ + class Builder internal constructor() { private var tiers: JsonField>? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -14357,7 +16826,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Tier]. */ + class Builder internal constructor() { private var bps: JsonField? = null private var maximumAmount: JsonField = JsonMissing.of() @@ -14477,6 +16947,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -14496,6 +16974,7 @@ private constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ONE_TIME, MONTHLY, @@ -14505,6 +16984,15 @@ private constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ONE_TIME, MONTHLY, @@ -14512,9 +17000,19 @@ private constructor( SEMI_ANNUAL, ANNUAL, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { ONE_TIME -> Value.ONE_TIME @@ -14526,6 +17024,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ONE_TIME -> Known.ONE_TIME @@ -14599,7 +17106,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CreditAllocation]. */ + class Builder internal constructor() { private var allowsRollover: JsonField? = null private var currency: JsonField? = null @@ -14718,7 +17226,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -14780,6 +17289,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -14791,17 +17308,39 @@ private constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -14809,6 +17348,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -14894,7 +17442,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Item]. */ + class Builder internal constructor() { private var id: JsonField? = null private var name: JsonField? = null @@ -15023,7 +17572,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Maximum]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var maximumAmount: JsonField? = null @@ -15161,7 +17711,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -15272,7 +17823,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Minimum]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var minimumAmount: JsonField? = null @@ -15382,6 +17934,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -15391,21 +17951,51 @@ private constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { BULK_BPS, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { BULK_BPS, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { BULK_BPS -> Value.BULK_BPS else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { BULK_BPS -> Known.BULK_BPS @@ -15433,6 +18023,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -15444,17 +18042,38 @@ private constructor( @JvmStatic fun of(value: String) = PriceType(JsonField.of(value)) } + /** An enum containing [PriceType]'s known values. */ enum class Known { USAGE_PRICE, FIXED_PRICE, } + /** + * An enum containing [PriceType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [PriceType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { USAGE_PRICE, FIXED_PRICE, + /** + * An enum member indicating that [PriceType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { USAGE_PRICE -> Value.USAGE_PRICE @@ -15462,6 +18081,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { USAGE_PRICE -> Known.USAGE_PRICE @@ -15484,22 +18112,165 @@ private constructor( override fun toString() = value.toString() } + @NoAutoDetect + class DimensionalPriceConfiguration + @JsonCreator + private constructor( + @JsonProperty("dimension_values") + @ExcludeMissing + private val dimensionValues: JsonField> = JsonMissing.of(), + @JsonProperty("dimensional_price_group_id") + @ExcludeMissing + private val dimensionalPriceGroupId: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { + + fun dimensionValues(): List = dimensionValues.getRequired("dimension_values") + + fun dimensionalPriceGroupId(): String = + dimensionalPriceGroupId.getRequired("dimensional_price_group_id") + + @JsonProperty("dimension_values") + @ExcludeMissing + fun _dimensionValues(): JsonField> = dimensionValues + + @JsonProperty("dimensional_price_group_id") + @ExcludeMissing + fun _dimensionalPriceGroupId(): JsonField = dimensionalPriceGroupId + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): DimensionalPriceConfiguration = apply { + if (validated) { + return@apply + } + + dimensionValues() + dimensionalPriceGroupId() + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + /** A builder for [DimensionalPriceConfiguration]. */ + class Builder internal constructor() { + + private var dimensionValues: JsonField>? = null + private var dimensionalPriceGroupId: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(dimensionalPriceConfiguration: DimensionalPriceConfiguration) = + apply { + dimensionValues = + dimensionalPriceConfiguration.dimensionValues.map { it.toMutableList() } + dimensionalPriceGroupId = + dimensionalPriceConfiguration.dimensionalPriceGroupId + additionalProperties = + dimensionalPriceConfiguration.additionalProperties.toMutableMap() + } + + fun dimensionValues(dimensionValues: List) = + dimensionValues(JsonField.of(dimensionValues)) + + fun dimensionValues(dimensionValues: JsonField>) = apply { + this.dimensionValues = dimensionValues.map { it.toMutableList() } + } + + fun addDimensionValue(dimensionValue: String) = apply { + dimensionValues = + (dimensionValues ?: JsonField.of(mutableListOf())).apply { + asKnown() + .orElseThrow { + IllegalStateException( + "Field was set to non-list type: ${javaClass.simpleName}" + ) + } + .add(dimensionValue) + } + } + + fun dimensionalPriceGroupId(dimensionalPriceGroupId: String) = + dimensionalPriceGroupId(JsonField.of(dimensionalPriceGroupId)) + + fun dimensionalPriceGroupId(dimensionalPriceGroupId: JsonField) = apply { + this.dimensionalPriceGroupId = dimensionalPriceGroupId + } + + 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(): DimensionalPriceConfiguration = + DimensionalPriceConfiguration( + checkRequired("dimensionValues", dimensionValues).map { it.toImmutable() }, + checkRequired("dimensionalPriceGroupId", dimensionalPriceGroupId), + additionalProperties.toImmutable(), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is DimensionalPriceConfiguration && dimensionValues == other.dimensionValues && dimensionalPriceGroupId == other.dimensionalPriceGroupId && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(dimensionValues, dimensionalPriceGroupId, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "DimensionalPriceConfiguration{dimensionValues=$dimensionValues, dimensionalPriceGroupId=$dimensionalPriceGroupId, additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true } - return /* spotless:off */ other is BulkBpsPrice && id == other.id && billableMetric == other.billableMetric && billingCycleConfiguration == other.billingCycleConfiguration && bulkBpsConfig == other.bulkBpsConfig && 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 BulkBpsPrice && id == other.id && billableMetric == other.billableMetric && billingCycleConfiguration == other.billingCycleConfiguration && bulkBpsConfig == other.bulkBpsConfig && 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 && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, billableMetric, billingCycleConfiguration, bulkBpsConfig, 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, bulkBpsConfig, cadence, conversionRate, createdAt, creditAllocation, currency, discount, externalPriceId, fixedPriceQuantity, invoicingCycleConfiguration, item, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, dimensionalPriceConfiguration, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "BulkBpsPrice{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, bulkBpsConfig=$bulkBpsConfig, 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}" + "BulkBpsPrice{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, bulkBpsConfig=$bulkBpsConfig, 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, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, additionalProperties=$additionalProperties}" } @NoAutoDetect @@ -15573,6 +18344,10 @@ private constructor( @JsonProperty("price_type") @ExcludeMissing private val priceType: JsonField = JsonMissing.of(), + @JsonProperty("dimensional_price_configuration") + @ExcludeMissing + private val dimensionalPriceConfiguration: JsonField = + JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { @@ -15640,6 +18415,11 @@ private constructor( fun priceType(): PriceType = priceType.getRequired("price_type") + fun dimensionalPriceConfiguration(): Optional = + Optional.ofNullable( + dimensionalPriceConfiguration.getNullable("dimensional_price_configuration") + ) + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id @JsonProperty("billable_metric") @@ -15721,6 +18501,11 @@ private constructor( @ExcludeMissing fun _priceType(): JsonField = priceType + @JsonProperty("dimensional_price_configuration") + @ExcludeMissing + fun _dimensionalPriceConfiguration(): JsonField = + dimensionalPriceConfiguration + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -15755,6 +18540,7 @@ private constructor( name() planPhaseOrder() priceType() + dimensionalPriceConfiguration().ifPresent { it.validate() } validated = true } @@ -15765,7 +18551,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BulkPrice]. */ + class Builder internal constructor() { private var id: JsonField? = null private var billableMetric: JsonField? = null @@ -15790,6 +18577,8 @@ private constructor( private var name: JsonField? = null private var planPhaseOrder: JsonField? = null private var priceType: JsonField? = null + private var dimensionalPriceConfiguration: JsonField = + JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -15817,6 +18606,7 @@ private constructor( name = bulkPrice.name planPhaseOrder = bulkPrice.planPhaseOrder priceType = bulkPrice.priceType + dimensionalPriceConfiguration = bulkPrice.dimensionalPriceConfiguration additionalProperties = bulkPrice.additionalProperties.toMutableMap() } @@ -15895,6 +18685,14 @@ private constructor( fun discount(trial: TrialDiscount) = discount(Discount.ofTrial(trial)) + fun trialDiscount(appliesToPriceIds: List) = + discount( + TrialDiscount.builder() + .discountType(TrialDiscount.DiscountType.TRIAL) + .appliesToPriceIds(appliesToPriceIds) + .build() + ) + fun discount(usage: Discount.UsageDiscount) = discount(Discount.ofUsage(usage)) fun discount(amount: AmountDiscount) = discount(Discount.ofAmount(amount)) @@ -16010,6 +18808,18 @@ private constructor( fun priceType(priceType: JsonField) = apply { this.priceType = priceType } + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: DimensionalPriceConfiguration? + ) = dimensionalPriceConfiguration(JsonField.ofNullable(dimensionalPriceConfiguration)) + + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: Optional + ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.orElse(null)) + + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: JsonField + ) = apply { this.dimensionalPriceConfiguration = dimensionalPriceConfiguration } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -16054,6 +18864,7 @@ private constructor( checkRequired("name", name), checkRequired("planPhaseOrder", planPhaseOrder), checkRequired("priceType", priceType), + dimensionalPriceConfiguration, additionalProperties.toImmutable(), ) } @@ -16095,7 +18906,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillableMetric]. */ + class Builder internal constructor() { private var id: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -16201,7 +19013,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -16262,6 +19075,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -16273,17 +19094,39 @@ private constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -16291,6 +19134,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -16370,7 +19222,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BulkConfig]. */ + class Builder internal constructor() { private var tiers: JsonField>? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -16486,7 +19339,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Tier]. */ + class Builder internal constructor() { private var unitAmount: JsonField? = null private var maximumUnits: JsonField = JsonMissing.of() @@ -16596,6 +19450,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -16615,6 +19477,7 @@ private constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ONE_TIME, MONTHLY, @@ -16624,6 +19487,15 @@ private constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ONE_TIME, MONTHLY, @@ -16631,9 +19503,19 @@ private constructor( SEMI_ANNUAL, ANNUAL, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { ONE_TIME -> Value.ONE_TIME @@ -16645,6 +19527,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ONE_TIME -> Known.ONE_TIME @@ -16718,7 +19609,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CreditAllocation]. */ + class Builder internal constructor() { private var allowsRollover: JsonField? = null private var currency: JsonField? = null @@ -16837,7 +19729,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -16899,6 +19792,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -16910,17 +19811,39 @@ private constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -16928,6 +19851,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -17013,7 +19945,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Item]. */ + class Builder internal constructor() { private var id: JsonField? = null private var name: JsonField? = null @@ -17142,7 +20075,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Maximum]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var maximumAmount: JsonField? = null @@ -17280,7 +20214,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -17391,7 +20326,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Minimum]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var minimumAmount: JsonField? = null @@ -17501,6 +20437,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -17510,21 +20454,51 @@ private constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { BULK, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { BULK, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { BULK -> Value.BULK else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { BULK -> Known.BULK @@ -17552,6 +20526,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -17563,17 +20545,38 @@ private constructor( @JvmStatic fun of(value: String) = PriceType(JsonField.of(value)) } + /** An enum containing [PriceType]'s known values. */ enum class Known { USAGE_PRICE, FIXED_PRICE, } + /** + * An enum containing [PriceType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [PriceType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { USAGE_PRICE, FIXED_PRICE, + /** + * An enum member indicating that [PriceType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { USAGE_PRICE -> Value.USAGE_PRICE @@ -17581,6 +20584,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { USAGE_PRICE -> Known.USAGE_PRICE @@ -17603,22 +20615,165 @@ private constructor( override fun toString() = value.toString() } + @NoAutoDetect + class DimensionalPriceConfiguration + @JsonCreator + private constructor( + @JsonProperty("dimension_values") + @ExcludeMissing + private val dimensionValues: JsonField> = JsonMissing.of(), + @JsonProperty("dimensional_price_group_id") + @ExcludeMissing + private val dimensionalPriceGroupId: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { + + fun dimensionValues(): List = dimensionValues.getRequired("dimension_values") + + fun dimensionalPriceGroupId(): String = + dimensionalPriceGroupId.getRequired("dimensional_price_group_id") + + @JsonProperty("dimension_values") + @ExcludeMissing + fun _dimensionValues(): JsonField> = dimensionValues + + @JsonProperty("dimensional_price_group_id") + @ExcludeMissing + fun _dimensionalPriceGroupId(): JsonField = dimensionalPriceGroupId + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): DimensionalPriceConfiguration = apply { + if (validated) { + return@apply + } + + dimensionValues() + dimensionalPriceGroupId() + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + /** A builder for [DimensionalPriceConfiguration]. */ + class Builder internal constructor() { + + private var dimensionValues: JsonField>? = null + private var dimensionalPriceGroupId: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(dimensionalPriceConfiguration: DimensionalPriceConfiguration) = + apply { + dimensionValues = + dimensionalPriceConfiguration.dimensionValues.map { it.toMutableList() } + dimensionalPriceGroupId = + dimensionalPriceConfiguration.dimensionalPriceGroupId + additionalProperties = + dimensionalPriceConfiguration.additionalProperties.toMutableMap() + } + + fun dimensionValues(dimensionValues: List) = + dimensionValues(JsonField.of(dimensionValues)) + + fun dimensionValues(dimensionValues: JsonField>) = apply { + this.dimensionValues = dimensionValues.map { it.toMutableList() } + } + + fun addDimensionValue(dimensionValue: String) = apply { + dimensionValues = + (dimensionValues ?: JsonField.of(mutableListOf())).apply { + asKnown() + .orElseThrow { + IllegalStateException( + "Field was set to non-list type: ${javaClass.simpleName}" + ) + } + .add(dimensionValue) + } + } + + fun dimensionalPriceGroupId(dimensionalPriceGroupId: String) = + dimensionalPriceGroupId(JsonField.of(dimensionalPriceGroupId)) + + fun dimensionalPriceGroupId(dimensionalPriceGroupId: JsonField) = apply { + this.dimensionalPriceGroupId = dimensionalPriceGroupId + } + + 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(): DimensionalPriceConfiguration = + DimensionalPriceConfiguration( + checkRequired("dimensionValues", dimensionValues).map { it.toImmutable() }, + checkRequired("dimensionalPriceGroupId", dimensionalPriceGroupId), + additionalProperties.toImmutable(), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is DimensionalPriceConfiguration && dimensionValues == other.dimensionValues && dimensionalPriceGroupId == other.dimensionalPriceGroupId && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(dimensionValues, dimensionalPriceGroupId, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "DimensionalPriceConfiguration{dimensionValues=$dimensionValues, dimensionalPriceGroupId=$dimensionalPriceGroupId, additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true } - return /* spotless:off */ other is BulkPrice && id == other.id && billableMetric == other.billableMetric && billingCycleConfiguration == other.billingCycleConfiguration && bulkConfig == other.bulkConfig && 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 BulkPrice && id == other.id && billableMetric == other.billableMetric && billingCycleConfiguration == other.billingCycleConfiguration && bulkConfig == other.bulkConfig && 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 && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, billableMetric, billingCycleConfiguration, bulkConfig, 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, bulkConfig, cadence, conversionRate, createdAt, creditAllocation, currency, discount, externalPriceId, fixedPriceQuantity, invoicingCycleConfiguration, item, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, dimensionalPriceConfiguration, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "BulkPrice{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, bulkConfig=$bulkConfig, 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}" + "BulkPrice{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, bulkConfig=$bulkConfig, 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, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, additionalProperties=$additionalProperties}" } @NoAutoDetect @@ -17693,6 +20848,10 @@ private constructor( @ExcludeMissing private val thresholdTotalAmountConfig: JsonField = JsonMissing.of(), + @JsonProperty("dimensional_price_configuration") + @ExcludeMissing + private val dimensionalPriceConfiguration: JsonField = + JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { @@ -17761,6 +20920,11 @@ private constructor( fun thresholdTotalAmountConfig(): ThresholdTotalAmountConfig = thresholdTotalAmountConfig.getRequired("threshold_total_amount_config") + fun dimensionalPriceConfiguration(): Optional = + Optional.ofNullable( + dimensionalPriceConfiguration.getNullable("dimensional_price_configuration") + ) + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id @JsonProperty("billable_metric") @@ -17843,6 +21007,11 @@ private constructor( fun _thresholdTotalAmountConfig(): JsonField = thresholdTotalAmountConfig + @JsonProperty("dimensional_price_configuration") + @ExcludeMissing + fun _dimensionalPriceConfiguration(): JsonField = + dimensionalPriceConfiguration + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -17877,6 +21046,7 @@ private constructor( planPhaseOrder() priceType() thresholdTotalAmountConfig().validate() + dimensionalPriceConfiguration().ifPresent { it.validate() } validated = true } @@ -17887,7 +21057,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [ThresholdTotalAmountPrice]. */ + class Builder internal constructor() { private var id: JsonField? = null private var billableMetric: JsonField? = null @@ -17912,6 +21083,8 @@ private constructor( private var planPhaseOrder: JsonField? = null private var priceType: JsonField? = null private var thresholdTotalAmountConfig: JsonField? = null + private var dimensionalPriceConfiguration: JsonField = + JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -17939,6 +21112,8 @@ private constructor( planPhaseOrder = thresholdTotalAmountPrice.planPhaseOrder priceType = thresholdTotalAmountPrice.priceType thresholdTotalAmountConfig = thresholdTotalAmountPrice.thresholdTotalAmountConfig + dimensionalPriceConfiguration = + thresholdTotalAmountPrice.dimensionalPriceConfiguration additionalProperties = thresholdTotalAmountPrice.additionalProperties.toMutableMap() } @@ -18011,6 +21186,14 @@ private constructor( fun discount(trial: TrialDiscount) = discount(Discount.ofTrial(trial)) + fun trialDiscount(appliesToPriceIds: List) = + discount( + TrialDiscount.builder() + .discountType(TrialDiscount.DiscountType.TRIAL) + .appliesToPriceIds(appliesToPriceIds) + .build() + ) + fun discount(usage: Discount.UsageDiscount) = discount(Discount.ofUsage(usage)) fun discount(amount: AmountDiscount) = discount(Discount.ofAmount(amount)) @@ -18133,6 +21316,18 @@ private constructor( thresholdTotalAmountConfig: JsonField ) = apply { this.thresholdTotalAmountConfig = thresholdTotalAmountConfig } + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: DimensionalPriceConfiguration? + ) = dimensionalPriceConfiguration(JsonField.ofNullable(dimensionalPriceConfiguration)) + + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: Optional + ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.orElse(null)) + + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: JsonField + ) = apply { this.dimensionalPriceConfiguration = dimensionalPriceConfiguration } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -18177,6 +21372,7 @@ private constructor( checkRequired("planPhaseOrder", planPhaseOrder), checkRequired("priceType", priceType), checkRequired("thresholdTotalAmountConfig", thresholdTotalAmountConfig), + dimensionalPriceConfiguration, additionalProperties.toImmutable(), ) } @@ -18218,7 +21414,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillableMetric]. */ + class Builder internal constructor() { private var id: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -18324,7 +21521,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -18385,6 +21583,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -18396,17 +21602,39 @@ private constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -18414,6 +21642,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -18460,6 +21697,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -18479,6 +21724,7 @@ private constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ONE_TIME, MONTHLY, @@ -18488,6 +21734,15 @@ private constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ONE_TIME, MONTHLY, @@ -18495,9 +21750,19 @@ private constructor( SEMI_ANNUAL, ANNUAL, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { ONE_TIME -> Value.ONE_TIME @@ -18509,6 +21774,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ONE_TIME -> Known.ONE_TIME @@ -18582,7 +21856,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CreditAllocation]. */ + class Builder internal constructor() { private var allowsRollover: JsonField? = null private var currency: JsonField? = null @@ -18701,7 +21976,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -18763,6 +22039,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -18774,17 +22058,39 @@ private constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -18792,6 +22098,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -18877,7 +22192,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Item]. */ + class Builder internal constructor() { private var id: JsonField? = null private var name: JsonField? = null @@ -19006,7 +22322,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Maximum]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var maximumAmount: JsonField? = null @@ -19144,7 +22461,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -19255,7 +22573,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Minimum]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var minimumAmount: JsonField? = null @@ -19365,6 +22684,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -19374,21 +22701,51 @@ private constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { THRESHOLD_TOTAL_AMOUNT, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { THRESHOLD_TOTAL_AMOUNT, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { THRESHOLD_TOTAL_AMOUNT -> Value.THRESHOLD_TOTAL_AMOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { THRESHOLD_TOTAL_AMOUNT -> Known.THRESHOLD_TOTAL_AMOUNT @@ -19416,6 +22773,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -19427,17 +22792,38 @@ private constructor( @JvmStatic fun of(value: String) = PriceType(JsonField.of(value)) } + /** An enum containing [PriceType]'s known values. */ enum class Known { USAGE_PRICE, FIXED_PRICE, } + /** + * An enum containing [PriceType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [PriceType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { USAGE_PRICE, FIXED_PRICE, + /** + * An enum member indicating that [PriceType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { USAGE_PRICE -> Value.USAGE_PRICE @@ -19445,6 +22831,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { USAGE_PRICE -> Known.USAGE_PRICE @@ -19496,7 +22891,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [ThresholdTotalAmountConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -19550,22 +22946,165 @@ private constructor( "ThresholdTotalAmountConfig{additionalProperties=$additionalProperties}" } + @NoAutoDetect + class DimensionalPriceConfiguration + @JsonCreator + private constructor( + @JsonProperty("dimension_values") + @ExcludeMissing + private val dimensionValues: JsonField> = JsonMissing.of(), + @JsonProperty("dimensional_price_group_id") + @ExcludeMissing + private val dimensionalPriceGroupId: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { + + fun dimensionValues(): List = dimensionValues.getRequired("dimension_values") + + fun dimensionalPriceGroupId(): String = + dimensionalPriceGroupId.getRequired("dimensional_price_group_id") + + @JsonProperty("dimension_values") + @ExcludeMissing + fun _dimensionValues(): JsonField> = dimensionValues + + @JsonProperty("dimensional_price_group_id") + @ExcludeMissing + fun _dimensionalPriceGroupId(): JsonField = dimensionalPriceGroupId + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): DimensionalPriceConfiguration = apply { + if (validated) { + return@apply + } + + dimensionValues() + dimensionalPriceGroupId() + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + /** A builder for [DimensionalPriceConfiguration]. */ + class Builder internal constructor() { + + private var dimensionValues: JsonField>? = null + private var dimensionalPriceGroupId: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(dimensionalPriceConfiguration: DimensionalPriceConfiguration) = + apply { + dimensionValues = + dimensionalPriceConfiguration.dimensionValues.map { it.toMutableList() } + dimensionalPriceGroupId = + dimensionalPriceConfiguration.dimensionalPriceGroupId + additionalProperties = + dimensionalPriceConfiguration.additionalProperties.toMutableMap() + } + + fun dimensionValues(dimensionValues: List) = + dimensionValues(JsonField.of(dimensionValues)) + + fun dimensionValues(dimensionValues: JsonField>) = apply { + this.dimensionValues = dimensionValues.map { it.toMutableList() } + } + + fun addDimensionValue(dimensionValue: String) = apply { + dimensionValues = + (dimensionValues ?: JsonField.of(mutableListOf())).apply { + asKnown() + .orElseThrow { + IllegalStateException( + "Field was set to non-list type: ${javaClass.simpleName}" + ) + } + .add(dimensionValue) + } + } + + fun dimensionalPriceGroupId(dimensionalPriceGroupId: String) = + dimensionalPriceGroupId(JsonField.of(dimensionalPriceGroupId)) + + fun dimensionalPriceGroupId(dimensionalPriceGroupId: JsonField) = apply { + this.dimensionalPriceGroupId = dimensionalPriceGroupId + } + + 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(): DimensionalPriceConfiguration = + DimensionalPriceConfiguration( + checkRequired("dimensionValues", dimensionValues).map { it.toImmutable() }, + checkRequired("dimensionalPriceGroupId", dimensionalPriceGroupId), + additionalProperties.toImmutable(), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is DimensionalPriceConfiguration && dimensionValues == other.dimensionValues && dimensionalPriceGroupId == other.dimensionalPriceGroupId && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(dimensionValues, dimensionalPriceGroupId, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "DimensionalPriceConfiguration{dimensionValues=$dimensionValues, dimensionalPriceGroupId=$dimensionalPriceGroupId, additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true } - return /* spotless:off */ other is ThresholdTotalAmountPrice && 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 && thresholdTotalAmountConfig == other.thresholdTotalAmountConfig && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is ThresholdTotalAmountPrice && 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 && thresholdTotalAmountConfig == other.thresholdTotalAmountConfig && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && 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, thresholdTotalAmountConfig, 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, thresholdTotalAmountConfig, dimensionalPriceConfiguration, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "ThresholdTotalAmountPrice{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, thresholdTotalAmountConfig=$thresholdTotalAmountConfig, additionalProperties=$additionalProperties}" + "ThresholdTotalAmountPrice{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, thresholdTotalAmountConfig=$thresholdTotalAmountConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, additionalProperties=$additionalProperties}" } @NoAutoDetect @@ -19639,6 +23178,10 @@ private constructor( @JsonProperty("tiered_package_config") @ExcludeMissing private val tieredPackageConfig: JsonField = JsonMissing.of(), + @JsonProperty("dimensional_price_configuration") + @ExcludeMissing + private val dimensionalPriceConfiguration: JsonField = + JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { @@ -19707,6 +23250,11 @@ private constructor( fun tieredPackageConfig(): TieredPackageConfig = tieredPackageConfig.getRequired("tiered_package_config") + fun dimensionalPriceConfiguration(): Optional = + Optional.ofNullable( + dimensionalPriceConfiguration.getNullable("dimensional_price_configuration") + ) + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id @JsonProperty("billable_metric") @@ -19788,6 +23336,11 @@ private constructor( @ExcludeMissing fun _tieredPackageConfig(): JsonField = tieredPackageConfig + @JsonProperty("dimensional_price_configuration") + @ExcludeMissing + fun _dimensionalPriceConfiguration(): JsonField = + dimensionalPriceConfiguration + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -19822,6 +23375,7 @@ private constructor( planPhaseOrder() priceType() tieredPackageConfig().validate() + dimensionalPriceConfiguration().ifPresent { it.validate() } validated = true } @@ -19832,7 +23386,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TieredPackagePrice]. */ + class Builder internal constructor() { private var id: JsonField? = null private var billableMetric: JsonField? = null @@ -19857,6 +23412,8 @@ private constructor( private var planPhaseOrder: JsonField? = null private var priceType: JsonField? = null private var tieredPackageConfig: JsonField? = null + private var dimensionalPriceConfiguration: JsonField = + JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -19884,6 +23441,7 @@ private constructor( planPhaseOrder = tieredPackagePrice.planPhaseOrder priceType = tieredPackagePrice.priceType tieredPackageConfig = tieredPackagePrice.tieredPackageConfig + dimensionalPriceConfiguration = tieredPackagePrice.dimensionalPriceConfiguration additionalProperties = tieredPackagePrice.additionalProperties.toMutableMap() } @@ -19956,6 +23514,14 @@ private constructor( fun discount(trial: TrialDiscount) = discount(Discount.ofTrial(trial)) + fun trialDiscount(appliesToPriceIds: List) = + discount( + TrialDiscount.builder() + .discountType(TrialDiscount.DiscountType.TRIAL) + .appliesToPriceIds(appliesToPriceIds) + .build() + ) + fun discount(usage: Discount.UsageDiscount) = discount(Discount.ofUsage(usage)) fun discount(amount: AmountDiscount) = discount(Discount.ofAmount(amount)) @@ -20078,6 +23644,18 @@ private constructor( this.tieredPackageConfig = tieredPackageConfig } + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: DimensionalPriceConfiguration? + ) = dimensionalPriceConfiguration(JsonField.ofNullable(dimensionalPriceConfiguration)) + + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: Optional + ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.orElse(null)) + + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: JsonField + ) = apply { this.dimensionalPriceConfiguration = dimensionalPriceConfiguration } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -20122,6 +23700,7 @@ private constructor( checkRequired("planPhaseOrder", planPhaseOrder), checkRequired("priceType", priceType), checkRequired("tieredPackageConfig", tieredPackageConfig), + dimensionalPriceConfiguration, additionalProperties.toImmutable(), ) } @@ -20163,7 +23742,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillableMetric]. */ + class Builder internal constructor() { private var id: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -20269,7 +23849,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -20330,6 +23911,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -20341,17 +23930,39 @@ private constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -20359,6 +23970,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -20405,6 +24025,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -20424,6 +24052,7 @@ private constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ONE_TIME, MONTHLY, @@ -20433,6 +24062,15 @@ private constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ONE_TIME, MONTHLY, @@ -20440,9 +24078,19 @@ private constructor( SEMI_ANNUAL, ANNUAL, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { ONE_TIME -> Value.ONE_TIME @@ -20454,6 +24102,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ONE_TIME -> Known.ONE_TIME @@ -20527,7 +24184,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CreditAllocation]. */ + class Builder internal constructor() { private var allowsRollover: JsonField? = null private var currency: JsonField? = null @@ -20646,7 +24304,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -20708,6 +24367,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -20719,17 +24386,39 @@ private constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -20737,6 +24426,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -20822,7 +24520,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Item]. */ + class Builder internal constructor() { private var id: JsonField? = null private var name: JsonField? = null @@ -20951,7 +24650,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Maximum]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var maximumAmount: JsonField? = null @@ -21089,7 +24789,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -21200,7 +24901,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Minimum]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var minimumAmount: JsonField? = null @@ -21310,6 +25012,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -21319,21 +25029,51 @@ private constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { TIERED_PACKAGE, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { TIERED_PACKAGE, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { TIERED_PACKAGE -> Value.TIERED_PACKAGE else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { TIERED_PACKAGE -> Known.TIERED_PACKAGE @@ -21361,6 +25101,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -21372,17 +25120,38 @@ private constructor( @JvmStatic fun of(value: String) = PriceType(JsonField.of(value)) } + /** An enum containing [PriceType]'s known values. */ enum class Known { USAGE_PRICE, FIXED_PRICE, } + /** + * An enum containing [PriceType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [PriceType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { USAGE_PRICE, FIXED_PRICE, + /** + * An enum member indicating that [PriceType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { USAGE_PRICE -> Value.USAGE_PRICE @@ -21390,6 +25159,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { USAGE_PRICE -> Known.USAGE_PRICE @@ -21441,7 +25219,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TieredPackageConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -21494,22 +25273,165 @@ private constructor( "TieredPackageConfig{additionalProperties=$additionalProperties}" } + @NoAutoDetect + class DimensionalPriceConfiguration + @JsonCreator + private constructor( + @JsonProperty("dimension_values") + @ExcludeMissing + private val dimensionValues: JsonField> = JsonMissing.of(), + @JsonProperty("dimensional_price_group_id") + @ExcludeMissing + private val dimensionalPriceGroupId: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { + + fun dimensionValues(): List = dimensionValues.getRequired("dimension_values") + + fun dimensionalPriceGroupId(): String = + dimensionalPriceGroupId.getRequired("dimensional_price_group_id") + + @JsonProperty("dimension_values") + @ExcludeMissing + fun _dimensionValues(): JsonField> = dimensionValues + + @JsonProperty("dimensional_price_group_id") + @ExcludeMissing + fun _dimensionalPriceGroupId(): JsonField = dimensionalPriceGroupId + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): DimensionalPriceConfiguration = apply { + if (validated) { + return@apply + } + + dimensionValues() + dimensionalPriceGroupId() + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + /** A builder for [DimensionalPriceConfiguration]. */ + class Builder internal constructor() { + + private var dimensionValues: JsonField>? = null + private var dimensionalPriceGroupId: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(dimensionalPriceConfiguration: DimensionalPriceConfiguration) = + apply { + dimensionValues = + dimensionalPriceConfiguration.dimensionValues.map { it.toMutableList() } + dimensionalPriceGroupId = + dimensionalPriceConfiguration.dimensionalPriceGroupId + additionalProperties = + dimensionalPriceConfiguration.additionalProperties.toMutableMap() + } + + fun dimensionValues(dimensionValues: List) = + dimensionValues(JsonField.of(dimensionValues)) + + fun dimensionValues(dimensionValues: JsonField>) = apply { + this.dimensionValues = dimensionValues.map { it.toMutableList() } + } + + fun addDimensionValue(dimensionValue: String) = apply { + dimensionValues = + (dimensionValues ?: JsonField.of(mutableListOf())).apply { + asKnown() + .orElseThrow { + IllegalStateException( + "Field was set to non-list type: ${javaClass.simpleName}" + ) + } + .add(dimensionValue) + } + } + + fun dimensionalPriceGroupId(dimensionalPriceGroupId: String) = + dimensionalPriceGroupId(JsonField.of(dimensionalPriceGroupId)) + + fun dimensionalPriceGroupId(dimensionalPriceGroupId: JsonField) = apply { + this.dimensionalPriceGroupId = dimensionalPriceGroupId + } + + 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(): DimensionalPriceConfiguration = + DimensionalPriceConfiguration( + checkRequired("dimensionValues", dimensionValues).map { it.toImmutable() }, + checkRequired("dimensionalPriceGroupId", dimensionalPriceGroupId), + additionalProperties.toImmutable(), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is DimensionalPriceConfiguration && dimensionValues == other.dimensionValues && dimensionalPriceGroupId == other.dimensionalPriceGroupId && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(dimensionValues, dimensionalPriceGroupId, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "DimensionalPriceConfiguration{dimensionValues=$dimensionValues, dimensionalPriceGroupId=$dimensionalPriceGroupId, additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true } - return /* spotless:off */ other is TieredPackagePrice && 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 && tieredPackageConfig == other.tieredPackageConfig && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is TieredPackagePrice && 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 && tieredPackageConfig == other.tieredPackageConfig && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && 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, tieredPackageConfig, 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, tieredPackageConfig, dimensionalPriceConfiguration, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "TieredPackagePrice{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, tieredPackageConfig=$tieredPackageConfig, additionalProperties=$additionalProperties}" + "TieredPackagePrice{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, tieredPackageConfig=$tieredPackageConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, additionalProperties=$additionalProperties}" } @NoAutoDetect @@ -21583,6 +25505,10 @@ private constructor( @JsonProperty("price_type") @ExcludeMissing private val priceType: JsonField = JsonMissing.of(), + @JsonProperty("dimensional_price_configuration") + @ExcludeMissing + private val dimensionalPriceConfiguration: JsonField = + JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { @@ -21651,6 +25577,11 @@ private constructor( fun priceType(): PriceType = priceType.getRequired("price_type") + fun dimensionalPriceConfiguration(): Optional = + Optional.ofNullable( + dimensionalPriceConfiguration.getNullable("dimensional_price_configuration") + ) + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id @JsonProperty("billable_metric") @@ -21732,6 +25663,11 @@ private constructor( @ExcludeMissing fun _priceType(): JsonField = priceType + @JsonProperty("dimensional_price_configuration") + @ExcludeMissing + fun _dimensionalPriceConfiguration(): JsonField = + dimensionalPriceConfiguration + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -21766,6 +25702,7 @@ private constructor( name() planPhaseOrder() priceType() + dimensionalPriceConfiguration().ifPresent { it.validate() } validated = true } @@ -21776,7 +25713,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [GroupedTieredPrice]. */ + class Builder internal constructor() { private var id: JsonField? = null private var billableMetric: JsonField? = null @@ -21801,6 +25739,8 @@ private constructor( private var name: JsonField? = null private var planPhaseOrder: JsonField? = null private var priceType: JsonField? = null + private var dimensionalPriceConfiguration: JsonField = + JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -21828,6 +25768,7 @@ private constructor( name = groupedTieredPrice.name planPhaseOrder = groupedTieredPrice.planPhaseOrder priceType = groupedTieredPrice.priceType + dimensionalPriceConfiguration = groupedTieredPrice.dimensionalPriceConfiguration additionalProperties = groupedTieredPrice.additionalProperties.toMutableMap() } @@ -21900,6 +25841,14 @@ private constructor( fun discount(trial: TrialDiscount) = discount(Discount.ofTrial(trial)) + fun trialDiscount(appliesToPriceIds: List) = + discount( + TrialDiscount.builder() + .discountType(TrialDiscount.DiscountType.TRIAL) + .appliesToPriceIds(appliesToPriceIds) + .build() + ) + fun discount(usage: Discount.UsageDiscount) = discount(Discount.ofUsage(usage)) fun discount(amount: AmountDiscount) = discount(Discount.ofAmount(amount)) @@ -22022,6 +25971,18 @@ private constructor( fun priceType(priceType: JsonField) = apply { this.priceType = priceType } + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: DimensionalPriceConfiguration? + ) = dimensionalPriceConfiguration(JsonField.ofNullable(dimensionalPriceConfiguration)) + + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: Optional + ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.orElse(null)) + + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: JsonField + ) = apply { this.dimensionalPriceConfiguration = dimensionalPriceConfiguration } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -22066,6 +26027,7 @@ private constructor( checkRequired("name", name), checkRequired("planPhaseOrder", planPhaseOrder), checkRequired("priceType", priceType), + dimensionalPriceConfiguration, additionalProperties.toImmutable(), ) } @@ -22107,7 +26069,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillableMetric]. */ + class Builder internal constructor() { private var id: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -22213,7 +26176,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -22274,6 +26238,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -22285,17 +26257,39 @@ private constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -22303,6 +26297,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -22349,6 +26352,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -22368,6 +26379,7 @@ private constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ONE_TIME, MONTHLY, @@ -22377,6 +26389,15 @@ private constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ONE_TIME, MONTHLY, @@ -22384,9 +26405,19 @@ private constructor( SEMI_ANNUAL, ANNUAL, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { ONE_TIME -> Value.ONE_TIME @@ -22398,6 +26429,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ONE_TIME -> Known.ONE_TIME @@ -22471,7 +26511,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CreditAllocation]. */ + class Builder internal constructor() { private var allowsRollover: JsonField? = null private var currency: JsonField? = null @@ -22572,7 +26613,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [GroupedTieredConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -22672,7 +26714,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -22734,6 +26777,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -22745,17 +26796,39 @@ private constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -22763,6 +26836,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -22848,7 +26930,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Item]. */ + class Builder internal constructor() { private var id: JsonField? = null private var name: JsonField? = null @@ -22977,7 +27060,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Maximum]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var maximumAmount: JsonField? = null @@ -23115,7 +27199,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -23226,7 +27311,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Minimum]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var minimumAmount: JsonField? = null @@ -23336,6 +27422,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -23345,21 +27439,51 @@ private constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { GROUPED_TIERED, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { GROUPED_TIERED, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { GROUPED_TIERED -> Value.GROUPED_TIERED else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { GROUPED_TIERED -> Known.GROUPED_TIERED @@ -23387,6 +27511,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -23398,17 +27530,38 @@ private constructor( @JvmStatic fun of(value: String) = PriceType(JsonField.of(value)) } + /** An enum containing [PriceType]'s known values. */ enum class Known { USAGE_PRICE, FIXED_PRICE, } + /** + * An enum containing [PriceType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [PriceType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { USAGE_PRICE, FIXED_PRICE, + /** + * An enum member indicating that [PriceType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { USAGE_PRICE -> Value.USAGE_PRICE @@ -23416,6 +27569,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { USAGE_PRICE -> Known.USAGE_PRICE @@ -23438,22 +27600,165 @@ private constructor( override fun toString() = value.toString() } + @NoAutoDetect + class DimensionalPriceConfiguration + @JsonCreator + private constructor( + @JsonProperty("dimension_values") + @ExcludeMissing + private val dimensionValues: JsonField> = JsonMissing.of(), + @JsonProperty("dimensional_price_group_id") + @ExcludeMissing + private val dimensionalPriceGroupId: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { + + fun dimensionValues(): List = dimensionValues.getRequired("dimension_values") + + fun dimensionalPriceGroupId(): String = + dimensionalPriceGroupId.getRequired("dimensional_price_group_id") + + @JsonProperty("dimension_values") + @ExcludeMissing + fun _dimensionValues(): JsonField> = dimensionValues + + @JsonProperty("dimensional_price_group_id") + @ExcludeMissing + fun _dimensionalPriceGroupId(): JsonField = dimensionalPriceGroupId + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): DimensionalPriceConfiguration = apply { + if (validated) { + return@apply + } + + dimensionValues() + dimensionalPriceGroupId() + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + /** A builder for [DimensionalPriceConfiguration]. */ + class Builder internal constructor() { + + private var dimensionValues: JsonField>? = null + private var dimensionalPriceGroupId: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(dimensionalPriceConfiguration: DimensionalPriceConfiguration) = + apply { + dimensionValues = + dimensionalPriceConfiguration.dimensionValues.map { it.toMutableList() } + dimensionalPriceGroupId = + dimensionalPriceConfiguration.dimensionalPriceGroupId + additionalProperties = + dimensionalPriceConfiguration.additionalProperties.toMutableMap() + } + + fun dimensionValues(dimensionValues: List) = + dimensionValues(JsonField.of(dimensionValues)) + + fun dimensionValues(dimensionValues: JsonField>) = apply { + this.dimensionValues = dimensionValues.map { it.toMutableList() } + } + + fun addDimensionValue(dimensionValue: String) = apply { + dimensionValues = + (dimensionValues ?: JsonField.of(mutableListOf())).apply { + asKnown() + .orElseThrow { + IllegalStateException( + "Field was set to non-list type: ${javaClass.simpleName}" + ) + } + .add(dimensionValue) + } + } + + fun dimensionalPriceGroupId(dimensionalPriceGroupId: String) = + dimensionalPriceGroupId(JsonField.of(dimensionalPriceGroupId)) + + fun dimensionalPriceGroupId(dimensionalPriceGroupId: JsonField) = apply { + this.dimensionalPriceGroupId = dimensionalPriceGroupId + } + + 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(): DimensionalPriceConfiguration = + DimensionalPriceConfiguration( + checkRequired("dimensionValues", dimensionValues).map { it.toImmutable() }, + checkRequired("dimensionalPriceGroupId", dimensionalPriceGroupId), + additionalProperties.toImmutable(), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is DimensionalPriceConfiguration && dimensionValues == other.dimensionValues && dimensionalPriceGroupId == other.dimensionalPriceGroupId && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(dimensionValues, dimensionalPriceGroupId, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "DimensionalPriceConfiguration{dimensionValues=$dimensionValues, dimensionalPriceGroupId=$dimensionalPriceGroupId, additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true } - return /* spotless:off */ other is GroupedTieredPrice && 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 && groupedTieredConfig == other.groupedTieredConfig && 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 GroupedTieredPrice && 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 && groupedTieredConfig == other.groupedTieredConfig && 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 && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && 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, groupedTieredConfig, 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, groupedTieredConfig, invoicingCycleConfiguration, item, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, dimensionalPriceConfiguration, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "GroupedTieredPrice{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, cadence=$cadence, conversionRate=$conversionRate, createdAt=$createdAt, creditAllocation=$creditAllocation, currency=$currency, discount=$discount, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, groupedTieredConfig=$groupedTieredConfig, invoicingCycleConfiguration=$invoicingCycleConfiguration, item=$item, maximum=$maximum, maximumAmount=$maximumAmount, metadata=$metadata, minimum=$minimum, minimumAmount=$minimumAmount, modelType=$modelType, name=$name, planPhaseOrder=$planPhaseOrder, priceType=$priceType, additionalProperties=$additionalProperties}" + "GroupedTieredPrice{id=$id, billableMetric=$billableMetric, billingCycleConfiguration=$billingCycleConfiguration, cadence=$cadence, conversionRate=$conversionRate, createdAt=$createdAt, creditAllocation=$creditAllocation, currency=$currency, discount=$discount, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, groupedTieredConfig=$groupedTieredConfig, invoicingCycleConfiguration=$invoicingCycleConfiguration, item=$item, maximum=$maximum, maximumAmount=$maximumAmount, metadata=$metadata, minimum=$minimum, minimumAmount=$minimumAmount, modelType=$modelType, name=$name, planPhaseOrder=$planPhaseOrder, priceType=$priceType, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, additionalProperties=$additionalProperties}" } @NoAutoDetect @@ -23527,6 +27832,10 @@ private constructor( @JsonProperty("tiered_with_minimum_config") @ExcludeMissing private val tieredWithMinimumConfig: JsonField = JsonMissing.of(), + @JsonProperty("dimensional_price_configuration") + @ExcludeMissing + private val dimensionalPriceConfiguration: JsonField = + JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { @@ -23595,6 +27904,11 @@ private constructor( fun tieredWithMinimumConfig(): TieredWithMinimumConfig = tieredWithMinimumConfig.getRequired("tiered_with_minimum_config") + fun dimensionalPriceConfiguration(): Optional = + Optional.ofNullable( + dimensionalPriceConfiguration.getNullable("dimensional_price_configuration") + ) + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id @JsonProperty("billable_metric") @@ -23676,6 +27990,11 @@ private constructor( @ExcludeMissing fun _tieredWithMinimumConfig(): JsonField = tieredWithMinimumConfig + @JsonProperty("dimensional_price_configuration") + @ExcludeMissing + fun _dimensionalPriceConfiguration(): JsonField = + dimensionalPriceConfiguration + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -23710,6 +28029,7 @@ private constructor( planPhaseOrder() priceType() tieredWithMinimumConfig().validate() + dimensionalPriceConfiguration().ifPresent { it.validate() } validated = true } @@ -23720,7 +28040,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TieredWithMinimumPrice]. */ + class Builder internal constructor() { private var id: JsonField? = null private var billableMetric: JsonField? = null @@ -23745,6 +28066,8 @@ private constructor( private var planPhaseOrder: JsonField? = null private var priceType: JsonField? = null private var tieredWithMinimumConfig: JsonField? = null + private var dimensionalPriceConfiguration: JsonField = + JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -23772,6 +28095,7 @@ private constructor( planPhaseOrder = tieredWithMinimumPrice.planPhaseOrder priceType = tieredWithMinimumPrice.priceType tieredWithMinimumConfig = tieredWithMinimumPrice.tieredWithMinimumConfig + dimensionalPriceConfiguration = tieredWithMinimumPrice.dimensionalPriceConfiguration additionalProperties = tieredWithMinimumPrice.additionalProperties.toMutableMap() } @@ -23844,6 +28168,14 @@ private constructor( fun discount(trial: TrialDiscount) = discount(Discount.ofTrial(trial)) + fun trialDiscount(appliesToPriceIds: List) = + discount( + TrialDiscount.builder() + .discountType(TrialDiscount.DiscountType.TRIAL) + .appliesToPriceIds(appliesToPriceIds) + .build() + ) + fun discount(usage: Discount.UsageDiscount) = discount(Discount.ofUsage(usage)) fun discount(amount: AmountDiscount) = discount(Discount.ofAmount(amount)) @@ -23966,6 +28298,18 @@ private constructor( tieredWithMinimumConfig: JsonField ) = apply { this.tieredWithMinimumConfig = tieredWithMinimumConfig } + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: DimensionalPriceConfiguration? + ) = dimensionalPriceConfiguration(JsonField.ofNullable(dimensionalPriceConfiguration)) + + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: Optional + ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.orElse(null)) + + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: JsonField + ) = apply { this.dimensionalPriceConfiguration = dimensionalPriceConfiguration } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -24010,6 +28354,7 @@ private constructor( checkRequired("planPhaseOrder", planPhaseOrder), checkRequired("priceType", priceType), checkRequired("tieredWithMinimumConfig", tieredWithMinimumConfig), + dimensionalPriceConfiguration, additionalProperties.toImmutable(), ) } @@ -24051,7 +28396,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillableMetric]. */ + class Builder internal constructor() { private var id: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -24157,7 +28503,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -24218,6 +28565,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -24229,17 +28584,39 @@ private constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -24247,6 +28624,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -24293,6 +28679,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -24312,6 +28706,7 @@ private constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ONE_TIME, MONTHLY, @@ -24321,6 +28716,15 @@ private constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ONE_TIME, MONTHLY, @@ -24328,9 +28732,19 @@ private constructor( SEMI_ANNUAL, ANNUAL, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { ONE_TIME -> Value.ONE_TIME @@ -24342,6 +28756,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ONE_TIME -> Known.ONE_TIME @@ -24415,7 +28838,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CreditAllocation]. */ + class Builder internal constructor() { private var allowsRollover: JsonField? = null private var currency: JsonField? = null @@ -24534,7 +28958,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -24596,6 +29021,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -24607,17 +29040,39 @@ private constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -24625,6 +29080,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -24710,7 +29174,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Item]. */ + class Builder internal constructor() { private var id: JsonField? = null private var name: JsonField? = null @@ -24839,7 +29304,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Maximum]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var maximumAmount: JsonField? = null @@ -24977,7 +29443,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -25088,7 +29555,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Minimum]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var minimumAmount: JsonField? = null @@ -25198,6 +29666,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -25207,21 +29683,51 @@ private constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { TIERED_WITH_MINIMUM, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { TIERED_WITH_MINIMUM, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { TIERED_WITH_MINIMUM -> Value.TIERED_WITH_MINIMUM else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { TIERED_WITH_MINIMUM -> Known.TIERED_WITH_MINIMUM @@ -25249,6 +29755,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -25260,17 +29774,38 @@ private constructor( @JvmStatic fun of(value: String) = PriceType(JsonField.of(value)) } + /** An enum containing [PriceType]'s known values. */ enum class Known { USAGE_PRICE, FIXED_PRICE, } + /** + * An enum containing [PriceType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [PriceType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { USAGE_PRICE, FIXED_PRICE, + /** + * An enum member indicating that [PriceType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { USAGE_PRICE -> Value.USAGE_PRICE @@ -25278,6 +29813,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { USAGE_PRICE -> Known.USAGE_PRICE @@ -25329,7 +29873,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TieredWithMinimumConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -25383,22 +29928,165 @@ private constructor( "TieredWithMinimumConfig{additionalProperties=$additionalProperties}" } + @NoAutoDetect + class DimensionalPriceConfiguration + @JsonCreator + private constructor( + @JsonProperty("dimension_values") + @ExcludeMissing + private val dimensionValues: JsonField> = JsonMissing.of(), + @JsonProperty("dimensional_price_group_id") + @ExcludeMissing + private val dimensionalPriceGroupId: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { + + fun dimensionValues(): List = dimensionValues.getRequired("dimension_values") + + fun dimensionalPriceGroupId(): String = + dimensionalPriceGroupId.getRequired("dimensional_price_group_id") + + @JsonProperty("dimension_values") + @ExcludeMissing + fun _dimensionValues(): JsonField> = dimensionValues + + @JsonProperty("dimensional_price_group_id") + @ExcludeMissing + fun _dimensionalPriceGroupId(): JsonField = dimensionalPriceGroupId + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): DimensionalPriceConfiguration = apply { + if (validated) { + return@apply + } + + dimensionValues() + dimensionalPriceGroupId() + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + /** A builder for [DimensionalPriceConfiguration]. */ + class Builder internal constructor() { + + private var dimensionValues: JsonField>? = null + private var dimensionalPriceGroupId: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(dimensionalPriceConfiguration: DimensionalPriceConfiguration) = + apply { + dimensionValues = + dimensionalPriceConfiguration.dimensionValues.map { it.toMutableList() } + dimensionalPriceGroupId = + dimensionalPriceConfiguration.dimensionalPriceGroupId + additionalProperties = + dimensionalPriceConfiguration.additionalProperties.toMutableMap() + } + + fun dimensionValues(dimensionValues: List) = + dimensionValues(JsonField.of(dimensionValues)) + + fun dimensionValues(dimensionValues: JsonField>) = apply { + this.dimensionValues = dimensionValues.map { it.toMutableList() } + } + + fun addDimensionValue(dimensionValue: String) = apply { + dimensionValues = + (dimensionValues ?: JsonField.of(mutableListOf())).apply { + asKnown() + .orElseThrow { + IllegalStateException( + "Field was set to non-list type: ${javaClass.simpleName}" + ) + } + .add(dimensionValue) + } + } + + fun dimensionalPriceGroupId(dimensionalPriceGroupId: String) = + dimensionalPriceGroupId(JsonField.of(dimensionalPriceGroupId)) + + fun dimensionalPriceGroupId(dimensionalPriceGroupId: JsonField) = apply { + this.dimensionalPriceGroupId = dimensionalPriceGroupId + } + + 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(): DimensionalPriceConfiguration = + DimensionalPriceConfiguration( + checkRequired("dimensionValues", dimensionValues).map { it.toImmutable() }, + checkRequired("dimensionalPriceGroupId", dimensionalPriceGroupId), + additionalProperties.toImmutable(), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is DimensionalPriceConfiguration && dimensionValues == other.dimensionValues && dimensionalPriceGroupId == other.dimensionalPriceGroupId && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(dimensionValues, dimensionalPriceGroupId, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "DimensionalPriceConfiguration{dimensionValues=$dimensionValues, dimensionalPriceGroupId=$dimensionalPriceGroupId, additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true } - return /* spotless:off */ other is TieredWithMinimumPrice && 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 && tieredWithMinimumConfig == other.tieredWithMinimumConfig && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is TieredWithMinimumPrice && 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 && tieredWithMinimumConfig == other.tieredWithMinimumConfig && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && 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, tieredWithMinimumConfig, 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, tieredWithMinimumConfig, dimensionalPriceConfiguration, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "TieredWithMinimumPrice{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, tieredWithMinimumConfig=$tieredWithMinimumConfig, additionalProperties=$additionalProperties}" + "TieredWithMinimumPrice{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, tieredWithMinimumConfig=$tieredWithMinimumConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, additionalProperties=$additionalProperties}" } @NoAutoDetect @@ -25473,6 +30161,10 @@ private constructor( @ExcludeMissing private val tieredPackageWithMinimumConfig: JsonField = JsonMissing.of(), + @JsonProperty("dimensional_price_configuration") + @ExcludeMissing + private val dimensionalPriceConfiguration: JsonField = + JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { @@ -25541,6 +30233,11 @@ private constructor( fun tieredPackageWithMinimumConfig(): TieredPackageWithMinimumConfig = tieredPackageWithMinimumConfig.getRequired("tiered_package_with_minimum_config") + fun dimensionalPriceConfiguration(): Optional = + Optional.ofNullable( + dimensionalPriceConfiguration.getNullable("dimensional_price_configuration") + ) + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id @JsonProperty("billable_metric") @@ -25623,6 +30320,11 @@ private constructor( fun _tieredPackageWithMinimumConfig(): JsonField = tieredPackageWithMinimumConfig + @JsonProperty("dimensional_price_configuration") + @ExcludeMissing + fun _dimensionalPriceConfiguration(): JsonField = + dimensionalPriceConfiguration + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -25657,6 +30359,7 @@ private constructor( planPhaseOrder() priceType() tieredPackageWithMinimumConfig().validate() + dimensionalPriceConfiguration().ifPresent { it.validate() } validated = true } @@ -25667,7 +30370,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TieredPackageWithMinimumPrice]. */ + class Builder internal constructor() { private var id: JsonField? = null private var billableMetric: JsonField? = null @@ -25693,6 +30397,8 @@ private constructor( private var priceType: JsonField? = null private var tieredPackageWithMinimumConfig: JsonField? = null + private var dimensionalPriceConfiguration: JsonField = + JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -25724,6 +30430,8 @@ private constructor( priceType = tieredPackageWithMinimumPrice.priceType tieredPackageWithMinimumConfig = tieredPackageWithMinimumPrice.tieredPackageWithMinimumConfig + dimensionalPriceConfiguration = + tieredPackageWithMinimumPrice.dimensionalPriceConfiguration additionalProperties = tieredPackageWithMinimumPrice.additionalProperties.toMutableMap() } @@ -25797,6 +30505,14 @@ private constructor( fun discount(trial: TrialDiscount) = discount(Discount.ofTrial(trial)) + fun trialDiscount(appliesToPriceIds: List) = + discount( + TrialDiscount.builder() + .discountType(TrialDiscount.DiscountType.TRIAL) + .appliesToPriceIds(appliesToPriceIds) + .build() + ) + fun discount(usage: Discount.UsageDiscount) = discount(Discount.ofUsage(usage)) fun discount(amount: AmountDiscount) = discount(Discount.ofAmount(amount)) @@ -25920,6 +30636,18 @@ private constructor( tieredPackageWithMinimumConfig: JsonField ) = apply { this.tieredPackageWithMinimumConfig = tieredPackageWithMinimumConfig } + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: DimensionalPriceConfiguration? + ) = dimensionalPriceConfiguration(JsonField.ofNullable(dimensionalPriceConfiguration)) + + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: Optional + ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.orElse(null)) + + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: JsonField + ) = apply { this.dimensionalPriceConfiguration = dimensionalPriceConfiguration } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -25964,6 +30692,7 @@ private constructor( checkRequired("planPhaseOrder", planPhaseOrder), checkRequired("priceType", priceType), checkRequired("tieredPackageWithMinimumConfig", tieredPackageWithMinimumConfig), + dimensionalPriceConfiguration, additionalProperties.toImmutable(), ) } @@ -26005,7 +30734,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillableMetric]. */ + class Builder internal constructor() { private var id: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -26111,7 +30841,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -26172,6 +30903,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -26183,17 +30922,39 @@ private constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -26201,6 +30962,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -26247,6 +31017,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -26266,6 +31044,7 @@ private constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ONE_TIME, MONTHLY, @@ -26275,6 +31054,15 @@ private constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ONE_TIME, MONTHLY, @@ -26282,9 +31070,19 @@ private constructor( SEMI_ANNUAL, ANNUAL, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { ONE_TIME -> Value.ONE_TIME @@ -26296,6 +31094,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ONE_TIME -> Known.ONE_TIME @@ -26369,7 +31176,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CreditAllocation]. */ + class Builder internal constructor() { private var allowsRollover: JsonField? = null private var currency: JsonField? = null @@ -26488,7 +31296,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -26550,6 +31359,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -26561,17 +31378,39 @@ private constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -26579,6 +31418,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -26664,7 +31512,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Item]. */ + class Builder internal constructor() { private var id: JsonField? = null private var name: JsonField? = null @@ -26793,7 +31642,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Maximum]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var maximumAmount: JsonField? = null @@ -26931,7 +31781,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -27042,7 +31893,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Minimum]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var minimumAmount: JsonField? = null @@ -27152,6 +32004,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -27161,21 +32021,51 @@ private constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { TIERED_PACKAGE_WITH_MINIMUM, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { TIERED_PACKAGE_WITH_MINIMUM, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { TIERED_PACKAGE_WITH_MINIMUM -> Value.TIERED_PACKAGE_WITH_MINIMUM else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { TIERED_PACKAGE_WITH_MINIMUM -> Known.TIERED_PACKAGE_WITH_MINIMUM @@ -27203,6 +32093,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -27214,17 +32112,38 @@ private constructor( @JvmStatic fun of(value: String) = PriceType(JsonField.of(value)) } + /** An enum containing [PriceType]'s known values. */ enum class Known { USAGE_PRICE, FIXED_PRICE, } + /** + * An enum containing [PriceType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [PriceType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { USAGE_PRICE, FIXED_PRICE, + /** + * An enum member indicating that [PriceType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { USAGE_PRICE -> Value.USAGE_PRICE @@ -27232,6 +32151,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { USAGE_PRICE -> Known.USAGE_PRICE @@ -27283,7 +32211,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TieredPackageWithMinimumConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -27338,22 +32267,165 @@ private constructor( "TieredPackageWithMinimumConfig{additionalProperties=$additionalProperties}" } + @NoAutoDetect + class DimensionalPriceConfiguration + @JsonCreator + private constructor( + @JsonProperty("dimension_values") + @ExcludeMissing + private val dimensionValues: JsonField> = JsonMissing.of(), + @JsonProperty("dimensional_price_group_id") + @ExcludeMissing + private val dimensionalPriceGroupId: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { + + fun dimensionValues(): List = dimensionValues.getRequired("dimension_values") + + fun dimensionalPriceGroupId(): String = + dimensionalPriceGroupId.getRequired("dimensional_price_group_id") + + @JsonProperty("dimension_values") + @ExcludeMissing + fun _dimensionValues(): JsonField> = dimensionValues + + @JsonProperty("dimensional_price_group_id") + @ExcludeMissing + fun _dimensionalPriceGroupId(): JsonField = dimensionalPriceGroupId + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): DimensionalPriceConfiguration = apply { + if (validated) { + return@apply + } + + dimensionValues() + dimensionalPriceGroupId() + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + /** A builder for [DimensionalPriceConfiguration]. */ + class Builder internal constructor() { + + private var dimensionValues: JsonField>? = null + private var dimensionalPriceGroupId: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(dimensionalPriceConfiguration: DimensionalPriceConfiguration) = + apply { + dimensionValues = + dimensionalPriceConfiguration.dimensionValues.map { it.toMutableList() } + dimensionalPriceGroupId = + dimensionalPriceConfiguration.dimensionalPriceGroupId + additionalProperties = + dimensionalPriceConfiguration.additionalProperties.toMutableMap() + } + + fun dimensionValues(dimensionValues: List) = + dimensionValues(JsonField.of(dimensionValues)) + + fun dimensionValues(dimensionValues: JsonField>) = apply { + this.dimensionValues = dimensionValues.map { it.toMutableList() } + } + + fun addDimensionValue(dimensionValue: String) = apply { + dimensionValues = + (dimensionValues ?: JsonField.of(mutableListOf())).apply { + asKnown() + .orElseThrow { + IllegalStateException( + "Field was set to non-list type: ${javaClass.simpleName}" + ) + } + .add(dimensionValue) + } + } + + fun dimensionalPriceGroupId(dimensionalPriceGroupId: String) = + dimensionalPriceGroupId(JsonField.of(dimensionalPriceGroupId)) + + fun dimensionalPriceGroupId(dimensionalPriceGroupId: JsonField) = apply { + this.dimensionalPriceGroupId = dimensionalPriceGroupId + } + + 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(): DimensionalPriceConfiguration = + DimensionalPriceConfiguration( + checkRequired("dimensionValues", dimensionValues).map { it.toImmutable() }, + checkRequired("dimensionalPriceGroupId", dimensionalPriceGroupId), + additionalProperties.toImmutable(), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is DimensionalPriceConfiguration && dimensionValues == other.dimensionValues && dimensionalPriceGroupId == other.dimensionalPriceGroupId && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(dimensionValues, dimensionalPriceGroupId, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "DimensionalPriceConfiguration{dimensionValues=$dimensionValues, dimensionalPriceGroupId=$dimensionalPriceGroupId, additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true } - return /* spotless:off */ other is TieredPackageWithMinimumPrice && 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 && tieredPackageWithMinimumConfig == other.tieredPackageWithMinimumConfig && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is TieredPackageWithMinimumPrice && 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 && tieredPackageWithMinimumConfig == other.tieredPackageWithMinimumConfig && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && 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, tieredPackageWithMinimumConfig, 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, tieredPackageWithMinimumConfig, dimensionalPriceConfiguration, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "TieredPackageWithMinimumPrice{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, tieredPackageWithMinimumConfig=$tieredPackageWithMinimumConfig, additionalProperties=$additionalProperties}" + "TieredPackageWithMinimumPrice{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, tieredPackageWithMinimumConfig=$tieredPackageWithMinimumConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, additionalProperties=$additionalProperties}" } @NoAutoDetect @@ -27428,6 +32500,10 @@ private constructor( @JsonProperty("price_type") @ExcludeMissing private val priceType: JsonField = JsonMissing.of(), + @JsonProperty("dimensional_price_configuration") + @ExcludeMissing + private val dimensionalPriceConfiguration: JsonField = + JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { @@ -27496,6 +32572,11 @@ private constructor( fun priceType(): PriceType = priceType.getRequired("price_type") + fun dimensionalPriceConfiguration(): Optional = + Optional.ofNullable( + dimensionalPriceConfiguration.getNullable("dimensional_price_configuration") + ) + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id @JsonProperty("billable_metric") @@ -27578,6 +32659,11 @@ private constructor( @ExcludeMissing fun _priceType(): JsonField = priceType + @JsonProperty("dimensional_price_configuration") + @ExcludeMissing + fun _dimensionalPriceConfiguration(): JsonField = + dimensionalPriceConfiguration + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -27612,6 +32698,7 @@ private constructor( packageWithAllocationConfig().validate() planPhaseOrder() priceType() + dimensionalPriceConfiguration().ifPresent { it.validate() } validated = true } @@ -27622,7 +32709,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [PackageWithAllocationPrice]. */ + class Builder internal constructor() { private var id: JsonField? = null private var billableMetric: JsonField? = null @@ -27647,6 +32735,8 @@ private constructor( private var packageWithAllocationConfig: JsonField? = null private var planPhaseOrder: JsonField? = null private var priceType: JsonField? = null + private var dimensionalPriceConfiguration: JsonField = + JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -27674,6 +32764,8 @@ private constructor( packageWithAllocationConfig = packageWithAllocationPrice.packageWithAllocationConfig planPhaseOrder = packageWithAllocationPrice.planPhaseOrder priceType = packageWithAllocationPrice.priceType + dimensionalPriceConfiguration = + packageWithAllocationPrice.dimensionalPriceConfiguration additionalProperties = packageWithAllocationPrice.additionalProperties.toMutableMap() } @@ -27747,6 +32839,14 @@ private constructor( fun discount(trial: TrialDiscount) = discount(Discount.ofTrial(trial)) + fun trialDiscount(appliesToPriceIds: List) = + discount( + TrialDiscount.builder() + .discountType(TrialDiscount.DiscountType.TRIAL) + .appliesToPriceIds(appliesToPriceIds) + .build() + ) + fun discount(usage: Discount.UsageDiscount) = discount(Discount.ofUsage(usage)) fun discount(amount: AmountDiscount) = discount(Discount.ofAmount(amount)) @@ -27870,6 +32970,18 @@ private constructor( fun priceType(priceType: JsonField) = apply { this.priceType = priceType } + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: DimensionalPriceConfiguration? + ) = dimensionalPriceConfiguration(JsonField.ofNullable(dimensionalPriceConfiguration)) + + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: Optional + ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.orElse(null)) + + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: JsonField + ) = apply { this.dimensionalPriceConfiguration = dimensionalPriceConfiguration } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -27914,6 +33026,7 @@ private constructor( checkRequired("packageWithAllocationConfig", packageWithAllocationConfig), checkRequired("planPhaseOrder", planPhaseOrder), checkRequired("priceType", priceType), + dimensionalPriceConfiguration, additionalProperties.toImmutable(), ) } @@ -27955,7 +33068,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillableMetric]. */ + class Builder internal constructor() { private var id: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -28061,7 +33175,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -28122,6 +33237,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -28133,17 +33256,39 @@ private constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -28151,6 +33296,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -28197,6 +33351,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -28216,6 +33378,7 @@ private constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ONE_TIME, MONTHLY, @@ -28225,6 +33388,15 @@ private constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ONE_TIME, MONTHLY, @@ -28232,9 +33404,19 @@ private constructor( SEMI_ANNUAL, ANNUAL, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { ONE_TIME -> Value.ONE_TIME @@ -28246,6 +33428,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ONE_TIME -> Known.ONE_TIME @@ -28319,7 +33510,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CreditAllocation]. */ + class Builder internal constructor() { private var allowsRollover: JsonField? = null private var currency: JsonField? = null @@ -28438,7 +33630,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -28500,6 +33693,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -28511,17 +33712,39 @@ private constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -28529,6 +33752,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -28614,7 +33846,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Item]. */ + class Builder internal constructor() { private var id: JsonField? = null private var name: JsonField? = null @@ -28743,7 +33976,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Maximum]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var maximumAmount: JsonField? = null @@ -28881,7 +34115,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -28992,7 +34227,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Minimum]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var minimumAmount: JsonField? = null @@ -29102,6 +34338,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -29111,21 +34355,51 @@ private constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { PACKAGE_WITH_ALLOCATION, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PACKAGE_WITH_ALLOCATION, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { PACKAGE_WITH_ALLOCATION -> Value.PACKAGE_WITH_ALLOCATION else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { PACKAGE_WITH_ALLOCATION -> Known.PACKAGE_WITH_ALLOCATION @@ -29176,7 +34450,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [PackageWithAllocationConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -29237,6 +34512,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -29248,17 +34531,38 @@ private constructor( @JvmStatic fun of(value: String) = PriceType(JsonField.of(value)) } + /** An enum containing [PriceType]'s known values. */ enum class Known { USAGE_PRICE, FIXED_PRICE, } + /** + * An enum containing [PriceType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [PriceType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { USAGE_PRICE, FIXED_PRICE, + /** + * An enum member indicating that [PriceType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { USAGE_PRICE -> Value.USAGE_PRICE @@ -29266,6 +34570,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { USAGE_PRICE -> Known.USAGE_PRICE @@ -29288,22 +34601,165 @@ private constructor( override fun toString() = value.toString() } + @NoAutoDetect + class DimensionalPriceConfiguration + @JsonCreator + private constructor( + @JsonProperty("dimension_values") + @ExcludeMissing + private val dimensionValues: JsonField> = JsonMissing.of(), + @JsonProperty("dimensional_price_group_id") + @ExcludeMissing + private val dimensionalPriceGroupId: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { + + fun dimensionValues(): List = dimensionValues.getRequired("dimension_values") + + fun dimensionalPriceGroupId(): String = + dimensionalPriceGroupId.getRequired("dimensional_price_group_id") + + @JsonProperty("dimension_values") + @ExcludeMissing + fun _dimensionValues(): JsonField> = dimensionValues + + @JsonProperty("dimensional_price_group_id") + @ExcludeMissing + fun _dimensionalPriceGroupId(): JsonField = dimensionalPriceGroupId + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): DimensionalPriceConfiguration = apply { + if (validated) { + return@apply + } + + dimensionValues() + dimensionalPriceGroupId() + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + /** A builder for [DimensionalPriceConfiguration]. */ + class Builder internal constructor() { + + private var dimensionValues: JsonField>? = null + private var dimensionalPriceGroupId: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(dimensionalPriceConfiguration: DimensionalPriceConfiguration) = + apply { + dimensionValues = + dimensionalPriceConfiguration.dimensionValues.map { it.toMutableList() } + dimensionalPriceGroupId = + dimensionalPriceConfiguration.dimensionalPriceGroupId + additionalProperties = + dimensionalPriceConfiguration.additionalProperties.toMutableMap() + } + + fun dimensionValues(dimensionValues: List) = + dimensionValues(JsonField.of(dimensionValues)) + + fun dimensionValues(dimensionValues: JsonField>) = apply { + this.dimensionValues = dimensionValues.map { it.toMutableList() } + } + + fun addDimensionValue(dimensionValue: String) = apply { + dimensionValues = + (dimensionValues ?: JsonField.of(mutableListOf())).apply { + asKnown() + .orElseThrow { + IllegalStateException( + "Field was set to non-list type: ${javaClass.simpleName}" + ) + } + .add(dimensionValue) + } + } + + fun dimensionalPriceGroupId(dimensionalPriceGroupId: String) = + dimensionalPriceGroupId(JsonField.of(dimensionalPriceGroupId)) + + fun dimensionalPriceGroupId(dimensionalPriceGroupId: JsonField) = apply { + this.dimensionalPriceGroupId = dimensionalPriceGroupId + } + + 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(): DimensionalPriceConfiguration = + DimensionalPriceConfiguration( + checkRequired("dimensionValues", dimensionValues).map { it.toImmutable() }, + checkRequired("dimensionalPriceGroupId", dimensionalPriceGroupId), + additionalProperties.toImmutable(), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is DimensionalPriceConfiguration && dimensionValues == other.dimensionValues && dimensionalPriceGroupId == other.dimensionalPriceGroupId && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(dimensionValues, dimensionalPriceGroupId, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "DimensionalPriceConfiguration{dimensionValues=$dimensionValues, dimensionalPriceGroupId=$dimensionalPriceGroupId, additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true } - return /* spotless:off */ other is PackageWithAllocationPrice && 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 && packageWithAllocationConfig == other.packageWithAllocationConfig && planPhaseOrder == other.planPhaseOrder && priceType == other.priceType && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is PackageWithAllocationPrice && 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 && packageWithAllocationConfig == other.packageWithAllocationConfig && planPhaseOrder == other.planPhaseOrder && priceType == other.priceType && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && 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, packageWithAllocationConfig, 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, packageWithAllocationConfig, planPhaseOrder, priceType, dimensionalPriceConfiguration, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "PackageWithAllocationPrice{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, packageWithAllocationConfig=$packageWithAllocationConfig, planPhaseOrder=$planPhaseOrder, priceType=$priceType, additionalProperties=$additionalProperties}" + "PackageWithAllocationPrice{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, packageWithAllocationConfig=$packageWithAllocationConfig, planPhaseOrder=$planPhaseOrder, priceType=$priceType, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, additionalProperties=$additionalProperties}" } @NoAutoDetect @@ -29377,6 +34833,10 @@ private constructor( @JsonProperty("unit_with_percent_config") @ExcludeMissing private val unitWithPercentConfig: JsonField = JsonMissing.of(), + @JsonProperty("dimensional_price_configuration") + @ExcludeMissing + private val dimensionalPriceConfiguration: JsonField = + JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { @@ -29445,6 +34905,11 @@ private constructor( fun unitWithPercentConfig(): UnitWithPercentConfig = unitWithPercentConfig.getRequired("unit_with_percent_config") + fun dimensionalPriceConfiguration(): Optional = + Optional.ofNullable( + dimensionalPriceConfiguration.getNullable("dimensional_price_configuration") + ) + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id @JsonProperty("billable_metric") @@ -29526,6 +34991,11 @@ private constructor( @ExcludeMissing fun _unitWithPercentConfig(): JsonField = unitWithPercentConfig + @JsonProperty("dimensional_price_configuration") + @ExcludeMissing + fun _dimensionalPriceConfiguration(): JsonField = + dimensionalPriceConfiguration + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -29560,6 +35030,7 @@ private constructor( planPhaseOrder() priceType() unitWithPercentConfig().validate() + dimensionalPriceConfiguration().ifPresent { it.validate() } validated = true } @@ -29570,7 +35041,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [UnitWithPercentPrice]. */ + class Builder internal constructor() { private var id: JsonField? = null private var billableMetric: JsonField? = null @@ -29595,6 +35067,8 @@ private constructor( private var planPhaseOrder: JsonField? = null private var priceType: JsonField? = null private var unitWithPercentConfig: JsonField? = null + private var dimensionalPriceConfiguration: JsonField = + JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -29622,6 +35096,7 @@ private constructor( planPhaseOrder = unitWithPercentPrice.planPhaseOrder priceType = unitWithPercentPrice.priceType unitWithPercentConfig = unitWithPercentPrice.unitWithPercentConfig + dimensionalPriceConfiguration = unitWithPercentPrice.dimensionalPriceConfiguration additionalProperties = unitWithPercentPrice.additionalProperties.toMutableMap() } @@ -29694,6 +35169,14 @@ private constructor( fun discount(trial: TrialDiscount) = discount(Discount.ofTrial(trial)) + fun trialDiscount(appliesToPriceIds: List) = + discount( + TrialDiscount.builder() + .discountType(TrialDiscount.DiscountType.TRIAL) + .appliesToPriceIds(appliesToPriceIds) + .build() + ) + fun discount(usage: Discount.UsageDiscount) = discount(Discount.ofUsage(usage)) fun discount(amount: AmountDiscount) = discount(Discount.ofAmount(amount)) @@ -29817,6 +35300,18 @@ private constructor( this.unitWithPercentConfig = unitWithPercentConfig } + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: DimensionalPriceConfiguration? + ) = dimensionalPriceConfiguration(JsonField.ofNullable(dimensionalPriceConfiguration)) + + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: Optional + ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.orElse(null)) + + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: JsonField + ) = apply { this.dimensionalPriceConfiguration = dimensionalPriceConfiguration } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -29861,6 +35356,7 @@ private constructor( checkRequired("planPhaseOrder", planPhaseOrder), checkRequired("priceType", priceType), checkRequired("unitWithPercentConfig", unitWithPercentConfig), + dimensionalPriceConfiguration, additionalProperties.toImmutable(), ) } @@ -29902,7 +35398,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillableMetric]. */ + class Builder internal constructor() { private var id: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -30008,7 +35505,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -30069,6 +35567,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -30080,17 +35586,39 @@ private constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -30098,6 +35626,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -30144,6 +35681,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -30163,6 +35708,7 @@ private constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ONE_TIME, MONTHLY, @@ -30172,6 +35718,15 @@ private constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ONE_TIME, MONTHLY, @@ -30179,9 +35734,19 @@ private constructor( SEMI_ANNUAL, ANNUAL, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { ONE_TIME -> Value.ONE_TIME @@ -30193,6 +35758,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ONE_TIME -> Known.ONE_TIME @@ -30266,7 +35840,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CreditAllocation]. */ + class Builder internal constructor() { private var allowsRollover: JsonField? = null private var currency: JsonField? = null @@ -30385,7 +35960,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -30447,6 +36023,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -30458,17 +36042,39 @@ private constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -30476,6 +36082,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -30561,7 +36176,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Item]. */ + class Builder internal constructor() { private var id: JsonField? = null private var name: JsonField? = null @@ -30690,7 +36306,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Maximum]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var maximumAmount: JsonField? = null @@ -30828,7 +36445,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -30939,7 +36557,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Minimum]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var minimumAmount: JsonField? = null @@ -31049,6 +36668,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -31058,21 +36685,51 @@ private constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { UNIT_WITH_PERCENT, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { UNIT_WITH_PERCENT, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { UNIT_WITH_PERCENT -> Value.UNIT_WITH_PERCENT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { UNIT_WITH_PERCENT -> Known.UNIT_WITH_PERCENT @@ -31100,6 +36757,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -31111,17 +36776,38 @@ private constructor( @JvmStatic fun of(value: String) = PriceType(JsonField.of(value)) } + /** An enum containing [PriceType]'s known values. */ enum class Known { USAGE_PRICE, FIXED_PRICE, } + /** + * An enum containing [PriceType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [PriceType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { USAGE_PRICE, FIXED_PRICE, + /** + * An enum member indicating that [PriceType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { USAGE_PRICE -> Value.USAGE_PRICE @@ -31129,6 +36815,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { USAGE_PRICE -> Known.USAGE_PRICE @@ -31180,7 +36875,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [UnitWithPercentConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -31233,22 +36929,165 @@ private constructor( "UnitWithPercentConfig{additionalProperties=$additionalProperties}" } + @NoAutoDetect + class DimensionalPriceConfiguration + @JsonCreator + private constructor( + @JsonProperty("dimension_values") + @ExcludeMissing + private val dimensionValues: JsonField> = JsonMissing.of(), + @JsonProperty("dimensional_price_group_id") + @ExcludeMissing + private val dimensionalPriceGroupId: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { + + fun dimensionValues(): List = dimensionValues.getRequired("dimension_values") + + fun dimensionalPriceGroupId(): String = + dimensionalPriceGroupId.getRequired("dimensional_price_group_id") + + @JsonProperty("dimension_values") + @ExcludeMissing + fun _dimensionValues(): JsonField> = dimensionValues + + @JsonProperty("dimensional_price_group_id") + @ExcludeMissing + fun _dimensionalPriceGroupId(): JsonField = dimensionalPriceGroupId + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): DimensionalPriceConfiguration = apply { + if (validated) { + return@apply + } + + dimensionValues() + dimensionalPriceGroupId() + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + /** A builder for [DimensionalPriceConfiguration]. */ + class Builder internal constructor() { + + private var dimensionValues: JsonField>? = null + private var dimensionalPriceGroupId: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(dimensionalPriceConfiguration: DimensionalPriceConfiguration) = + apply { + dimensionValues = + dimensionalPriceConfiguration.dimensionValues.map { it.toMutableList() } + dimensionalPriceGroupId = + dimensionalPriceConfiguration.dimensionalPriceGroupId + additionalProperties = + dimensionalPriceConfiguration.additionalProperties.toMutableMap() + } + + fun dimensionValues(dimensionValues: List) = + dimensionValues(JsonField.of(dimensionValues)) + + fun dimensionValues(dimensionValues: JsonField>) = apply { + this.dimensionValues = dimensionValues.map { it.toMutableList() } + } + + fun addDimensionValue(dimensionValue: String) = apply { + dimensionValues = + (dimensionValues ?: JsonField.of(mutableListOf())).apply { + asKnown() + .orElseThrow { + IllegalStateException( + "Field was set to non-list type: ${javaClass.simpleName}" + ) + } + .add(dimensionValue) + } + } + + fun dimensionalPriceGroupId(dimensionalPriceGroupId: String) = + dimensionalPriceGroupId(JsonField.of(dimensionalPriceGroupId)) + + fun dimensionalPriceGroupId(dimensionalPriceGroupId: JsonField) = apply { + this.dimensionalPriceGroupId = dimensionalPriceGroupId + } + + 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(): DimensionalPriceConfiguration = + DimensionalPriceConfiguration( + checkRequired("dimensionValues", dimensionValues).map { it.toImmutable() }, + checkRequired("dimensionalPriceGroupId", dimensionalPriceGroupId), + additionalProperties.toImmutable(), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is DimensionalPriceConfiguration && dimensionValues == other.dimensionValues && dimensionalPriceGroupId == other.dimensionalPriceGroupId && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(dimensionValues, dimensionalPriceGroupId, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "DimensionalPriceConfiguration{dimensionValues=$dimensionValues, dimensionalPriceGroupId=$dimensionalPriceGroupId, additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true } - return /* spotless:off */ other is UnitWithPercentPrice && 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 && unitWithPercentConfig == other.unitWithPercentConfig && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is UnitWithPercentPrice && 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 && unitWithPercentConfig == other.unitWithPercentConfig && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && 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, unitWithPercentConfig, 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, unitWithPercentConfig, dimensionalPriceConfiguration, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "UnitWithPercentPrice{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, unitWithPercentConfig=$unitWithPercentConfig, additionalProperties=$additionalProperties}" + "UnitWithPercentPrice{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, unitWithPercentConfig=$unitWithPercentConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, additionalProperties=$additionalProperties}" } @NoAutoDetect @@ -31323,6 +37162,10 @@ private constructor( @JsonProperty("price_type") @ExcludeMissing private val priceType: JsonField = JsonMissing.of(), + @JsonProperty("dimensional_price_configuration") + @ExcludeMissing + private val dimensionalPriceConfiguration: JsonField = + JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { @@ -31391,6 +37234,11 @@ private constructor( fun priceType(): PriceType = priceType.getRequired("price_type") + fun dimensionalPriceConfiguration(): Optional = + Optional.ofNullable( + dimensionalPriceConfiguration.getNullable("dimensional_price_configuration") + ) + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id @JsonProperty("billable_metric") @@ -31473,6 +37321,11 @@ private constructor( @ExcludeMissing fun _priceType(): JsonField = priceType + @JsonProperty("dimensional_price_configuration") + @ExcludeMissing + fun _dimensionalPriceConfiguration(): JsonField = + dimensionalPriceConfiguration + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -31507,6 +37360,7 @@ private constructor( name() planPhaseOrder() priceType() + dimensionalPriceConfiguration().ifPresent { it.validate() } validated = true } @@ -31517,7 +37371,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MatrixWithAllocationPrice]. */ + class Builder internal constructor() { private var id: JsonField? = null private var billableMetric: JsonField? = null @@ -31542,6 +37397,8 @@ private constructor( private var name: JsonField? = null private var planPhaseOrder: JsonField? = null private var priceType: JsonField? = null + private var dimensionalPriceConfiguration: JsonField = + JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -31569,6 +37426,8 @@ private constructor( name = matrixWithAllocationPrice.name planPhaseOrder = matrixWithAllocationPrice.planPhaseOrder priceType = matrixWithAllocationPrice.priceType + dimensionalPriceConfiguration = + matrixWithAllocationPrice.dimensionalPriceConfiguration additionalProperties = matrixWithAllocationPrice.additionalProperties.toMutableMap() } @@ -31641,6 +37500,14 @@ private constructor( fun discount(trial: TrialDiscount) = discount(Discount.ofTrial(trial)) + fun trialDiscount(appliesToPriceIds: List) = + discount( + TrialDiscount.builder() + .discountType(TrialDiscount.DiscountType.TRIAL) + .appliesToPriceIds(appliesToPriceIds) + .build() + ) + fun discount(usage: Discount.UsageDiscount) = discount(Discount.ofUsage(usage)) fun discount(amount: AmountDiscount) = discount(Discount.ofAmount(amount)) @@ -31763,6 +37630,18 @@ private constructor( fun priceType(priceType: JsonField) = apply { this.priceType = priceType } + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: DimensionalPriceConfiguration? + ) = dimensionalPriceConfiguration(JsonField.ofNullable(dimensionalPriceConfiguration)) + + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: Optional + ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.orElse(null)) + + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: JsonField + ) = apply { this.dimensionalPriceConfiguration = dimensionalPriceConfiguration } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -31807,6 +37686,7 @@ private constructor( checkRequired("name", name), checkRequired("planPhaseOrder", planPhaseOrder), checkRequired("priceType", priceType), + dimensionalPriceConfiguration, additionalProperties.toImmutable(), ) } @@ -31848,7 +37728,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillableMetric]. */ + class Builder internal constructor() { private var id: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -31954,7 +37835,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -32015,6 +37897,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -32026,17 +37916,39 @@ private constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -32044,6 +37956,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -32090,6 +38011,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -32109,6 +38038,7 @@ private constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ONE_TIME, MONTHLY, @@ -32118,6 +38048,15 @@ private constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ONE_TIME, MONTHLY, @@ -32125,9 +38064,19 @@ private constructor( SEMI_ANNUAL, ANNUAL, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { ONE_TIME -> Value.ONE_TIME @@ -32139,6 +38088,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ONE_TIME -> Known.ONE_TIME @@ -32212,7 +38170,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CreditAllocation]. */ + class Builder internal constructor() { private var allowsRollover: JsonField? = null private var currency: JsonField? = null @@ -32331,7 +38290,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -32393,6 +38353,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -32404,17 +38372,39 @@ private constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -32422,6 +38412,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -32507,7 +38506,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Item]. */ + class Builder internal constructor() { private var id: JsonField? = null private var name: JsonField? = null @@ -32653,7 +38653,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MatrixWithAllocationConfig]. */ + class Builder internal constructor() { private var allocation: JsonField? = null private var defaultUnitAmount: JsonField? = null @@ -32832,7 +38833,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MatrixValue]. */ + class Builder internal constructor() { private var dimensionValues: JsonField>? = null private var unitAmount: JsonField? = null @@ -33016,7 +39018,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Maximum]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var maximumAmount: JsonField? = null @@ -33154,7 +39157,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -33265,7 +39269,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Minimum]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var minimumAmount: JsonField? = null @@ -33375,6 +39380,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -33384,21 +39397,51 @@ private constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { MATRIX_WITH_ALLOCATION, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { MATRIX_WITH_ALLOCATION, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { MATRIX_WITH_ALLOCATION -> Value.MATRIX_WITH_ALLOCATION else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { MATRIX_WITH_ALLOCATION -> Known.MATRIX_WITH_ALLOCATION @@ -33426,6 +39469,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -33437,17 +39488,38 @@ private constructor( @JvmStatic fun of(value: String) = PriceType(JsonField.of(value)) } + /** An enum containing [PriceType]'s known values. */ enum class Known { USAGE_PRICE, FIXED_PRICE, } + /** + * An enum containing [PriceType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [PriceType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { USAGE_PRICE, FIXED_PRICE, + /** + * An enum member indicating that [PriceType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { USAGE_PRICE -> Value.USAGE_PRICE @@ -33455,6 +39527,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { USAGE_PRICE -> Known.USAGE_PRICE @@ -33477,22 +39558,165 @@ private constructor( override fun toString() = value.toString() } + @NoAutoDetect + class DimensionalPriceConfiguration + @JsonCreator + private constructor( + @JsonProperty("dimension_values") + @ExcludeMissing + private val dimensionValues: JsonField> = JsonMissing.of(), + @JsonProperty("dimensional_price_group_id") + @ExcludeMissing + private val dimensionalPriceGroupId: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { + + fun dimensionValues(): List = dimensionValues.getRequired("dimension_values") + + fun dimensionalPriceGroupId(): String = + dimensionalPriceGroupId.getRequired("dimensional_price_group_id") + + @JsonProperty("dimension_values") + @ExcludeMissing + fun _dimensionValues(): JsonField> = dimensionValues + + @JsonProperty("dimensional_price_group_id") + @ExcludeMissing + fun _dimensionalPriceGroupId(): JsonField = dimensionalPriceGroupId + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): DimensionalPriceConfiguration = apply { + if (validated) { + return@apply + } + + dimensionValues() + dimensionalPriceGroupId() + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + /** A builder for [DimensionalPriceConfiguration]. */ + class Builder internal constructor() { + + private var dimensionValues: JsonField>? = null + private var dimensionalPriceGroupId: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(dimensionalPriceConfiguration: DimensionalPriceConfiguration) = + apply { + dimensionValues = + dimensionalPriceConfiguration.dimensionValues.map { it.toMutableList() } + dimensionalPriceGroupId = + dimensionalPriceConfiguration.dimensionalPriceGroupId + additionalProperties = + dimensionalPriceConfiguration.additionalProperties.toMutableMap() + } + + fun dimensionValues(dimensionValues: List) = + dimensionValues(JsonField.of(dimensionValues)) + + fun dimensionValues(dimensionValues: JsonField>) = apply { + this.dimensionValues = dimensionValues.map { it.toMutableList() } + } + + fun addDimensionValue(dimensionValue: String) = apply { + dimensionValues = + (dimensionValues ?: JsonField.of(mutableListOf())).apply { + asKnown() + .orElseThrow { + IllegalStateException( + "Field was set to non-list type: ${javaClass.simpleName}" + ) + } + .add(dimensionValue) + } + } + + fun dimensionalPriceGroupId(dimensionalPriceGroupId: String) = + dimensionalPriceGroupId(JsonField.of(dimensionalPriceGroupId)) + + fun dimensionalPriceGroupId(dimensionalPriceGroupId: JsonField) = apply { + this.dimensionalPriceGroupId = dimensionalPriceGroupId + } + + 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(): DimensionalPriceConfiguration = + DimensionalPriceConfiguration( + checkRequired("dimensionValues", dimensionValues).map { it.toImmutable() }, + checkRequired("dimensionalPriceGroupId", dimensionalPriceGroupId), + additionalProperties.toImmutable(), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is DimensionalPriceConfiguration && dimensionValues == other.dimensionValues && dimensionalPriceGroupId == other.dimensionalPriceGroupId && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(dimensionValues, dimensionalPriceGroupId, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "DimensionalPriceConfiguration{dimensionValues=$dimensionValues, dimensionalPriceGroupId=$dimensionalPriceGroupId, additionalProperties=$additionalProperties}" + } + 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 */ + 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 && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && 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) } + 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, dimensionalPriceConfiguration, 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}" + "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, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, additionalProperties=$additionalProperties}" } @NoAutoDetect @@ -33567,6 +39791,10 @@ private constructor( @ExcludeMissing private val tieredWithProrationConfig: JsonField = JsonMissing.of(), + @JsonProperty("dimensional_price_configuration") + @ExcludeMissing + private val dimensionalPriceConfiguration: JsonField = + JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { @@ -33635,6 +39863,11 @@ private constructor( fun tieredWithProrationConfig(): TieredWithProrationConfig = tieredWithProrationConfig.getRequired("tiered_with_proration_config") + fun dimensionalPriceConfiguration(): Optional = + Optional.ofNullable( + dimensionalPriceConfiguration.getNullable("dimensional_price_configuration") + ) + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id @JsonProperty("billable_metric") @@ -33717,6 +39950,11 @@ private constructor( fun _tieredWithProrationConfig(): JsonField = tieredWithProrationConfig + @JsonProperty("dimensional_price_configuration") + @ExcludeMissing + fun _dimensionalPriceConfiguration(): JsonField = + dimensionalPriceConfiguration + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -33751,6 +39989,7 @@ private constructor( planPhaseOrder() priceType() tieredWithProrationConfig().validate() + dimensionalPriceConfiguration().ifPresent { it.validate() } validated = true } @@ -33761,7 +40000,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TieredWithProrationPrice]. */ + class Builder internal constructor() { private var id: JsonField? = null private var billableMetric: JsonField? = null @@ -33786,6 +40026,8 @@ private constructor( private var planPhaseOrder: JsonField? = null private var priceType: JsonField? = null private var tieredWithProrationConfig: JsonField? = null + private var dimensionalPriceConfiguration: JsonField = + JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -33813,6 +40055,8 @@ private constructor( planPhaseOrder = tieredWithProrationPrice.planPhaseOrder priceType = tieredWithProrationPrice.priceType tieredWithProrationConfig = tieredWithProrationPrice.tieredWithProrationConfig + dimensionalPriceConfiguration = + tieredWithProrationPrice.dimensionalPriceConfiguration additionalProperties = tieredWithProrationPrice.additionalProperties.toMutableMap() } @@ -33885,6 +40129,14 @@ private constructor( fun discount(trial: TrialDiscount) = discount(Discount.ofTrial(trial)) + fun trialDiscount(appliesToPriceIds: List) = + discount( + TrialDiscount.builder() + .discountType(TrialDiscount.DiscountType.TRIAL) + .appliesToPriceIds(appliesToPriceIds) + .build() + ) + fun discount(usage: Discount.UsageDiscount) = discount(Discount.ofUsage(usage)) fun discount(amount: AmountDiscount) = discount(Discount.ofAmount(amount)) @@ -34007,6 +40259,18 @@ private constructor( tieredWithProrationConfig: JsonField ) = apply { this.tieredWithProrationConfig = tieredWithProrationConfig } + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: DimensionalPriceConfiguration? + ) = dimensionalPriceConfiguration(JsonField.ofNullable(dimensionalPriceConfiguration)) + + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: Optional + ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.orElse(null)) + + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: JsonField + ) = apply { this.dimensionalPriceConfiguration = dimensionalPriceConfiguration } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -34051,6 +40315,7 @@ private constructor( checkRequired("planPhaseOrder", planPhaseOrder), checkRequired("priceType", priceType), checkRequired("tieredWithProrationConfig", tieredWithProrationConfig), + dimensionalPriceConfiguration, additionalProperties.toImmutable(), ) } @@ -34092,7 +40357,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillableMetric]. */ + class Builder internal constructor() { private var id: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -34198,7 +40464,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -34259,6 +40526,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -34270,17 +40545,39 @@ private constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -34288,6 +40585,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -34334,6 +40640,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -34353,6 +40667,7 @@ private constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ONE_TIME, MONTHLY, @@ -34362,6 +40677,15 @@ private constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ONE_TIME, MONTHLY, @@ -34369,9 +40693,19 @@ private constructor( SEMI_ANNUAL, ANNUAL, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { ONE_TIME -> Value.ONE_TIME @@ -34383,6 +40717,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ONE_TIME -> Known.ONE_TIME @@ -34456,7 +40799,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CreditAllocation]. */ + class Builder internal constructor() { private var allowsRollover: JsonField? = null private var currency: JsonField? = null @@ -34575,7 +40919,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -34637,6 +40982,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -34648,17 +41001,39 @@ private constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -34666,6 +41041,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -34751,7 +41135,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Item]. */ + class Builder internal constructor() { private var id: JsonField? = null private var name: JsonField? = null @@ -34880,7 +41265,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Maximum]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var maximumAmount: JsonField? = null @@ -35018,7 +41404,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -35129,7 +41516,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Minimum]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var minimumAmount: JsonField? = null @@ -35239,6 +41627,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -35248,21 +41644,51 @@ private constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { TIERED_WITH_PRORATION, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { TIERED_WITH_PRORATION, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { TIERED_WITH_PRORATION -> Value.TIERED_WITH_PRORATION else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { TIERED_WITH_PRORATION -> Known.TIERED_WITH_PRORATION @@ -35290,6 +41716,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -35301,17 +41735,38 @@ private constructor( @JvmStatic fun of(value: String) = PriceType(JsonField.of(value)) } + /** An enum containing [PriceType]'s known values. */ enum class Known { USAGE_PRICE, FIXED_PRICE, } + /** + * An enum containing [PriceType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [PriceType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { USAGE_PRICE, FIXED_PRICE, + /** + * An enum member indicating that [PriceType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { USAGE_PRICE -> Value.USAGE_PRICE @@ -35319,6 +41774,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { USAGE_PRICE -> Known.USAGE_PRICE @@ -35370,7 +41834,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TieredWithProrationConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -35424,22 +41889,165 @@ private constructor( "TieredWithProrationConfig{additionalProperties=$additionalProperties}" } + @NoAutoDetect + class DimensionalPriceConfiguration + @JsonCreator + private constructor( + @JsonProperty("dimension_values") + @ExcludeMissing + private val dimensionValues: JsonField> = JsonMissing.of(), + @JsonProperty("dimensional_price_group_id") + @ExcludeMissing + private val dimensionalPriceGroupId: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { + + fun dimensionValues(): List = dimensionValues.getRequired("dimension_values") + + fun dimensionalPriceGroupId(): String = + dimensionalPriceGroupId.getRequired("dimensional_price_group_id") + + @JsonProperty("dimension_values") + @ExcludeMissing + fun _dimensionValues(): JsonField> = dimensionValues + + @JsonProperty("dimensional_price_group_id") + @ExcludeMissing + fun _dimensionalPriceGroupId(): JsonField = dimensionalPriceGroupId + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): DimensionalPriceConfiguration = apply { + if (validated) { + return@apply + } + + dimensionValues() + dimensionalPriceGroupId() + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + /** A builder for [DimensionalPriceConfiguration]. */ + class Builder internal constructor() { + + private var dimensionValues: JsonField>? = null + private var dimensionalPriceGroupId: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(dimensionalPriceConfiguration: DimensionalPriceConfiguration) = + apply { + dimensionValues = + dimensionalPriceConfiguration.dimensionValues.map { it.toMutableList() } + dimensionalPriceGroupId = + dimensionalPriceConfiguration.dimensionalPriceGroupId + additionalProperties = + dimensionalPriceConfiguration.additionalProperties.toMutableMap() + } + + fun dimensionValues(dimensionValues: List) = + dimensionValues(JsonField.of(dimensionValues)) + + fun dimensionValues(dimensionValues: JsonField>) = apply { + this.dimensionValues = dimensionValues.map { it.toMutableList() } + } + + fun addDimensionValue(dimensionValue: String) = apply { + dimensionValues = + (dimensionValues ?: JsonField.of(mutableListOf())).apply { + asKnown() + .orElseThrow { + IllegalStateException( + "Field was set to non-list type: ${javaClass.simpleName}" + ) + } + .add(dimensionValue) + } + } + + fun dimensionalPriceGroupId(dimensionalPriceGroupId: String) = + dimensionalPriceGroupId(JsonField.of(dimensionalPriceGroupId)) + + fun dimensionalPriceGroupId(dimensionalPriceGroupId: JsonField) = apply { + this.dimensionalPriceGroupId = dimensionalPriceGroupId + } + + 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(): DimensionalPriceConfiguration = + DimensionalPriceConfiguration( + checkRequired("dimensionValues", dimensionValues).map { it.toImmutable() }, + checkRequired("dimensionalPriceGroupId", dimensionalPriceGroupId), + additionalProperties.toImmutable(), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is DimensionalPriceConfiguration && dimensionValues == other.dimensionValues && dimensionalPriceGroupId == other.dimensionalPriceGroupId && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(dimensionValues, dimensionalPriceGroupId, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "DimensionalPriceConfiguration{dimensionValues=$dimensionValues, dimensionalPriceGroupId=$dimensionalPriceGroupId, additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { 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 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 && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && 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, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, tieredWithProrationConfig, dimensionalPriceConfiguration, 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}" + "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, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, additionalProperties=$additionalProperties}" } @NoAutoDetect @@ -35513,6 +42121,10 @@ private constructor( @JsonProperty("unit_with_proration_config") @ExcludeMissing private val unitWithProrationConfig: JsonField = JsonMissing.of(), + @JsonProperty("dimensional_price_configuration") + @ExcludeMissing + private val dimensionalPriceConfiguration: JsonField = + JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { @@ -35581,6 +42193,11 @@ private constructor( fun unitWithProrationConfig(): UnitWithProrationConfig = unitWithProrationConfig.getRequired("unit_with_proration_config") + fun dimensionalPriceConfiguration(): Optional = + Optional.ofNullable( + dimensionalPriceConfiguration.getNullable("dimensional_price_configuration") + ) + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id @JsonProperty("billable_metric") @@ -35662,6 +42279,11 @@ private constructor( @ExcludeMissing fun _unitWithProrationConfig(): JsonField = unitWithProrationConfig + @JsonProperty("dimensional_price_configuration") + @ExcludeMissing + fun _dimensionalPriceConfiguration(): JsonField = + dimensionalPriceConfiguration + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -35696,6 +42318,7 @@ private constructor( planPhaseOrder() priceType() unitWithProrationConfig().validate() + dimensionalPriceConfiguration().ifPresent { it.validate() } validated = true } @@ -35706,7 +42329,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [UnitWithProrationPrice]. */ + class Builder internal constructor() { private var id: JsonField? = null private var billableMetric: JsonField? = null @@ -35731,6 +42355,8 @@ private constructor( private var planPhaseOrder: JsonField? = null private var priceType: JsonField? = null private var unitWithProrationConfig: JsonField? = null + private var dimensionalPriceConfiguration: JsonField = + JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -35758,6 +42384,7 @@ private constructor( planPhaseOrder = unitWithProrationPrice.planPhaseOrder priceType = unitWithProrationPrice.priceType unitWithProrationConfig = unitWithProrationPrice.unitWithProrationConfig + dimensionalPriceConfiguration = unitWithProrationPrice.dimensionalPriceConfiguration additionalProperties = unitWithProrationPrice.additionalProperties.toMutableMap() } @@ -35830,6 +42457,14 @@ private constructor( fun discount(trial: TrialDiscount) = discount(Discount.ofTrial(trial)) + fun trialDiscount(appliesToPriceIds: List) = + discount( + TrialDiscount.builder() + .discountType(TrialDiscount.DiscountType.TRIAL) + .appliesToPriceIds(appliesToPriceIds) + .build() + ) + fun discount(usage: Discount.UsageDiscount) = discount(Discount.ofUsage(usage)) fun discount(amount: AmountDiscount) = discount(Discount.ofAmount(amount)) @@ -35952,6 +42587,18 @@ private constructor( unitWithProrationConfig: JsonField ) = apply { this.unitWithProrationConfig = unitWithProrationConfig } + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: DimensionalPriceConfiguration? + ) = dimensionalPriceConfiguration(JsonField.ofNullable(dimensionalPriceConfiguration)) + + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: Optional + ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.orElse(null)) + + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: JsonField + ) = apply { this.dimensionalPriceConfiguration = dimensionalPriceConfiguration } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -35996,6 +42643,7 @@ private constructor( checkRequired("planPhaseOrder", planPhaseOrder), checkRequired("priceType", priceType), checkRequired("unitWithProrationConfig", unitWithProrationConfig), + dimensionalPriceConfiguration, additionalProperties.toImmutable(), ) } @@ -36037,7 +42685,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillableMetric]. */ + class Builder internal constructor() { private var id: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -36143,7 +42792,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -36204,6 +42854,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -36215,17 +42873,39 @@ private constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -36233,6 +42913,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -36279,6 +42968,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -36298,6 +42995,7 @@ private constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ONE_TIME, MONTHLY, @@ -36307,6 +43005,15 @@ private constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ONE_TIME, MONTHLY, @@ -36314,9 +43021,19 @@ private constructor( SEMI_ANNUAL, ANNUAL, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { ONE_TIME -> Value.ONE_TIME @@ -36328,6 +43045,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ONE_TIME -> Known.ONE_TIME @@ -36401,7 +43127,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CreditAllocation]. */ + class Builder internal constructor() { private var allowsRollover: JsonField? = null private var currency: JsonField? = null @@ -36520,7 +43247,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -36582,6 +43310,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -36593,17 +43329,39 @@ private constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -36611,6 +43369,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -36696,7 +43463,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Item]. */ + class Builder internal constructor() { private var id: JsonField? = null private var name: JsonField? = null @@ -36825,7 +43593,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Maximum]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var maximumAmount: JsonField? = null @@ -36963,7 +43732,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -37074,7 +43844,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Minimum]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var minimumAmount: JsonField? = null @@ -37184,6 +43955,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -37193,21 +43972,51 @@ private constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { UNIT_WITH_PRORATION, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { UNIT_WITH_PRORATION, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { UNIT_WITH_PRORATION -> Value.UNIT_WITH_PRORATION else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { UNIT_WITH_PRORATION -> Known.UNIT_WITH_PRORATION @@ -37235,6 +44044,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -37246,17 +44063,38 @@ private constructor( @JvmStatic fun of(value: String) = PriceType(JsonField.of(value)) } + /** An enum containing [PriceType]'s known values. */ enum class Known { USAGE_PRICE, FIXED_PRICE, } + /** + * An enum containing [PriceType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [PriceType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { USAGE_PRICE, FIXED_PRICE, + /** + * An enum member indicating that [PriceType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { USAGE_PRICE -> Value.USAGE_PRICE @@ -37264,6 +44102,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { USAGE_PRICE -> Known.USAGE_PRICE @@ -37315,7 +44162,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [UnitWithProrationConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -37369,22 +44217,165 @@ private constructor( "UnitWithProrationConfig{additionalProperties=$additionalProperties}" } + @NoAutoDetect + class DimensionalPriceConfiguration + @JsonCreator + private constructor( + @JsonProperty("dimension_values") + @ExcludeMissing + private val dimensionValues: JsonField> = JsonMissing.of(), + @JsonProperty("dimensional_price_group_id") + @ExcludeMissing + private val dimensionalPriceGroupId: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { + + fun dimensionValues(): List = dimensionValues.getRequired("dimension_values") + + fun dimensionalPriceGroupId(): String = + dimensionalPriceGroupId.getRequired("dimensional_price_group_id") + + @JsonProperty("dimension_values") + @ExcludeMissing + fun _dimensionValues(): JsonField> = dimensionValues + + @JsonProperty("dimensional_price_group_id") + @ExcludeMissing + fun _dimensionalPriceGroupId(): JsonField = dimensionalPriceGroupId + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): DimensionalPriceConfiguration = apply { + if (validated) { + return@apply + } + + dimensionValues() + dimensionalPriceGroupId() + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + /** A builder for [DimensionalPriceConfiguration]. */ + class Builder internal constructor() { + + private var dimensionValues: JsonField>? = null + private var dimensionalPriceGroupId: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(dimensionalPriceConfiguration: DimensionalPriceConfiguration) = + apply { + dimensionValues = + dimensionalPriceConfiguration.dimensionValues.map { it.toMutableList() } + dimensionalPriceGroupId = + dimensionalPriceConfiguration.dimensionalPriceGroupId + additionalProperties = + dimensionalPriceConfiguration.additionalProperties.toMutableMap() + } + + fun dimensionValues(dimensionValues: List) = + dimensionValues(JsonField.of(dimensionValues)) + + fun dimensionValues(dimensionValues: JsonField>) = apply { + this.dimensionValues = dimensionValues.map { it.toMutableList() } + } + + fun addDimensionValue(dimensionValue: String) = apply { + dimensionValues = + (dimensionValues ?: JsonField.of(mutableListOf())).apply { + asKnown() + .orElseThrow { + IllegalStateException( + "Field was set to non-list type: ${javaClass.simpleName}" + ) + } + .add(dimensionValue) + } + } + + fun dimensionalPriceGroupId(dimensionalPriceGroupId: String) = + dimensionalPriceGroupId(JsonField.of(dimensionalPriceGroupId)) + + fun dimensionalPriceGroupId(dimensionalPriceGroupId: JsonField) = apply { + this.dimensionalPriceGroupId = dimensionalPriceGroupId + } + + 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(): DimensionalPriceConfiguration = + DimensionalPriceConfiguration( + checkRequired("dimensionValues", dimensionValues).map { it.toImmutable() }, + checkRequired("dimensionalPriceGroupId", dimensionalPriceGroupId), + additionalProperties.toImmutable(), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is DimensionalPriceConfiguration && dimensionValues == other.dimensionValues && dimensionalPriceGroupId == other.dimensionalPriceGroupId && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(dimensionValues, dimensionalPriceGroupId, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "DimensionalPriceConfiguration{dimensionValues=$dimensionValues, dimensionalPriceGroupId=$dimensionalPriceGroupId, additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { 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 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 && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && 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, unitWithProrationConfig, dimensionalPriceConfiguration, 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}" + "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, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, additionalProperties=$additionalProperties}" } @NoAutoDetect @@ -37458,6 +44449,10 @@ private constructor( @JsonProperty("price_type") @ExcludeMissing private val priceType: JsonField = JsonMissing.of(), + @JsonProperty("dimensional_price_configuration") + @ExcludeMissing + private val dimensionalPriceConfiguration: JsonField = + JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { @@ -37526,6 +44521,11 @@ private constructor( fun priceType(): PriceType = priceType.getRequired("price_type") + fun dimensionalPriceConfiguration(): Optional = + Optional.ofNullable( + dimensionalPriceConfiguration.getNullable("dimensional_price_configuration") + ) + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id @JsonProperty("billable_metric") @@ -37607,6 +44607,11 @@ private constructor( @ExcludeMissing fun _priceType(): JsonField = priceType + @JsonProperty("dimensional_price_configuration") + @ExcludeMissing + fun _dimensionalPriceConfiguration(): JsonField = + dimensionalPriceConfiguration + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -37641,6 +44646,7 @@ private constructor( name() planPhaseOrder() priceType() + dimensionalPriceConfiguration().ifPresent { it.validate() } validated = true } @@ -37651,7 +44657,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [GroupedAllocationPrice]. */ + class Builder internal constructor() { private var id: JsonField? = null private var billableMetric: JsonField? = null @@ -37676,6 +44683,8 @@ private constructor( private var name: JsonField? = null private var planPhaseOrder: JsonField? = null private var priceType: JsonField? = null + private var dimensionalPriceConfiguration: JsonField = + JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -37703,6 +44712,7 @@ private constructor( name = groupedAllocationPrice.name planPhaseOrder = groupedAllocationPrice.planPhaseOrder priceType = groupedAllocationPrice.priceType + dimensionalPriceConfiguration = groupedAllocationPrice.dimensionalPriceConfiguration additionalProperties = groupedAllocationPrice.additionalProperties.toMutableMap() } @@ -37775,6 +44785,14 @@ private constructor( fun discount(trial: TrialDiscount) = discount(Discount.ofTrial(trial)) + fun trialDiscount(appliesToPriceIds: List) = + discount( + TrialDiscount.builder() + .discountType(TrialDiscount.DiscountType.TRIAL) + .appliesToPriceIds(appliesToPriceIds) + .build() + ) + fun discount(usage: Discount.UsageDiscount) = discount(Discount.ofUsage(usage)) fun discount(amount: AmountDiscount) = discount(Discount.ofAmount(amount)) @@ -37897,6 +44915,18 @@ private constructor( fun priceType(priceType: JsonField) = apply { this.priceType = priceType } + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: DimensionalPriceConfiguration? + ) = dimensionalPriceConfiguration(JsonField.ofNullable(dimensionalPriceConfiguration)) + + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: Optional + ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.orElse(null)) + + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: JsonField + ) = apply { this.dimensionalPriceConfiguration = dimensionalPriceConfiguration } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -37941,6 +44971,7 @@ private constructor( checkRequired("name", name), checkRequired("planPhaseOrder", planPhaseOrder), checkRequired("priceType", priceType), + dimensionalPriceConfiguration, additionalProperties.toImmutable(), ) } @@ -37982,7 +45013,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillableMetric]. */ + class Builder internal constructor() { private var id: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -38088,7 +45120,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -38149,6 +45182,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -38160,17 +45201,39 @@ private constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -38178,6 +45241,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -38224,6 +45296,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -38243,6 +45323,7 @@ private constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ONE_TIME, MONTHLY, @@ -38252,6 +45333,15 @@ private constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ONE_TIME, MONTHLY, @@ -38259,9 +45349,19 @@ private constructor( SEMI_ANNUAL, ANNUAL, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { ONE_TIME -> Value.ONE_TIME @@ -38273,6 +45373,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ONE_TIME -> Known.ONE_TIME @@ -38346,7 +45455,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CreditAllocation]. */ + class Builder internal constructor() { private var allowsRollover: JsonField? = null private var currency: JsonField? = null @@ -38447,7 +45557,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [GroupedAllocationConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -38548,7 +45659,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -38610,6 +45722,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -38621,17 +45741,39 @@ private constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -38639,6 +45781,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -38724,7 +45875,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Item]. */ + class Builder internal constructor() { private var id: JsonField? = null private var name: JsonField? = null @@ -38853,7 +46005,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Maximum]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var maximumAmount: JsonField? = null @@ -38991,7 +46144,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -39102,7 +46256,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Minimum]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var minimumAmount: JsonField? = null @@ -39212,6 +46367,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -39221,21 +46384,51 @@ private constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { GROUPED_ALLOCATION, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { GROUPED_ALLOCATION, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { GROUPED_ALLOCATION -> Value.GROUPED_ALLOCATION else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { GROUPED_ALLOCATION -> Known.GROUPED_ALLOCATION @@ -39263,6 +46456,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -39274,17 +46475,38 @@ private constructor( @JvmStatic fun of(value: String) = PriceType(JsonField.of(value)) } + /** An enum containing [PriceType]'s known values. */ enum class Known { USAGE_PRICE, FIXED_PRICE, } + /** + * An enum containing [PriceType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [PriceType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { USAGE_PRICE, FIXED_PRICE, + /** + * An enum member indicating that [PriceType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { USAGE_PRICE -> Value.USAGE_PRICE @@ -39292,6 +46514,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { USAGE_PRICE -> Known.USAGE_PRICE @@ -39314,22 +46545,165 @@ private constructor( override fun toString() = value.toString() } + @NoAutoDetect + class DimensionalPriceConfiguration + @JsonCreator + private constructor( + @JsonProperty("dimension_values") + @ExcludeMissing + private val dimensionValues: JsonField> = JsonMissing.of(), + @JsonProperty("dimensional_price_group_id") + @ExcludeMissing + private val dimensionalPriceGroupId: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { + + fun dimensionValues(): List = dimensionValues.getRequired("dimension_values") + + fun dimensionalPriceGroupId(): String = + dimensionalPriceGroupId.getRequired("dimensional_price_group_id") + + @JsonProperty("dimension_values") + @ExcludeMissing + fun _dimensionValues(): JsonField> = dimensionValues + + @JsonProperty("dimensional_price_group_id") + @ExcludeMissing + fun _dimensionalPriceGroupId(): JsonField = dimensionalPriceGroupId + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): DimensionalPriceConfiguration = apply { + if (validated) { + return@apply + } + + dimensionValues() + dimensionalPriceGroupId() + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + /** A builder for [DimensionalPriceConfiguration]. */ + class Builder internal constructor() { + + private var dimensionValues: JsonField>? = null + private var dimensionalPriceGroupId: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(dimensionalPriceConfiguration: DimensionalPriceConfiguration) = + apply { + dimensionValues = + dimensionalPriceConfiguration.dimensionValues.map { it.toMutableList() } + dimensionalPriceGroupId = + dimensionalPriceConfiguration.dimensionalPriceGroupId + additionalProperties = + dimensionalPriceConfiguration.additionalProperties.toMutableMap() + } + + fun dimensionValues(dimensionValues: List) = + dimensionValues(JsonField.of(dimensionValues)) + + fun dimensionValues(dimensionValues: JsonField>) = apply { + this.dimensionValues = dimensionValues.map { it.toMutableList() } + } + + fun addDimensionValue(dimensionValue: String) = apply { + dimensionValues = + (dimensionValues ?: JsonField.of(mutableListOf())).apply { + asKnown() + .orElseThrow { + IllegalStateException( + "Field was set to non-list type: ${javaClass.simpleName}" + ) + } + .add(dimensionValue) + } + } + + fun dimensionalPriceGroupId(dimensionalPriceGroupId: String) = + dimensionalPriceGroupId(JsonField.of(dimensionalPriceGroupId)) + + fun dimensionalPriceGroupId(dimensionalPriceGroupId: JsonField) = apply { + this.dimensionalPriceGroupId = dimensionalPriceGroupId + } + + 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(): DimensionalPriceConfiguration = + DimensionalPriceConfiguration( + checkRequired("dimensionValues", dimensionValues).map { it.toImmutable() }, + checkRequired("dimensionalPriceGroupId", dimensionalPriceGroupId), + additionalProperties.toImmutable(), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is DimensionalPriceConfiguration && dimensionValues == other.dimensionValues && dimensionalPriceGroupId == other.dimensionalPriceGroupId && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(dimensionValues, dimensionalPriceGroupId, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "DimensionalPriceConfiguration{dimensionValues=$dimensionValues, dimensionalPriceGroupId=$dimensionalPriceGroupId, 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 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 && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && 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, groupedAllocationConfig, invoicingCycleConfiguration, item, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, dimensionalPriceConfiguration, 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}" + "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, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, additionalProperties=$additionalProperties}" } @NoAutoDetect @@ -39404,6 +46778,10 @@ private constructor( @JsonProperty("price_type") @ExcludeMissing private val priceType: JsonField = JsonMissing.of(), + @JsonProperty("dimensional_price_configuration") + @ExcludeMissing + private val dimensionalPriceConfiguration: JsonField = + JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { @@ -39472,6 +46850,11 @@ private constructor( fun priceType(): PriceType = priceType.getRequired("price_type") + fun dimensionalPriceConfiguration(): Optional = + Optional.ofNullable( + dimensionalPriceConfiguration.getNullable("dimensional_price_configuration") + ) + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id @JsonProperty("billable_metric") @@ -39554,6 +46937,11 @@ private constructor( @ExcludeMissing fun _priceType(): JsonField = priceType + @JsonProperty("dimensional_price_configuration") + @ExcludeMissing + fun _dimensionalPriceConfiguration(): JsonField = + dimensionalPriceConfiguration + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -39588,6 +46976,7 @@ private constructor( name() planPhaseOrder() priceType() + dimensionalPriceConfiguration().ifPresent { it.validate() } validated = true } @@ -39598,7 +46987,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [GroupedWithProratedMinimumPrice]. */ + class Builder internal constructor() { private var id: JsonField? = null private var billableMetric: JsonField? = null @@ -39625,6 +47015,8 @@ private constructor( private var name: JsonField? = null private var planPhaseOrder: JsonField? = null private var priceType: JsonField? = null + private var dimensionalPriceConfiguration: JsonField = + JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -39656,6 +47048,8 @@ private constructor( name = groupedWithProratedMinimumPrice.name planPhaseOrder = groupedWithProratedMinimumPrice.planPhaseOrder priceType = groupedWithProratedMinimumPrice.priceType + dimensionalPriceConfiguration = + groupedWithProratedMinimumPrice.dimensionalPriceConfiguration additionalProperties = groupedWithProratedMinimumPrice.additionalProperties.toMutableMap() } @@ -39729,6 +47123,14 @@ private constructor( fun discount(trial: TrialDiscount) = discount(Discount.ofTrial(trial)) + fun trialDiscount(appliesToPriceIds: List) = + discount( + TrialDiscount.builder() + .discountType(TrialDiscount.DiscountType.TRIAL) + .appliesToPriceIds(appliesToPriceIds) + .build() + ) + fun discount(usage: Discount.UsageDiscount) = discount(Discount.ofUsage(usage)) fun discount(amount: AmountDiscount) = discount(Discount.ofAmount(amount)) @@ -39852,6 +47254,18 @@ private constructor( fun priceType(priceType: JsonField) = apply { this.priceType = priceType } + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: DimensionalPriceConfiguration? + ) = dimensionalPriceConfiguration(JsonField.ofNullable(dimensionalPriceConfiguration)) + + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: Optional + ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.orElse(null)) + + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: JsonField + ) = apply { this.dimensionalPriceConfiguration = dimensionalPriceConfiguration } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -39899,6 +47313,7 @@ private constructor( checkRequired("name", name), checkRequired("planPhaseOrder", planPhaseOrder), checkRequired("priceType", priceType), + dimensionalPriceConfiguration, additionalProperties.toImmutable(), ) } @@ -39940,7 +47355,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillableMetric]. */ + class Builder internal constructor() { private var id: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -40046,7 +47462,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -40107,6 +47524,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -40118,17 +47543,39 @@ private constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -40136,6 +47583,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -40182,6 +47638,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -40201,6 +47665,7 @@ private constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ONE_TIME, MONTHLY, @@ -40210,6 +47675,15 @@ private constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ONE_TIME, MONTHLY, @@ -40217,9 +47691,19 @@ private constructor( SEMI_ANNUAL, ANNUAL, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { ONE_TIME -> Value.ONE_TIME @@ -40231,6 +47715,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ONE_TIME -> Known.ONE_TIME @@ -40304,7 +47797,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CreditAllocation]. */ + class Builder internal constructor() { private var allowsRollover: JsonField? = null private var currency: JsonField? = null @@ -40405,7 +47899,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [GroupedWithProratedMinimumConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -40508,7 +48003,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -40570,6 +48066,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -40581,17 +48085,39 @@ private constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -40599,6 +48125,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -40684,7 +48219,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Item]. */ + class Builder internal constructor() { private var id: JsonField? = null private var name: JsonField? = null @@ -40813,7 +48349,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Maximum]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var maximumAmount: JsonField? = null @@ -40951,7 +48488,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -41062,7 +48600,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Minimum]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var minimumAmount: JsonField? = null @@ -41172,6 +48711,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -41181,21 +48728,51 @@ private constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { GROUPED_WITH_PRORATED_MINIMUM, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { GROUPED_WITH_PRORATED_MINIMUM, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { GROUPED_WITH_PRORATED_MINIMUM -> Value.GROUPED_WITH_PRORATED_MINIMUM else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { GROUPED_WITH_PRORATED_MINIMUM -> Known.GROUPED_WITH_PRORATED_MINIMUM @@ -41223,6 +48800,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -41234,17 +48819,38 @@ private constructor( @JvmStatic fun of(value: String) = PriceType(JsonField.of(value)) } + /** An enum containing [PriceType]'s known values. */ enum class Known { USAGE_PRICE, FIXED_PRICE, } + /** + * An enum containing [PriceType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [PriceType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { USAGE_PRICE, FIXED_PRICE, + /** + * An enum member indicating that [PriceType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { USAGE_PRICE -> Value.USAGE_PRICE @@ -41252,6 +48858,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { USAGE_PRICE -> Known.USAGE_PRICE @@ -41274,22 +48889,165 @@ private constructor( override fun toString() = value.toString() } + @NoAutoDetect + class DimensionalPriceConfiguration + @JsonCreator + private constructor( + @JsonProperty("dimension_values") + @ExcludeMissing + private val dimensionValues: JsonField> = JsonMissing.of(), + @JsonProperty("dimensional_price_group_id") + @ExcludeMissing + private val dimensionalPriceGroupId: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { + + fun dimensionValues(): List = dimensionValues.getRequired("dimension_values") + + fun dimensionalPriceGroupId(): String = + dimensionalPriceGroupId.getRequired("dimensional_price_group_id") + + @JsonProperty("dimension_values") + @ExcludeMissing + fun _dimensionValues(): JsonField> = dimensionValues + + @JsonProperty("dimensional_price_group_id") + @ExcludeMissing + fun _dimensionalPriceGroupId(): JsonField = dimensionalPriceGroupId + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): DimensionalPriceConfiguration = apply { + if (validated) { + return@apply + } + + dimensionValues() + dimensionalPriceGroupId() + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + /** A builder for [DimensionalPriceConfiguration]. */ + class Builder internal constructor() { + + private var dimensionValues: JsonField>? = null + private var dimensionalPriceGroupId: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(dimensionalPriceConfiguration: DimensionalPriceConfiguration) = + apply { + dimensionValues = + dimensionalPriceConfiguration.dimensionValues.map { it.toMutableList() } + dimensionalPriceGroupId = + dimensionalPriceConfiguration.dimensionalPriceGroupId + additionalProperties = + dimensionalPriceConfiguration.additionalProperties.toMutableMap() + } + + fun dimensionValues(dimensionValues: List) = + dimensionValues(JsonField.of(dimensionValues)) + + fun dimensionValues(dimensionValues: JsonField>) = apply { + this.dimensionValues = dimensionValues.map { it.toMutableList() } + } + + fun addDimensionValue(dimensionValue: String) = apply { + dimensionValues = + (dimensionValues ?: JsonField.of(mutableListOf())).apply { + asKnown() + .orElseThrow { + IllegalStateException( + "Field was set to non-list type: ${javaClass.simpleName}" + ) + } + .add(dimensionValue) + } + } + + fun dimensionalPriceGroupId(dimensionalPriceGroupId: String) = + dimensionalPriceGroupId(JsonField.of(dimensionalPriceGroupId)) + + fun dimensionalPriceGroupId(dimensionalPriceGroupId: JsonField) = apply { + this.dimensionalPriceGroupId = dimensionalPriceGroupId + } + + 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(): DimensionalPriceConfiguration = + DimensionalPriceConfiguration( + checkRequired("dimensionValues", dimensionValues).map { it.toImmutable() }, + checkRequired("dimensionalPriceGroupId", dimensionalPriceGroupId), + additionalProperties.toImmutable(), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is DimensionalPriceConfiguration && dimensionValues == other.dimensionValues && dimensionalPriceGroupId == other.dimensionalPriceGroupId && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(dimensionValues, dimensionalPriceGroupId, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "DimensionalPriceConfiguration{dimensionValues=$dimensionValues, dimensionalPriceGroupId=$dimensionalPriceGroupId, additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { 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 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 && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && 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, groupedWithProratedMinimumConfig, invoicingCycleConfiguration, item, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, dimensionalPriceConfiguration, 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}" + "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, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, additionalProperties=$additionalProperties}" } @NoAutoDetect @@ -41364,6 +49122,10 @@ private constructor( @JsonProperty("price_type") @ExcludeMissing private val priceType: JsonField = JsonMissing.of(), + @JsonProperty("dimensional_price_configuration") + @ExcludeMissing + private val dimensionalPriceConfiguration: JsonField = + JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { @@ -41432,6 +49194,11 @@ private constructor( fun priceType(): PriceType = priceType.getRequired("price_type") + fun dimensionalPriceConfiguration(): Optional = + Optional.ofNullable( + dimensionalPriceConfiguration.getNullable("dimensional_price_configuration") + ) + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id @JsonProperty("billable_metric") @@ -41514,6 +49281,11 @@ private constructor( @ExcludeMissing fun _priceType(): JsonField = priceType + @JsonProperty("dimensional_price_configuration") + @ExcludeMissing + fun _dimensionalPriceConfiguration(): JsonField = + dimensionalPriceConfiguration + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -41548,6 +49320,7 @@ private constructor( name() planPhaseOrder() priceType() + dimensionalPriceConfiguration().ifPresent { it.validate() } validated = true } @@ -41558,7 +49331,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [GroupedWithMeteredMinimumPrice]. */ + class Builder internal constructor() { private var id: JsonField? = null private var billableMetric: JsonField? = null @@ -41585,6 +49359,8 @@ private constructor( private var name: JsonField? = null private var planPhaseOrder: JsonField? = null private var priceType: JsonField? = null + private var dimensionalPriceConfiguration: JsonField = + JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -41616,6 +49392,8 @@ private constructor( name = groupedWithMeteredMinimumPrice.name planPhaseOrder = groupedWithMeteredMinimumPrice.planPhaseOrder priceType = groupedWithMeteredMinimumPrice.priceType + dimensionalPriceConfiguration = + groupedWithMeteredMinimumPrice.dimensionalPriceConfiguration additionalProperties = groupedWithMeteredMinimumPrice.additionalProperties.toMutableMap() } @@ -41689,6 +49467,14 @@ private constructor( fun discount(trial: TrialDiscount) = discount(Discount.ofTrial(trial)) + fun trialDiscount(appliesToPriceIds: List) = + discount( + TrialDiscount.builder() + .discountType(TrialDiscount.DiscountType.TRIAL) + .appliesToPriceIds(appliesToPriceIds) + .build() + ) + fun discount(usage: Discount.UsageDiscount) = discount(Discount.ofUsage(usage)) fun discount(amount: AmountDiscount) = discount(Discount.ofAmount(amount)) @@ -41812,6 +49598,18 @@ private constructor( fun priceType(priceType: JsonField) = apply { this.priceType = priceType } + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: DimensionalPriceConfiguration? + ) = dimensionalPriceConfiguration(JsonField.ofNullable(dimensionalPriceConfiguration)) + + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: Optional + ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.orElse(null)) + + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: JsonField + ) = apply { this.dimensionalPriceConfiguration = dimensionalPriceConfiguration } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -41859,6 +49657,7 @@ private constructor( checkRequired("name", name), checkRequired("planPhaseOrder", planPhaseOrder), checkRequired("priceType", priceType), + dimensionalPriceConfiguration, additionalProperties.toImmutable(), ) } @@ -41900,7 +49699,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillableMetric]. */ + class Builder internal constructor() { private var id: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -42006,7 +49806,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -42067,6 +49868,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -42078,17 +49887,39 @@ private constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -42096,6 +49927,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -42142,6 +49982,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -42161,6 +50009,7 @@ private constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ONE_TIME, MONTHLY, @@ -42170,6 +50019,15 @@ private constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ONE_TIME, MONTHLY, @@ -42177,9 +50035,19 @@ private constructor( SEMI_ANNUAL, ANNUAL, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { ONE_TIME -> Value.ONE_TIME @@ -42191,6 +50059,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ONE_TIME -> Known.ONE_TIME @@ -42264,7 +50141,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CreditAllocation]. */ + class Builder internal constructor() { private var allowsRollover: JsonField? = null private var currency: JsonField? = null @@ -42365,7 +50243,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [GroupedWithMeteredMinimumConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -42468,7 +50347,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -42530,6 +50410,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -42541,17 +50429,39 @@ private constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -42559,6 +50469,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -42644,7 +50563,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Item]. */ + class Builder internal constructor() { private var id: JsonField? = null private var name: JsonField? = null @@ -42773,7 +50693,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Maximum]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var maximumAmount: JsonField? = null @@ -42911,7 +50832,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -43022,7 +50944,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Minimum]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var minimumAmount: JsonField? = null @@ -43132,6 +51055,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -43141,21 +51072,51 @@ private constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { GROUPED_WITH_METERED_MINIMUM, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { GROUPED_WITH_METERED_MINIMUM, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { GROUPED_WITH_METERED_MINIMUM -> Value.GROUPED_WITH_METERED_MINIMUM else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { GROUPED_WITH_METERED_MINIMUM -> Known.GROUPED_WITH_METERED_MINIMUM @@ -43183,6 +51144,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -43194,17 +51163,38 @@ private constructor( @JvmStatic fun of(value: String) = PriceType(JsonField.of(value)) } + /** An enum containing [PriceType]'s known values. */ enum class Known { USAGE_PRICE, FIXED_PRICE, } + /** + * An enum containing [PriceType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [PriceType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { USAGE_PRICE, FIXED_PRICE, + /** + * An enum member indicating that [PriceType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { USAGE_PRICE -> Value.USAGE_PRICE @@ -43212,6 +51202,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { USAGE_PRICE -> Known.USAGE_PRICE @@ -43234,22 +51233,165 @@ private constructor( override fun toString() = value.toString() } + @NoAutoDetect + class DimensionalPriceConfiguration + @JsonCreator + private constructor( + @JsonProperty("dimension_values") + @ExcludeMissing + private val dimensionValues: JsonField> = JsonMissing.of(), + @JsonProperty("dimensional_price_group_id") + @ExcludeMissing + private val dimensionalPriceGroupId: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { + + fun dimensionValues(): List = dimensionValues.getRequired("dimension_values") + + fun dimensionalPriceGroupId(): String = + dimensionalPriceGroupId.getRequired("dimensional_price_group_id") + + @JsonProperty("dimension_values") + @ExcludeMissing + fun _dimensionValues(): JsonField> = dimensionValues + + @JsonProperty("dimensional_price_group_id") + @ExcludeMissing + fun _dimensionalPriceGroupId(): JsonField = dimensionalPriceGroupId + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): DimensionalPriceConfiguration = apply { + if (validated) { + return@apply + } + + dimensionValues() + dimensionalPriceGroupId() + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + /** A builder for [DimensionalPriceConfiguration]. */ + class Builder internal constructor() { + + private var dimensionValues: JsonField>? = null + private var dimensionalPriceGroupId: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(dimensionalPriceConfiguration: DimensionalPriceConfiguration) = + apply { + dimensionValues = + dimensionalPriceConfiguration.dimensionValues.map { it.toMutableList() } + dimensionalPriceGroupId = + dimensionalPriceConfiguration.dimensionalPriceGroupId + additionalProperties = + dimensionalPriceConfiguration.additionalProperties.toMutableMap() + } + + fun dimensionValues(dimensionValues: List) = + dimensionValues(JsonField.of(dimensionValues)) + + fun dimensionValues(dimensionValues: JsonField>) = apply { + this.dimensionValues = dimensionValues.map { it.toMutableList() } + } + + fun addDimensionValue(dimensionValue: String) = apply { + dimensionValues = + (dimensionValues ?: JsonField.of(mutableListOf())).apply { + asKnown() + .orElseThrow { + IllegalStateException( + "Field was set to non-list type: ${javaClass.simpleName}" + ) + } + .add(dimensionValue) + } + } + + fun dimensionalPriceGroupId(dimensionalPriceGroupId: String) = + dimensionalPriceGroupId(JsonField.of(dimensionalPriceGroupId)) + + fun dimensionalPriceGroupId(dimensionalPriceGroupId: JsonField) = apply { + this.dimensionalPriceGroupId = dimensionalPriceGroupId + } + + 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(): DimensionalPriceConfiguration = + DimensionalPriceConfiguration( + checkRequired("dimensionValues", dimensionValues).map { it.toImmutable() }, + checkRequired("dimensionalPriceGroupId", dimensionalPriceGroupId), + additionalProperties.toImmutable(), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is DimensionalPriceConfiguration && dimensionValues == other.dimensionValues && dimensionalPriceGroupId == other.dimensionalPriceGroupId && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(dimensionValues, dimensionalPriceGroupId, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "DimensionalPriceConfiguration{dimensionValues=$dimensionValues, dimensionalPriceGroupId=$dimensionalPriceGroupId, additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { 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 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 && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && 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, groupedWithMeteredMinimumConfig, invoicingCycleConfiguration, item, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, dimensionalPriceConfiguration, 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}" + "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, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, additionalProperties=$additionalProperties}" } @NoAutoDetect @@ -43324,6 +51466,10 @@ private constructor( @JsonProperty("price_type") @ExcludeMissing private val priceType: JsonField = JsonMissing.of(), + @JsonProperty("dimensional_price_configuration") + @ExcludeMissing + private val dimensionalPriceConfiguration: JsonField = + JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { @@ -43392,6 +51538,11 @@ private constructor( fun priceType(): PriceType = priceType.getRequired("price_type") + fun dimensionalPriceConfiguration(): Optional = + Optional.ofNullable( + dimensionalPriceConfiguration.getNullable("dimensional_price_configuration") + ) + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id @JsonProperty("billable_metric") @@ -43474,6 +51625,11 @@ private constructor( @ExcludeMissing fun _priceType(): JsonField = priceType + @JsonProperty("dimensional_price_configuration") + @ExcludeMissing + fun _dimensionalPriceConfiguration(): JsonField = + dimensionalPriceConfiguration + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -43508,6 +51664,7 @@ private constructor( name() planPhaseOrder() priceType() + dimensionalPriceConfiguration().ifPresent { it.validate() } validated = true } @@ -43518,7 +51675,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MatrixWithDisplayNamePrice]. */ + class Builder internal constructor() { private var id: JsonField? = null private var billableMetric: JsonField? = null @@ -43543,6 +51701,8 @@ private constructor( private var name: JsonField? = null private var planPhaseOrder: JsonField? = null private var priceType: JsonField? = null + private var dimensionalPriceConfiguration: JsonField = + JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -43570,6 +51730,8 @@ private constructor( name = matrixWithDisplayNamePrice.name planPhaseOrder = matrixWithDisplayNamePrice.planPhaseOrder priceType = matrixWithDisplayNamePrice.priceType + dimensionalPriceConfiguration = + matrixWithDisplayNamePrice.dimensionalPriceConfiguration additionalProperties = matrixWithDisplayNamePrice.additionalProperties.toMutableMap() } @@ -43643,6 +51805,14 @@ private constructor( fun discount(trial: TrialDiscount) = discount(Discount.ofTrial(trial)) + fun trialDiscount(appliesToPriceIds: List) = + discount( + TrialDiscount.builder() + .discountType(TrialDiscount.DiscountType.TRIAL) + .appliesToPriceIds(appliesToPriceIds) + .build() + ) + fun discount(usage: Discount.UsageDiscount) = discount(Discount.ofUsage(usage)) fun discount(amount: AmountDiscount) = discount(Discount.ofAmount(amount)) @@ -43766,6 +51936,18 @@ private constructor( fun priceType(priceType: JsonField) = apply { this.priceType = priceType } + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: DimensionalPriceConfiguration? + ) = dimensionalPriceConfiguration(JsonField.ofNullable(dimensionalPriceConfiguration)) + + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: Optional + ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.orElse(null)) + + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: JsonField + ) = apply { this.dimensionalPriceConfiguration = dimensionalPriceConfiguration } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -43810,6 +51992,7 @@ private constructor( checkRequired("name", name), checkRequired("planPhaseOrder", planPhaseOrder), checkRequired("priceType", priceType), + dimensionalPriceConfiguration, additionalProperties.toImmutable(), ) } @@ -43851,7 +52034,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillableMetric]. */ + class Builder internal constructor() { private var id: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -43957,7 +52141,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -44018,6 +52203,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -44029,17 +52222,39 @@ private constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -44047,6 +52262,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -44093,6 +52317,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -44112,6 +52344,7 @@ private constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ONE_TIME, MONTHLY, @@ -44121,6 +52354,15 @@ private constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ONE_TIME, MONTHLY, @@ -44128,9 +52370,19 @@ private constructor( SEMI_ANNUAL, ANNUAL, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { ONE_TIME -> Value.ONE_TIME @@ -44142,6 +52394,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ONE_TIME -> Known.ONE_TIME @@ -44215,7 +52476,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CreditAllocation]. */ + class Builder internal constructor() { private var allowsRollover: JsonField? = null private var currency: JsonField? = null @@ -44334,7 +52596,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -44396,6 +52659,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -44407,17 +52678,39 @@ private constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -44425,6 +52718,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -44510,7 +52812,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Item]. */ + class Builder internal constructor() { private var id: JsonField? = null private var name: JsonField? = null @@ -44608,7 +52911,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MatrixWithDisplayNameConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -44723,7 +53027,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Maximum]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var maximumAmount: JsonField? = null @@ -44861,7 +53166,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -44972,7 +53278,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Minimum]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var minimumAmount: JsonField? = null @@ -45082,6 +53389,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -45091,21 +53406,51 @@ private constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { MATRIX_WITH_DISPLAY_NAME, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { MATRIX_WITH_DISPLAY_NAME, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { MATRIX_WITH_DISPLAY_NAME -> Value.MATRIX_WITH_DISPLAY_NAME else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { MATRIX_WITH_DISPLAY_NAME -> Known.MATRIX_WITH_DISPLAY_NAME @@ -45133,6 +53478,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -45144,17 +53497,38 @@ private constructor( @JvmStatic fun of(value: String) = PriceType(JsonField.of(value)) } + /** An enum containing [PriceType]'s known values. */ enum class Known { USAGE_PRICE, FIXED_PRICE, } + /** + * An enum containing [PriceType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [PriceType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { USAGE_PRICE, FIXED_PRICE, + /** + * An enum member indicating that [PriceType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { USAGE_PRICE -> Value.USAGE_PRICE @@ -45162,6 +53536,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { USAGE_PRICE -> Known.USAGE_PRICE @@ -45184,22 +53567,165 @@ private constructor( override fun toString() = value.toString() } + @NoAutoDetect + class DimensionalPriceConfiguration + @JsonCreator + private constructor( + @JsonProperty("dimension_values") + @ExcludeMissing + private val dimensionValues: JsonField> = JsonMissing.of(), + @JsonProperty("dimensional_price_group_id") + @ExcludeMissing + private val dimensionalPriceGroupId: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { + + fun dimensionValues(): List = dimensionValues.getRequired("dimension_values") + + fun dimensionalPriceGroupId(): String = + dimensionalPriceGroupId.getRequired("dimensional_price_group_id") + + @JsonProperty("dimension_values") + @ExcludeMissing + fun _dimensionValues(): JsonField> = dimensionValues + + @JsonProperty("dimensional_price_group_id") + @ExcludeMissing + fun _dimensionalPriceGroupId(): JsonField = dimensionalPriceGroupId + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): DimensionalPriceConfiguration = apply { + if (validated) { + return@apply + } + + dimensionValues() + dimensionalPriceGroupId() + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + /** A builder for [DimensionalPriceConfiguration]. */ + class Builder internal constructor() { + + private var dimensionValues: JsonField>? = null + private var dimensionalPriceGroupId: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(dimensionalPriceConfiguration: DimensionalPriceConfiguration) = + apply { + dimensionValues = + dimensionalPriceConfiguration.dimensionValues.map { it.toMutableList() } + dimensionalPriceGroupId = + dimensionalPriceConfiguration.dimensionalPriceGroupId + additionalProperties = + dimensionalPriceConfiguration.additionalProperties.toMutableMap() + } + + fun dimensionValues(dimensionValues: List) = + dimensionValues(JsonField.of(dimensionValues)) + + fun dimensionValues(dimensionValues: JsonField>) = apply { + this.dimensionValues = dimensionValues.map { it.toMutableList() } + } + + fun addDimensionValue(dimensionValue: String) = apply { + dimensionValues = + (dimensionValues ?: JsonField.of(mutableListOf())).apply { + asKnown() + .orElseThrow { + IllegalStateException( + "Field was set to non-list type: ${javaClass.simpleName}" + ) + } + .add(dimensionValue) + } + } + + fun dimensionalPriceGroupId(dimensionalPriceGroupId: String) = + dimensionalPriceGroupId(JsonField.of(dimensionalPriceGroupId)) + + fun dimensionalPriceGroupId(dimensionalPriceGroupId: JsonField) = apply { + this.dimensionalPriceGroupId = dimensionalPriceGroupId + } + + 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(): DimensionalPriceConfiguration = + DimensionalPriceConfiguration( + checkRequired("dimensionValues", dimensionValues).map { it.toImmutable() }, + checkRequired("dimensionalPriceGroupId", dimensionalPriceGroupId), + additionalProperties.toImmutable(), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is DimensionalPriceConfiguration && dimensionValues == other.dimensionValues && dimensionalPriceGroupId == other.dimensionalPriceGroupId && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(dimensionValues, dimensionalPriceGroupId, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "DimensionalPriceConfiguration{dimensionValues=$dimensionValues, dimensionalPriceGroupId=$dimensionalPriceGroupId, additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { 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 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 && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && 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, invoicingCycleConfiguration, item, matrixWithDisplayNameConfig, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, dimensionalPriceConfiguration, 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}" + "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, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, additionalProperties=$additionalProperties}" } @NoAutoDetect @@ -45273,6 +53799,10 @@ private constructor( @JsonProperty("price_type") @ExcludeMissing private val priceType: JsonField = JsonMissing.of(), + @JsonProperty("dimensional_price_configuration") + @ExcludeMissing + private val dimensionalPriceConfiguration: JsonField = + JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { @@ -45341,6 +53871,11 @@ private constructor( fun priceType(): PriceType = priceType.getRequired("price_type") + fun dimensionalPriceConfiguration(): Optional = + Optional.ofNullable( + dimensionalPriceConfiguration.getNullable("dimensional_price_configuration") + ) + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id @JsonProperty("billable_metric") @@ -45422,6 +53957,11 @@ private constructor( @ExcludeMissing fun _priceType(): JsonField = priceType + @JsonProperty("dimensional_price_configuration") + @ExcludeMissing + fun _dimensionalPriceConfiguration(): JsonField = + dimensionalPriceConfiguration + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -45456,6 +53996,7 @@ private constructor( name() planPhaseOrder() priceType() + dimensionalPriceConfiguration().ifPresent { it.validate() } validated = true } @@ -45466,7 +54007,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BulkWithProrationPrice]. */ + class Builder internal constructor() { private var id: JsonField? = null private var billableMetric: JsonField? = null @@ -45491,6 +54033,8 @@ private constructor( private var name: JsonField? = null private var planPhaseOrder: JsonField? = null private var priceType: JsonField? = null + private var dimensionalPriceConfiguration: JsonField = + JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -45518,6 +54062,7 @@ private constructor( name = bulkWithProrationPrice.name planPhaseOrder = bulkWithProrationPrice.planPhaseOrder priceType = bulkWithProrationPrice.priceType + dimensionalPriceConfiguration = bulkWithProrationPrice.dimensionalPriceConfiguration additionalProperties = bulkWithProrationPrice.additionalProperties.toMutableMap() } @@ -45597,6 +54142,14 @@ private constructor( fun discount(trial: TrialDiscount) = discount(Discount.ofTrial(trial)) + fun trialDiscount(appliesToPriceIds: List) = + discount( + TrialDiscount.builder() + .discountType(TrialDiscount.DiscountType.TRIAL) + .appliesToPriceIds(appliesToPriceIds) + .build() + ) + fun discount(usage: Discount.UsageDiscount) = discount(Discount.ofUsage(usage)) fun discount(amount: AmountDiscount) = discount(Discount.ofAmount(amount)) @@ -45712,6 +54265,18 @@ private constructor( fun priceType(priceType: JsonField) = apply { this.priceType = priceType } + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: DimensionalPriceConfiguration? + ) = dimensionalPriceConfiguration(JsonField.ofNullable(dimensionalPriceConfiguration)) + + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: Optional + ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.orElse(null)) + + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: JsonField + ) = apply { this.dimensionalPriceConfiguration = dimensionalPriceConfiguration } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -45756,6 +54321,7 @@ private constructor( checkRequired("name", name), checkRequired("planPhaseOrder", planPhaseOrder), checkRequired("priceType", priceType), + dimensionalPriceConfiguration, additionalProperties.toImmutable(), ) } @@ -45797,7 +54363,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillableMetric]. */ + class Builder internal constructor() { private var id: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -45903,7 +54470,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -45964,6 +54532,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -45975,17 +54551,39 @@ private constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -45993,6 +54591,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -46062,7 +54669,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BulkWithProrationConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -46122,6 +54730,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -46141,6 +54757,7 @@ private constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ONE_TIME, MONTHLY, @@ -46150,6 +54767,15 @@ private constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ONE_TIME, MONTHLY, @@ -46157,9 +54783,19 @@ private constructor( SEMI_ANNUAL, ANNUAL, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { ONE_TIME -> Value.ONE_TIME @@ -46171,6 +54807,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ONE_TIME -> Known.ONE_TIME @@ -46244,7 +54889,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CreditAllocation]. */ + class Builder internal constructor() { private var allowsRollover: JsonField? = null private var currency: JsonField? = null @@ -46363,7 +55009,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -46425,6 +55072,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -46436,17 +55091,39 @@ private constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -46454,6 +55131,4595 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ + 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() + } + + /** A builder for [Item]. */ + class Builder internal constructor() { + + 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() + } + + /** A builder for [Maximum]. */ + class Builder internal constructor() { + + 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() + } + + /** A builder for [Metadata]. */ + class Builder internal constructor() { + + 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() + } + + /** A builder for [Minimum]. */ + class Builder internal constructor() { + + 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 { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val BULK_WITH_PRORATION = of("bulk_with_proration") + + @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) + } + + /** An enum containing [ModelType]'s known values. */ + enum class Known { + BULK_WITH_PRORATION, + } + + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + BULK_WITH_PRORATION, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + BULK_WITH_PRORATION -> Value.BULK_WITH_PRORATION + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + BULK_WITH_PRORATION -> Known.BULK_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 { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ + @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)) + } + + /** An enum containing [PriceType]'s known values. */ + enum class Known { + USAGE_PRICE, + FIXED_PRICE, + } + + /** + * An enum containing [PriceType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [PriceType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + USAGE_PRICE, + FIXED_PRICE, + /** + * An enum member indicating that [PriceType] was instantiated with an unknown + * value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + USAGE_PRICE -> Value.USAGE_PRICE + FIXED_PRICE -> Value.FIXED_PRICE + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ + 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 DimensionalPriceConfiguration + @JsonCreator + private constructor( + @JsonProperty("dimension_values") + @ExcludeMissing + private val dimensionValues: JsonField> = JsonMissing.of(), + @JsonProperty("dimensional_price_group_id") + @ExcludeMissing + private val dimensionalPriceGroupId: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { + + fun dimensionValues(): List = dimensionValues.getRequired("dimension_values") + + fun dimensionalPriceGroupId(): String = + dimensionalPriceGroupId.getRequired("dimensional_price_group_id") + + @JsonProperty("dimension_values") + @ExcludeMissing + fun _dimensionValues(): JsonField> = dimensionValues + + @JsonProperty("dimensional_price_group_id") + @ExcludeMissing + fun _dimensionalPriceGroupId(): JsonField = dimensionalPriceGroupId + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): DimensionalPriceConfiguration = apply { + if (validated) { + return@apply + } + + dimensionValues() + dimensionalPriceGroupId() + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + /** A builder for [DimensionalPriceConfiguration]. */ + class Builder internal constructor() { + + private var dimensionValues: JsonField>? = null + private var dimensionalPriceGroupId: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(dimensionalPriceConfiguration: DimensionalPriceConfiguration) = + apply { + dimensionValues = + dimensionalPriceConfiguration.dimensionValues.map { it.toMutableList() } + dimensionalPriceGroupId = + dimensionalPriceConfiguration.dimensionalPriceGroupId + additionalProperties = + dimensionalPriceConfiguration.additionalProperties.toMutableMap() + } + + fun dimensionValues(dimensionValues: List) = + dimensionValues(JsonField.of(dimensionValues)) + + fun dimensionValues(dimensionValues: JsonField>) = apply { + this.dimensionValues = dimensionValues.map { it.toMutableList() } + } + + fun addDimensionValue(dimensionValue: String) = apply { + dimensionValues = + (dimensionValues ?: JsonField.of(mutableListOf())).apply { + asKnown() + .orElseThrow { + IllegalStateException( + "Field was set to non-list type: ${javaClass.simpleName}" + ) + } + .add(dimensionValue) + } + } + + fun dimensionalPriceGroupId(dimensionalPriceGroupId: String) = + dimensionalPriceGroupId(JsonField.of(dimensionalPriceGroupId)) + + fun dimensionalPriceGroupId(dimensionalPriceGroupId: JsonField) = apply { + this.dimensionalPriceGroupId = dimensionalPriceGroupId + } + + 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(): DimensionalPriceConfiguration = + DimensionalPriceConfiguration( + checkRequired("dimensionValues", dimensionValues).map { it.toImmutable() }, + checkRequired("dimensionalPriceGroupId", dimensionalPriceGroupId), + additionalProperties.toImmutable(), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is DimensionalPriceConfiguration && dimensionValues == other.dimensionValues && dimensionalPriceGroupId == other.dimensionalPriceGroupId && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(dimensionValues, dimensionalPriceGroupId, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "DimensionalPriceConfiguration{dimensionValues=$dimensionValues, dimensionalPriceGroupId=$dimensionalPriceGroupId, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + 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 && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && 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, dimensionalPriceConfiguration, 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, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, additionalProperties=$additionalProperties}" + } + + @NoAutoDetect + class GroupedTieredPackagePrice + @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("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("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("dimensional_price_configuration") + @ExcludeMissing + private val dimensionalPriceConfiguration: 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 groupedTieredPackageConfig(): GroupedTieredPackageConfig = + groupedTieredPackageConfig.getRequired("grouped_tiered_package_config") + + 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 dimensionalPriceConfiguration(): Optional = + Optional.ofNullable( + dimensionalPriceConfiguration.getNullable("dimensional_price_configuration") + ) + + @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("grouped_tiered_package_config") + @ExcludeMissing + fun _groupedTieredPackageConfig(): JsonField = + groupedTieredPackageConfig + + @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("dimensional_price_configuration") + @ExcludeMissing + fun _dimensionalPriceConfiguration(): JsonField = + dimensionalPriceConfiguration + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): GroupedTieredPackagePrice = 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() + groupedTieredPackageConfig().validate() + invoicingCycleConfiguration().ifPresent { it.validate() } + item().validate() + maximum().ifPresent { it.validate() } + maximumAmount() + metadata().validate() + minimum().ifPresent { it.validate() } + minimumAmount() + modelType() + name() + planPhaseOrder() + priceType() + dimensionalPriceConfiguration().ifPresent { it.validate() } + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + /** A builder for [GroupedTieredPackagePrice]. */ + class Builder internal constructor() { + + 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 groupedTieredPackageConfig: 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 dimensionalPriceConfiguration: JsonField = + JsonMissing.of() + 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 + dimensionalPriceConfiguration = + groupedTieredPackagePrice.dimensionalPriceConfiguration + additionalProperties = groupedTieredPackagePrice.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(percentage: PercentageDiscount) = + discount(Discount.ofPercentage(percentage)) + + fun discount(trial: TrialDiscount) = discount(Discount.ofTrial(trial)) + + fun trialDiscount(appliesToPriceIds: List) = + discount( + TrialDiscount.builder() + .discountType(TrialDiscount.DiscountType.TRIAL) + .appliesToPriceIds(appliesToPriceIds) + .build() + ) + + fun discount(usage: Discount.UsageDiscount) = discount(Discount.ofUsage(usage)) + + fun discount(amount: AmountDiscount) = discount(Discount.ofAmount(amount)) + + 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 groupedTieredPackageConfig(groupedTieredPackageConfig: GroupedTieredPackageConfig) = + groupedTieredPackageConfig(JsonField.of(groupedTieredPackageConfig)) + + fun groupedTieredPackageConfig( + groupedTieredPackageConfig: JsonField + ) = apply { this.groupedTieredPackageConfig = groupedTieredPackageConfig } + + 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 dimensionalPriceConfiguration( + dimensionalPriceConfiguration: DimensionalPriceConfiguration? + ) = dimensionalPriceConfiguration(JsonField.ofNullable(dimensionalPriceConfiguration)) + + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: Optional + ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.orElse(null)) + + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: JsonField + ) = apply { this.dimensionalPriceConfiguration = dimensionalPriceConfiguration } + + 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(): GroupedTieredPackagePrice = + GroupedTieredPackagePrice( + 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("groupedTieredPackageConfig", groupedTieredPackageConfig), + 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), + dimensionalPriceConfiguration, + 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() + } + + /** A builder for [BillableMetric]. */ + class Builder internal constructor() { + + 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() + } + + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { + + 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 { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ + @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)) + } + + /** An enum containing [DurationUnit]'s known values. */ + enum class Known { + DAY, + MONTH, + } + + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + DAY, + MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + DAY -> Value.DAY + MONTH -> Value.MONTH + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ + 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 { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ + @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)) + } + + /** An enum containing [Cadence]'s known values. */ + enum class Known { + ONE_TIME, + MONTHLY, + QUARTERLY, + SEMI_ANNUAL, + ANNUAL, + CUSTOM, + } + + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + ONE_TIME, + MONTHLY, + QUARTERLY, + SEMI_ANNUAL, + ANNUAL, + CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ + 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 + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ + 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() + } + + /** A builder for [CreditAllocation]. */ + class Builder internal constructor() { + + 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 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() + } + + /** A builder for [GroupedTieredPackageConfig]. */ + class Builder internal constructor() { + + 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 + 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() + } + + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { + + 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 { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ + @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)) + } + + /** An enum containing [DurationUnit]'s known values. */ + enum class Known { + DAY, + MONTH, + } + + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + DAY, + MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + DAY -> Value.DAY + MONTH -> Value.MONTH + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ + 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() + } + + /** A builder for [Item]. */ + class Builder internal constructor() { + + 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() + } + + /** A builder for [Maximum]. */ + class Builder internal constructor() { + + 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() + } + + /** A builder for [Metadata]. */ + class Builder internal constructor() { + + 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() + } + + /** A builder for [Minimum]. */ + class Builder internal constructor() { + + 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 { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ + @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)) + } + + /** An enum containing [ModelType]'s known values. */ + enum class Known { + GROUPED_TIERED_PACKAGE, + } + + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + GROUPED_TIERED_PACKAGE, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + GROUPED_TIERED_PACKAGE -> Value.GROUPED_TIERED_PACKAGE + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ + 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() + } + + class PriceType + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ + @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)) + } + + /** An enum containing [PriceType]'s known values. */ + enum class Known { + USAGE_PRICE, + FIXED_PRICE, + } + + /** + * An enum containing [PriceType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [PriceType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + USAGE_PRICE, + FIXED_PRICE, + /** + * An enum member indicating that [PriceType] was instantiated with an unknown + * value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + USAGE_PRICE -> Value.USAGE_PRICE + FIXED_PRICE -> Value.FIXED_PRICE + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ + 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 DimensionalPriceConfiguration + @JsonCreator + private constructor( + @JsonProperty("dimension_values") + @ExcludeMissing + private val dimensionValues: JsonField> = JsonMissing.of(), + @JsonProperty("dimensional_price_group_id") + @ExcludeMissing + private val dimensionalPriceGroupId: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { + + fun dimensionValues(): List = dimensionValues.getRequired("dimension_values") + + fun dimensionalPriceGroupId(): String = + dimensionalPriceGroupId.getRequired("dimensional_price_group_id") + + @JsonProperty("dimension_values") + @ExcludeMissing + fun _dimensionValues(): JsonField> = dimensionValues + + @JsonProperty("dimensional_price_group_id") + @ExcludeMissing + fun _dimensionalPriceGroupId(): JsonField = dimensionalPriceGroupId + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): DimensionalPriceConfiguration = apply { + if (validated) { + return@apply + } + + dimensionValues() + dimensionalPriceGroupId() + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + /** A builder for [DimensionalPriceConfiguration]. */ + class Builder internal constructor() { + + private var dimensionValues: JsonField>? = null + private var dimensionalPriceGroupId: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(dimensionalPriceConfiguration: DimensionalPriceConfiguration) = + apply { + dimensionValues = + dimensionalPriceConfiguration.dimensionValues.map { it.toMutableList() } + dimensionalPriceGroupId = + dimensionalPriceConfiguration.dimensionalPriceGroupId + additionalProperties = + dimensionalPriceConfiguration.additionalProperties.toMutableMap() + } + + fun dimensionValues(dimensionValues: List) = + dimensionValues(JsonField.of(dimensionValues)) + + fun dimensionValues(dimensionValues: JsonField>) = apply { + this.dimensionValues = dimensionValues.map { it.toMutableList() } + } + + fun addDimensionValue(dimensionValue: String) = apply { + dimensionValues = + (dimensionValues ?: JsonField.of(mutableListOf())).apply { + asKnown() + .orElseThrow { + IllegalStateException( + "Field was set to non-list type: ${javaClass.simpleName}" + ) + } + .add(dimensionValue) + } + } + + fun dimensionalPriceGroupId(dimensionalPriceGroupId: String) = + dimensionalPriceGroupId(JsonField.of(dimensionalPriceGroupId)) + + fun dimensionalPriceGroupId(dimensionalPriceGroupId: JsonField) = apply { + this.dimensionalPriceGroupId = dimensionalPriceGroupId + } + + 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(): DimensionalPriceConfiguration = + DimensionalPriceConfiguration( + checkRequired("dimensionValues", dimensionValues).map { it.toImmutable() }, + checkRequired("dimensionalPriceGroupId", dimensionalPriceGroupId), + additionalProperties.toImmutable(), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is DimensionalPriceConfiguration && dimensionValues == other.dimensionValues && dimensionalPriceGroupId == other.dimensionalPriceGroupId && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(dimensionValues, dimensionalPriceGroupId, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "DimensionalPriceConfiguration{dimensionValues=$dimensionValues, dimensionalPriceGroupId=$dimensionalPriceGroupId, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + 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 && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && 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, dimensionalPriceConfiguration, 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, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, additionalProperties=$additionalProperties}" + } + + @NoAutoDetect + class MaxGroupTieredPackagePrice + @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("max_group_tiered_package_config") + @ExcludeMissing + private val maxGroupTieredPackageConfig: 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("dimensional_price_configuration") + @ExcludeMissing + private val dimensionalPriceConfiguration: 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 maxGroupTieredPackageConfig(): MaxGroupTieredPackageConfig = + maxGroupTieredPackageConfig.getRequired("max_group_tiered_package_config") + + 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 dimensionalPriceConfiguration(): Optional = + Optional.ofNullable( + dimensionalPriceConfiguration.getNullable("dimensional_price_configuration") + ) + + @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("max_group_tiered_package_config") + @ExcludeMissing + fun _maxGroupTieredPackageConfig(): JsonField = + maxGroupTieredPackageConfig + + @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("dimensional_price_configuration") + @ExcludeMissing + fun _dimensionalPriceConfiguration(): JsonField = + dimensionalPriceConfiguration + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): MaxGroupTieredPackagePrice = 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() + maxGroupTieredPackageConfig().validate() + maximum().ifPresent { it.validate() } + maximumAmount() + metadata().validate() + minimum().ifPresent { it.validate() } + minimumAmount() + modelType() + name() + planPhaseOrder() + priceType() + dimensionalPriceConfiguration().ifPresent { it.validate() } + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + /** A builder for [MaxGroupTieredPackagePrice]. */ + class Builder internal constructor() { + + 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 maxGroupTieredPackageConfig: 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 dimensionalPriceConfiguration: JsonField = + JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(maxGroupTieredPackagePrice: MaxGroupTieredPackagePrice) = apply { + id = maxGroupTieredPackagePrice.id + billableMetric = maxGroupTieredPackagePrice.billableMetric + billingCycleConfiguration = maxGroupTieredPackagePrice.billingCycleConfiguration + cadence = maxGroupTieredPackagePrice.cadence + conversionRate = maxGroupTieredPackagePrice.conversionRate + createdAt = maxGroupTieredPackagePrice.createdAt + creditAllocation = maxGroupTieredPackagePrice.creditAllocation + currency = maxGroupTieredPackagePrice.currency + discount = maxGroupTieredPackagePrice.discount + externalPriceId = maxGroupTieredPackagePrice.externalPriceId + fixedPriceQuantity = maxGroupTieredPackagePrice.fixedPriceQuantity + invoicingCycleConfiguration = maxGroupTieredPackagePrice.invoicingCycleConfiguration + item = maxGroupTieredPackagePrice.item + maxGroupTieredPackageConfig = maxGroupTieredPackagePrice.maxGroupTieredPackageConfig + maximum = maxGroupTieredPackagePrice.maximum + maximumAmount = maxGroupTieredPackagePrice.maximumAmount + metadata = maxGroupTieredPackagePrice.metadata + minimum = maxGroupTieredPackagePrice.minimum + minimumAmount = maxGroupTieredPackagePrice.minimumAmount + modelType = maxGroupTieredPackagePrice.modelType + name = maxGroupTieredPackagePrice.name + planPhaseOrder = maxGroupTieredPackagePrice.planPhaseOrder + priceType = maxGroupTieredPackagePrice.priceType + dimensionalPriceConfiguration = + maxGroupTieredPackagePrice.dimensionalPriceConfiguration + additionalProperties = + maxGroupTieredPackagePrice.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(percentage: PercentageDiscount) = + discount(Discount.ofPercentage(percentage)) + + fun discount(trial: TrialDiscount) = discount(Discount.ofTrial(trial)) + + fun trialDiscount(appliesToPriceIds: List) = + discount( + TrialDiscount.builder() + .discountType(TrialDiscount.DiscountType.TRIAL) + .appliesToPriceIds(appliesToPriceIds) + .build() + ) + + fun discount(usage: Discount.UsageDiscount) = discount(Discount.ofUsage(usage)) + + fun discount(amount: AmountDiscount) = discount(Discount.ofAmount(amount)) + + 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 maxGroupTieredPackageConfig( + maxGroupTieredPackageConfig: MaxGroupTieredPackageConfig + ) = maxGroupTieredPackageConfig(JsonField.of(maxGroupTieredPackageConfig)) + + fun maxGroupTieredPackageConfig( + maxGroupTieredPackageConfig: JsonField + ) = apply { this.maxGroupTieredPackageConfig = maxGroupTieredPackageConfig } + + 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 dimensionalPriceConfiguration( + dimensionalPriceConfiguration: DimensionalPriceConfiguration? + ) = dimensionalPriceConfiguration(JsonField.ofNullable(dimensionalPriceConfiguration)) + + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: Optional + ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.orElse(null)) + + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: JsonField + ) = apply { this.dimensionalPriceConfiguration = dimensionalPriceConfiguration } + + 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(): MaxGroupTieredPackagePrice = + MaxGroupTieredPackagePrice( + 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("maxGroupTieredPackageConfig", maxGroupTieredPackageConfig), + 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), + dimensionalPriceConfiguration, + 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() + } + + /** A builder for [BillableMetric]. */ + class Builder internal constructor() { + + 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() + } + + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { + + 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 { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ + @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)) + } + + /** An enum containing [DurationUnit]'s known values. */ + enum class Known { + DAY, + MONTH, + } + + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + DAY, + MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + DAY -> Value.DAY + MONTH -> Value.MONTH + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ + 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 { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ + @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)) + } + + /** An enum containing [Cadence]'s known values. */ + enum class Known { + ONE_TIME, + MONTHLY, + QUARTERLY, + SEMI_ANNUAL, + ANNUAL, + CUSTOM, + } + + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + ONE_TIME, + MONTHLY, + QUARTERLY, + SEMI_ANNUAL, + ANNUAL, + CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ + 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 + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ + 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() + } + + /** A builder for [CreditAllocation]. */ + class Builder internal constructor() { + + 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() + } + + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { + + 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 { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ + @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)) + } + + /** An enum containing [DurationUnit]'s known values. */ + enum class Known { + DAY, + MONTH, + } + + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + DAY, + MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + DAY -> Value.DAY + MONTH -> Value.MONTH + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -46539,7 +59805,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Item]. */ + class Builder internal constructor() { private var id: JsonField? = null private var name: JsonField? = null @@ -46608,6 +59875,91 @@ private constructor( "Item{id=$id, name=$name, additionalProperties=$additionalProperties}" } + @NoAutoDetect + class MaxGroupTieredPackageConfig + @JsonCreator + private constructor( + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): MaxGroupTieredPackageConfig = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + /** A builder for [MaxGroupTieredPackageConfig]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(maxGroupTieredPackageConfig: MaxGroupTieredPackageConfig) = + apply { + additionalProperties = + maxGroupTieredPackageConfig.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(): MaxGroupTieredPackageConfig = + MaxGroupTieredPackageConfig(additionalProperties.toImmutable()) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is MaxGroupTieredPackageConfig && 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() = + "MaxGroupTieredPackageConfig{additionalProperties=$additionalProperties}" + } + @NoAutoDetect class Maximum @JsonCreator @@ -46668,7 +60020,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Maximum]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var maximumAmount: JsonField? = null @@ -46806,7 +60159,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -46917,7 +60271,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Minimum]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var minimumAmount: JsonField? = null @@ -47027,33 +60382,71 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { - @JvmField val BULK_WITH_PRORATION = of("bulk_with_proration") + @JvmField val MAX_GROUP_TIERED_PACKAGE = of("max_group_tiered_package") @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { - BULK_WITH_PRORATION, + MAX_GROUP_TIERED_PACKAGE, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { - BULK_WITH_PRORATION, + MAX_GROUP_TIERED_PACKAGE, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { - BULK_WITH_PRORATION -> Value.BULK_WITH_PRORATION + MAX_GROUP_TIERED_PACKAGE -> Value.MAX_GROUP_TIERED_PACKAGE else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { - BULK_WITH_PRORATION -> Known.BULK_WITH_PRORATION + MAX_GROUP_TIERED_PACKAGE -> Known.MAX_GROUP_TIERED_PACKAGE else -> throw OrbInvalidDataException("Unknown ModelType: $value") } @@ -47078,6 +60471,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -47089,17 +60490,38 @@ private constructor( @JvmStatic fun of(value: String) = PriceType(JsonField.of(value)) } + /** An enum containing [PriceType]'s known values. */ enum class Known { USAGE_PRICE, FIXED_PRICE, } + /** + * An enum containing [PriceType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [PriceType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { USAGE_PRICE, FIXED_PRICE, + /** + * An enum member indicating that [PriceType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { USAGE_PRICE -> Value.USAGE_PRICE @@ -47107,6 +60529,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { USAGE_PRICE -> Known.USAGE_PRICE @@ -47129,26 +60560,169 @@ private constructor( override fun toString() = value.toString() } + @NoAutoDetect + class DimensionalPriceConfiguration + @JsonCreator + private constructor( + @JsonProperty("dimension_values") + @ExcludeMissing + private val dimensionValues: JsonField> = JsonMissing.of(), + @JsonProperty("dimensional_price_group_id") + @ExcludeMissing + private val dimensionalPriceGroupId: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { + + fun dimensionValues(): List = dimensionValues.getRequired("dimension_values") + + fun dimensionalPriceGroupId(): String = + dimensionalPriceGroupId.getRequired("dimensional_price_group_id") + + @JsonProperty("dimension_values") + @ExcludeMissing + fun _dimensionValues(): JsonField> = dimensionValues + + @JsonProperty("dimensional_price_group_id") + @ExcludeMissing + fun _dimensionalPriceGroupId(): JsonField = dimensionalPriceGroupId + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): DimensionalPriceConfiguration = apply { + if (validated) { + return@apply + } + + dimensionValues() + dimensionalPriceGroupId() + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + /** A builder for [DimensionalPriceConfiguration]. */ + class Builder internal constructor() { + + private var dimensionValues: JsonField>? = null + private var dimensionalPriceGroupId: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(dimensionalPriceConfiguration: DimensionalPriceConfiguration) = + apply { + dimensionValues = + dimensionalPriceConfiguration.dimensionValues.map { it.toMutableList() } + dimensionalPriceGroupId = + dimensionalPriceConfiguration.dimensionalPriceGroupId + additionalProperties = + dimensionalPriceConfiguration.additionalProperties.toMutableMap() + } + + fun dimensionValues(dimensionValues: List) = + dimensionValues(JsonField.of(dimensionValues)) + + fun dimensionValues(dimensionValues: JsonField>) = apply { + this.dimensionValues = dimensionValues.map { it.toMutableList() } + } + + fun addDimensionValue(dimensionValue: String) = apply { + dimensionValues = + (dimensionValues ?: JsonField.of(mutableListOf())).apply { + asKnown() + .orElseThrow { + IllegalStateException( + "Field was set to non-list type: ${javaClass.simpleName}" + ) + } + .add(dimensionValue) + } + } + + fun dimensionalPriceGroupId(dimensionalPriceGroupId: String) = + dimensionalPriceGroupId(JsonField.of(dimensionalPriceGroupId)) + + fun dimensionalPriceGroupId(dimensionalPriceGroupId: JsonField) = apply { + this.dimensionalPriceGroupId = dimensionalPriceGroupId + } + + 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(): DimensionalPriceConfiguration = + DimensionalPriceConfiguration( + checkRequired("dimensionValues", dimensionValues).map { it.toImmutable() }, + checkRequired("dimensionalPriceGroupId", dimensionalPriceGroupId), + additionalProperties.toImmutable(), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is DimensionalPriceConfiguration && dimensionValues == other.dimensionValues && dimensionalPriceGroupId == other.dimensionalPriceGroupId && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(dimensionValues, dimensionalPriceGroupId, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "DimensionalPriceConfiguration{dimensionValues=$dimensionValues, dimensionalPriceGroupId=$dimensionalPriceGroupId, additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { 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 MaxGroupTieredPackagePrice && 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 && maxGroupTieredPackageConfig == other.maxGroupTieredPackageConfig && 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 && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && 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, maxGroupTieredPackageConfig, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, dimensionalPriceConfiguration, 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}" + "MaxGroupTieredPackagePrice{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, maxGroupTieredPackageConfig=$maxGroupTieredPackageConfig, maximum=$maximum, maximumAmount=$maximumAmount, metadata=$metadata, minimum=$minimum, minimumAmount=$minimumAmount, modelType=$modelType, name=$name, planPhaseOrder=$planPhaseOrder, priceType=$priceType, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, additionalProperties=$additionalProperties}" } @NoAutoDetect - class GroupedTieredPackagePrice + class ScalableMatrixWithUnitPricingPrice @JsonCreator private constructor( @JsonProperty("id") @ExcludeMissing private val id: JsonField = JsonMissing.of(), @@ -47183,10 +60757,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 = @@ -47219,6 +60789,15 @@ private constructor( @JsonProperty("price_type") @ExcludeMissing private val priceType: JsonField = JsonMissing.of(), + @JsonProperty("scalable_matrix_with_unit_pricing_config") + @ExcludeMissing + private val scalableMatrixWithUnitPricingConfig: + JsonField = + JsonMissing.of(), + @JsonProperty("dimensional_price_configuration") + @ExcludeMissing + private val dimensionalPriceConfiguration: JsonField = + JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { @@ -47251,9 +60830,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") @@ -47287,6 +60863,16 @@ private constructor( fun priceType(): PriceType = priceType.getRequired("price_type") + fun scalableMatrixWithUnitPricingConfig(): ScalableMatrixWithUnitPricingConfig = + scalableMatrixWithUnitPricingConfig.getRequired( + "scalable_matrix_with_unit_pricing_config" + ) + + fun dimensionalPriceConfiguration(): Optional = + Optional.ofNullable( + dimensionalPriceConfiguration.getNullable("dimensional_price_configuration") + ) + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id @JsonProperty("billable_metric") @@ -47324,11 +60910,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 = @@ -47369,13 +60950,23 @@ private constructor( @ExcludeMissing fun _priceType(): JsonField = priceType + @JsonProperty("scalable_matrix_with_unit_pricing_config") + @ExcludeMissing + fun _scalableMatrixWithUnitPricingConfig(): JsonField = + scalableMatrixWithUnitPricingConfig + + @JsonProperty("dimensional_price_configuration") + @ExcludeMissing + fun _dimensionalPriceConfiguration(): JsonField = + dimensionalPriceConfiguration + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties private var validated: Boolean = false - fun validate(): GroupedTieredPackagePrice = apply { + fun validate(): ScalableMatrixWithUnitPricingPrice = apply { if (validated) { return@apply } @@ -47391,7 +60982,6 @@ private constructor( discount().ifPresent { it.validate() } externalPriceId() fixedPriceQuantity() - groupedTieredPackageConfig().validate() invoicingCycleConfiguration().ifPresent { it.validate() } item().validate() maximum().ifPresent { it.validate() } @@ -47403,6 +60993,8 @@ private constructor( name() planPhaseOrder() priceType() + scalableMatrixWithUnitPricingConfig().validate() + dimensionalPriceConfiguration().ifPresent { it.validate() } validated = true } @@ -47413,7 +61005,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [ScalableMatrixWithUnitPricingPrice]. */ + class Builder internal constructor() { private var id: JsonField? = null private var billableMetric: JsonField? = null @@ -47426,7 +61019,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 @@ -47438,34 +61030,47 @@ private constructor( private var name: JsonField? = null private var planPhaseOrder: JsonField? = null private var priceType: JsonField? = null + private var scalableMatrixWithUnitPricingConfig: + JsonField? = + null + private var dimensionalPriceConfiguration: JsonField = + JsonMissing.of() 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( + scalableMatrixWithUnitPricingPrice: ScalableMatrixWithUnitPricingPrice + ) = apply { + id = scalableMatrixWithUnitPricingPrice.id + billableMetric = scalableMatrixWithUnitPricingPrice.billableMetric + billingCycleConfiguration = + scalableMatrixWithUnitPricingPrice.billingCycleConfiguration + cadence = scalableMatrixWithUnitPricingPrice.cadence + conversionRate = scalableMatrixWithUnitPricingPrice.conversionRate + createdAt = scalableMatrixWithUnitPricingPrice.createdAt + creditAllocation = scalableMatrixWithUnitPricingPrice.creditAllocation + currency = scalableMatrixWithUnitPricingPrice.currency + discount = scalableMatrixWithUnitPricingPrice.discount + externalPriceId = scalableMatrixWithUnitPricingPrice.externalPriceId + fixedPriceQuantity = scalableMatrixWithUnitPricingPrice.fixedPriceQuantity + invoicingCycleConfiguration = + scalableMatrixWithUnitPricingPrice.invoicingCycleConfiguration + item = scalableMatrixWithUnitPricingPrice.item + maximum = scalableMatrixWithUnitPricingPrice.maximum + maximumAmount = scalableMatrixWithUnitPricingPrice.maximumAmount + metadata = scalableMatrixWithUnitPricingPrice.metadata + minimum = scalableMatrixWithUnitPricingPrice.minimum + minimumAmount = scalableMatrixWithUnitPricingPrice.minimumAmount + modelType = scalableMatrixWithUnitPricingPrice.modelType + name = scalableMatrixWithUnitPricingPrice.name + planPhaseOrder = scalableMatrixWithUnitPricingPrice.planPhaseOrder + priceType = scalableMatrixWithUnitPricingPrice.priceType + scalableMatrixWithUnitPricingConfig = + scalableMatrixWithUnitPricingPrice.scalableMatrixWithUnitPricingConfig + dimensionalPriceConfiguration = + scalableMatrixWithUnitPricingPrice.dimensionalPriceConfiguration + additionalProperties = + scalableMatrixWithUnitPricingPrice.additionalProperties.toMutableMap() } fun id(id: String) = id(JsonField.of(id)) @@ -47537,6 +61142,14 @@ private constructor( fun discount(trial: TrialDiscount) = discount(Discount.ofTrial(trial)) + fun trialDiscount(appliesToPriceIds: List) = + discount( + TrialDiscount.builder() + .discountType(TrialDiscount.DiscountType.TRIAL) + .appliesToPriceIds(appliesToPriceIds) + .build() + ) + fun discount(usage: Discount.UsageDiscount) = discount(Discount.ofUsage(usage)) fun discount(amount: AmountDiscount) = discount(Discount.ofAmount(amount)) @@ -47565,13 +61178,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)) @@ -47659,6 +61265,31 @@ private constructor( fun priceType(priceType: JsonField) = apply { this.priceType = priceType } + fun scalableMatrixWithUnitPricingConfig( + scalableMatrixWithUnitPricingConfig: ScalableMatrixWithUnitPricingConfig + ) = + scalableMatrixWithUnitPricingConfig( + JsonField.of(scalableMatrixWithUnitPricingConfig) + ) + + fun scalableMatrixWithUnitPricingConfig( + scalableMatrixWithUnitPricingConfig: JsonField + ) = apply { + this.scalableMatrixWithUnitPricingConfig = scalableMatrixWithUnitPricingConfig + } + + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: DimensionalPriceConfiguration? + ) = dimensionalPriceConfiguration(JsonField.ofNullable(dimensionalPriceConfiguration)) + + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: Optional + ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.orElse(null)) + + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: JsonField + ) = apply { this.dimensionalPriceConfiguration = dimensionalPriceConfiguration } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -47678,8 +61309,8 @@ private constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): GroupedTieredPackagePrice = - GroupedTieredPackagePrice( + fun build(): ScalableMatrixWithUnitPricingPrice = + ScalableMatrixWithUnitPricingPrice( checkRequired("id", id), checkRequired("billableMetric", billableMetric), checkRequired("billingCycleConfiguration", billingCycleConfiguration), @@ -47691,7 +61322,6 @@ private constructor( checkRequired("discount", discount), checkRequired("externalPriceId", externalPriceId), checkRequired("fixedPriceQuantity", fixedPriceQuantity), - checkRequired("groupedTieredPackageConfig", groupedTieredPackageConfig), checkRequired("invoicingCycleConfiguration", invoicingCycleConfiguration), checkRequired("item", item), checkRequired("maximum", maximum), @@ -47703,6 +61333,11 @@ private constructor( checkRequired("name", name), checkRequired("planPhaseOrder", planPhaseOrder), checkRequired("priceType", priceType), + checkRequired( + "scalableMatrixWithUnitPricingConfig", + scalableMatrixWithUnitPricingConfig + ), + dimensionalPriceConfiguration, additionalProperties.toImmutable(), ) } @@ -47744,7 +61379,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillableMetric]. */ + class Builder internal constructor() { private var id: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -47850,7 +61486,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -47911,6 +61548,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -47922,17 +61567,39 @@ private constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -47940,6 +61607,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -47986,6 +61662,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -48005,6 +61689,7 @@ private constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ONE_TIME, MONTHLY, @@ -48014,6 +61699,15 @@ private constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ONE_TIME, MONTHLY, @@ -48021,9 +61715,19 @@ private constructor( SEMI_ANNUAL, ANNUAL, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { ONE_TIME -> Value.ONE_TIME @@ -48035,6 +61739,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ONE_TIME -> Known.ONE_TIME @@ -48108,7 +61821,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CreditAllocation]. */ + class Builder internal constructor() { private var allowsRollover: JsonField? = null private var currency: JsonField? = null @@ -48180,89 +61894,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 @@ -48310,7 +61941,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -48372,6 +62004,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -48383,17 +62023,39 @@ private constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -48401,6 +62063,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -48486,7 +62157,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Item]. */ + class Builder internal constructor() { private var id: JsonField? = null private var name: JsonField? = null @@ -48615,7 +62287,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Maximum]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var maximumAmount: JsonField? = null @@ -48753,7 +62426,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -48784,7 +62458,442 @@ private constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): Metadata = Metadata(additionalProperties.toImmutable()) + 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() + } + + /** A builder for [Minimum]. */ + class Builder internal constructor() { + + 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 { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField + val SCALABLE_MATRIX_WITH_UNIT_PRICING = of("scalable_matrix_with_unit_pricing") + + @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) + } + + /** An enum containing [ModelType]'s known values. */ + enum class Known { + SCALABLE_MATRIX_WITH_UNIT_PRICING, + } + + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + SCALABLE_MATRIX_WITH_UNIT_PRICING, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + SCALABLE_MATRIX_WITH_UNIT_PRICING -> Value.SCALABLE_MATRIX_WITH_UNIT_PRICING + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + SCALABLE_MATRIX_WITH_UNIT_PRICING -> Known.SCALABLE_MATRIX_WITH_UNIT_PRICING + 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 { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ + @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)) + } + + /** An enum containing [PriceType]'s known values. */ + enum class Known { + USAGE_PRICE, + FIXED_PRICE, + } + + /** + * An enum containing [PriceType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [PriceType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + USAGE_PRICE, + FIXED_PRICE, + /** + * An enum member indicating that [PriceType] was instantiated with an unknown + * value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + USAGE_PRICE -> Value.USAGE_PRICE + FIXED_PRICE -> Value.FIXED_PRICE + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ + 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 ScalableMatrixWithUnitPricingConfig + @JsonCreator + private constructor( + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): ScalableMatrixWithUnitPricingConfig = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + /** A builder for [ScalableMatrixWithUnitPricingConfig]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from( + scalableMatrixWithUnitPricingConfig: ScalableMatrixWithUnitPricingConfig + ) = apply { + additionalProperties = + scalableMatrixWithUnitPricingConfig.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(): ScalableMatrixWithUnitPricingConfig = + ScalableMatrixWithUnitPricingConfig(additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { @@ -48792,7 +62901,7 @@ private constructor( return true } - return /* spotless:off */ other is Metadata && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is ScalableMatrixWithUnitPricingConfig && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ @@ -48801,45 +62910,36 @@ private constructor( override fun hashCode(): Int = hashCode - override fun toString() = "Metadata{additionalProperties=$additionalProperties}" + override fun toString() = + "ScalableMatrixWithUnitPricingConfig{additionalProperties=$additionalProperties}" } @NoAutoDetect - class Minimum + class DimensionalPriceConfiguration @JsonCreator private constructor( - @JsonProperty("applies_to_price_ids") + @JsonProperty("dimension_values") @ExcludeMissing - private val appliesToPriceIds: JsonField> = JsonMissing.of(), - @JsonProperty("minimum_amount") + private val dimensionValues: JsonField> = JsonMissing.of(), + @JsonProperty("dimensional_price_group_id") @ExcludeMissing - private val minimumAmount: JsonField = JsonMissing.of(), + private val dimensionalPriceGroupId: 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") + fun dimensionValues(): List = dimensionValues.getRequired("dimension_values") - /** Minimum amount applied */ - fun minimumAmount(): String = minimumAmount.getRequired("minimum_amount") + fun dimensionalPriceGroupId(): String = + dimensionalPriceGroupId.getRequired("dimensional_price_group_id") - /** - * 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") + @JsonProperty("dimension_values") @ExcludeMissing - fun _appliesToPriceIds(): JsonField> = appliesToPriceIds + fun _dimensionValues(): JsonField> = dimensionValues - /** Minimum amount applied */ - @JsonProperty("minimum_amount") + @JsonProperty("dimensional_price_group_id") @ExcludeMissing - fun _minimumAmount(): JsonField = minimumAmount + fun _dimensionalPriceGroupId(): JsonField = dimensionalPriceGroupId @JsonAnyGetter @ExcludeMissing @@ -48847,13 +62947,13 @@ private constructor( private var validated: Boolean = false - fun validate(): Minimum = apply { + fun validate(): DimensionalPriceConfiguration = apply { if (validated) { return@apply } - appliesToPriceIds() - minimumAmount() + dimensionValues() + dimensionalPriceGroupId() validated = true } @@ -48864,58 +62964,49 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [DimensionalPriceConfiguration]. */ + class Builder internal constructor() { - private var appliesToPriceIds: JsonField>? = null - private var minimumAmount: JsonField? = null + private var dimensionValues: JsonField>? = null + private var dimensionalPriceGroupId: 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() - } + internal fun from(dimensionalPriceConfiguration: DimensionalPriceConfiguration) = + apply { + dimensionValues = + dimensionalPriceConfiguration.dimensionValues.map { it.toMutableList() } + dimensionalPriceGroupId = + dimensionalPriceConfiguration.dimensionalPriceGroupId + additionalProperties = + dimensionalPriceConfiguration.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)) + fun dimensionValues(dimensionValues: List) = + dimensionValues(JsonField.of(dimensionValues)) - /** - * 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() } + fun dimensionValues(dimensionValues: JsonField>) = apply { + this.dimensionValues = dimensionValues.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 { + fun addDimensionValue(dimensionValue: String) = apply { + dimensionValues = + (dimensionValues ?: JsonField.of(mutableListOf())).apply { asKnown() .orElseThrow { IllegalStateException( "Field was set to non-list type: ${javaClass.simpleName}" ) } - .add(appliesToPriceId) + .add(dimensionValue) } } - /** Minimum amount applied */ - fun minimumAmount(minimumAmount: String) = - minimumAmount(JsonField.of(minimumAmount)) + fun dimensionalPriceGroupId(dimensionalPriceGroupId: String) = + dimensionalPriceGroupId(JsonField.of(dimensionalPriceGroupId)) - /** Minimum amount applied */ - fun minimumAmount(minimumAmount: JsonField) = apply { - this.minimumAmount = minimumAmount + fun dimensionalPriceGroupId(dimensionalPriceGroupId: JsonField) = apply { + this.dimensionalPriceGroupId = dimensionalPriceGroupId } fun additionalProperties(additionalProperties: Map) = apply { @@ -48940,12 +63031,10 @@ private constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): Minimum = - Minimum( - checkRequired("appliesToPriceIds", appliesToPriceIds).map { - it.toImmutable() - }, - checkRequired("minimumAmount", minimumAmount), + fun build(): DimensionalPriceConfiguration = + DimensionalPriceConfiguration( + checkRequired("dimensionValues", dimensionValues).map { it.toImmutable() }, + checkRequired("dimensionalPriceGroupId", dimensionalPriceGroupId), additionalProperties.toImmutable(), ) } @@ -48955,125 +63044,17 @@ private constructor( return true } - return /* spotless:off */ other is Minimum && appliesToPriceIds == other.appliesToPriceIds && minimumAmount == other.minimumAmount && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is DimensionalPriceConfiguration && dimensionValues == other.dimensionValues && dimensionalPriceGroupId == other.dimensionalPriceGroupId && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(appliesToPriceIds, minimumAmount, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(dimensionValues, dimensionalPriceGroupId, 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 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() - } - - 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() + "DimensionalPriceConfiguration{dimensionValues=$dimensionValues, dimensionalPriceGroupId=$dimensionalPriceGroupId, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { @@ -49081,21 +63062,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 ScalableMatrixWithUnitPricingPrice && 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 && scalableMatrixWithUnitPricingConfig == other.scalableMatrixWithUnitPricingConfig && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && 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, cadence, conversionRate, createdAt, creditAllocation, currency, discount, externalPriceId, fixedPriceQuantity, invoicingCycleConfiguration, item, maximum, maximumAmount, metadata, minimum, minimumAmount, modelType, name, planPhaseOrder, priceType, scalableMatrixWithUnitPricingConfig, dimensionalPriceConfiguration, 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}" + "ScalableMatrixWithUnitPricingPrice{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, scalableMatrixWithUnitPricingConfig=$scalableMatrixWithUnitPricingConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, additionalProperties=$additionalProperties}" } @NoAutoDetect - class MaxGroupTieredPackagePrice + class ScalableMatrixWithTieredPricingPrice @JsonCreator private constructor( @JsonProperty("id") @ExcludeMissing private val id: JsonField = JsonMissing.of(), @@ -49135,10 +63116,6 @@ private constructor( private val invoicingCycleConfiguration: JsonField = JsonMissing.of(), @JsonProperty("item") @ExcludeMissing private val item: JsonField = JsonMissing.of(), - @JsonProperty("max_group_tiered_package_config") - @ExcludeMissing - private val maxGroupTieredPackageConfig: JsonField = - JsonMissing.of(), @JsonProperty("maximum") @ExcludeMissing private val maximum: JsonField = JsonMissing.of(), @@ -49166,6 +63143,15 @@ private constructor( @JsonProperty("price_type") @ExcludeMissing private val priceType: JsonField = JsonMissing.of(), + @JsonProperty("scalable_matrix_with_tiered_pricing_config") + @ExcludeMissing + private val scalableMatrixWithTieredPricingConfig: + JsonField = + JsonMissing.of(), + @JsonProperty("dimensional_price_configuration") + @ExcludeMissing + private val dimensionalPriceConfiguration: JsonField = + JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { @@ -49205,9 +63191,6 @@ private constructor( fun item(): Item = item.getRequired("item") - fun maxGroupTieredPackageConfig(): MaxGroupTieredPackageConfig = - maxGroupTieredPackageConfig.getRequired("max_group_tiered_package_config") - fun maximum(): Optional = Optional.ofNullable(maximum.getNullable("maximum")) fun maximumAmount(): Optional = @@ -49234,6 +63217,16 @@ private constructor( fun priceType(): PriceType = priceType.getRequired("price_type") + fun scalableMatrixWithTieredPricingConfig(): ScalableMatrixWithTieredPricingConfig = + scalableMatrixWithTieredPricingConfig.getRequired( + "scalable_matrix_with_tiered_pricing_config" + ) + + fun dimensionalPriceConfiguration(): Optional = + Optional.ofNullable( + dimensionalPriceConfiguration.getNullable("dimensional_price_configuration") + ) + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id @JsonProperty("billable_metric") @@ -49278,11 +63271,6 @@ private constructor( @JsonProperty("item") @ExcludeMissing fun _item(): JsonField = item - @JsonProperty("max_group_tiered_package_config") - @ExcludeMissing - fun _maxGroupTieredPackageConfig(): JsonField = - maxGroupTieredPackageConfig - @JsonProperty("maximum") @ExcludeMissing fun _maximum(): JsonField = maximum @JsonProperty("maximum_amount") @@ -49316,13 +63304,23 @@ private constructor( @ExcludeMissing fun _priceType(): JsonField = priceType + @JsonProperty("scalable_matrix_with_tiered_pricing_config") + @ExcludeMissing + fun _scalableMatrixWithTieredPricingConfig(): + JsonField = scalableMatrixWithTieredPricingConfig + + @JsonProperty("dimensional_price_configuration") + @ExcludeMissing + fun _dimensionalPriceConfiguration(): JsonField = + dimensionalPriceConfiguration + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties private var validated: Boolean = false - fun validate(): MaxGroupTieredPackagePrice = apply { + fun validate(): ScalableMatrixWithTieredPricingPrice = apply { if (validated) { return@apply } @@ -49340,7 +63338,6 @@ private constructor( fixedPriceQuantity() invoicingCycleConfiguration().ifPresent { it.validate() } item().validate() - maxGroupTieredPackageConfig().validate() maximum().ifPresent { it.validate() } maximumAmount() metadata().validate() @@ -49350,6 +63347,8 @@ private constructor( name() planPhaseOrder() priceType() + scalableMatrixWithTieredPricingConfig().validate() + dimensionalPriceConfiguration().ifPresent { it.validate() } validated = true } @@ -49360,7 +63359,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [ScalableMatrixWithTieredPricingPrice]. */ + class Builder internal constructor() { private var id: JsonField? = null private var billableMetric: JsonField? = null @@ -49375,7 +63375,6 @@ private constructor( private var fixedPriceQuantity: JsonField? = null private var invoicingCycleConfiguration: JsonField? = null private var item: JsonField? = null - private var maxGroupTieredPackageConfig: JsonField? = null private var maximum: JsonField? = null private var maximumAmount: JsonField? = null private var metadata: JsonField? = null @@ -49385,35 +63384,47 @@ private constructor( private var name: JsonField? = null private var planPhaseOrder: JsonField? = null private var priceType: JsonField? = null + private var scalableMatrixWithTieredPricingConfig: + JsonField? = + null + private var dimensionalPriceConfiguration: JsonField = + JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(maxGroupTieredPackagePrice: MaxGroupTieredPackagePrice) = apply { - id = maxGroupTieredPackagePrice.id - billableMetric = maxGroupTieredPackagePrice.billableMetric - billingCycleConfiguration = maxGroupTieredPackagePrice.billingCycleConfiguration - cadence = maxGroupTieredPackagePrice.cadence - conversionRate = maxGroupTieredPackagePrice.conversionRate - createdAt = maxGroupTieredPackagePrice.createdAt - creditAllocation = maxGroupTieredPackagePrice.creditAllocation - currency = maxGroupTieredPackagePrice.currency - discount = maxGroupTieredPackagePrice.discount - externalPriceId = maxGroupTieredPackagePrice.externalPriceId - fixedPriceQuantity = maxGroupTieredPackagePrice.fixedPriceQuantity - invoicingCycleConfiguration = maxGroupTieredPackagePrice.invoicingCycleConfiguration - item = maxGroupTieredPackagePrice.item - maxGroupTieredPackageConfig = maxGroupTieredPackagePrice.maxGroupTieredPackageConfig - maximum = maxGroupTieredPackagePrice.maximum - maximumAmount = maxGroupTieredPackagePrice.maximumAmount - metadata = maxGroupTieredPackagePrice.metadata - minimum = maxGroupTieredPackagePrice.minimum - minimumAmount = maxGroupTieredPackagePrice.minimumAmount - modelType = maxGroupTieredPackagePrice.modelType - name = maxGroupTieredPackagePrice.name - planPhaseOrder = maxGroupTieredPackagePrice.planPhaseOrder - priceType = maxGroupTieredPackagePrice.priceType + internal fun from( + scalableMatrixWithTieredPricingPrice: ScalableMatrixWithTieredPricingPrice + ) = apply { + id = scalableMatrixWithTieredPricingPrice.id + billableMetric = scalableMatrixWithTieredPricingPrice.billableMetric + billingCycleConfiguration = + scalableMatrixWithTieredPricingPrice.billingCycleConfiguration + cadence = scalableMatrixWithTieredPricingPrice.cadence + conversionRate = scalableMatrixWithTieredPricingPrice.conversionRate + createdAt = scalableMatrixWithTieredPricingPrice.createdAt + creditAllocation = scalableMatrixWithTieredPricingPrice.creditAllocation + currency = scalableMatrixWithTieredPricingPrice.currency + discount = scalableMatrixWithTieredPricingPrice.discount + externalPriceId = scalableMatrixWithTieredPricingPrice.externalPriceId + fixedPriceQuantity = scalableMatrixWithTieredPricingPrice.fixedPriceQuantity + invoicingCycleConfiguration = + scalableMatrixWithTieredPricingPrice.invoicingCycleConfiguration + item = scalableMatrixWithTieredPricingPrice.item + maximum = scalableMatrixWithTieredPricingPrice.maximum + maximumAmount = scalableMatrixWithTieredPricingPrice.maximumAmount + metadata = scalableMatrixWithTieredPricingPrice.metadata + minimum = scalableMatrixWithTieredPricingPrice.minimum + minimumAmount = scalableMatrixWithTieredPricingPrice.minimumAmount + modelType = scalableMatrixWithTieredPricingPrice.modelType + name = scalableMatrixWithTieredPricingPrice.name + planPhaseOrder = scalableMatrixWithTieredPricingPrice.planPhaseOrder + priceType = scalableMatrixWithTieredPricingPrice.priceType + scalableMatrixWithTieredPricingConfig = + scalableMatrixWithTieredPricingPrice.scalableMatrixWithTieredPricingConfig + dimensionalPriceConfiguration = + scalableMatrixWithTieredPricingPrice.dimensionalPriceConfiguration additionalProperties = - maxGroupTieredPackagePrice.additionalProperties.toMutableMap() + scalableMatrixWithTieredPricingPrice.additionalProperties.toMutableMap() } fun id(id: String) = id(JsonField.of(id)) @@ -49485,6 +63496,14 @@ private constructor( fun discount(trial: TrialDiscount) = discount(Discount.ofTrial(trial)) + fun trialDiscount(appliesToPriceIds: List) = + discount( + TrialDiscount.builder() + .discountType(TrialDiscount.DiscountType.TRIAL) + .appliesToPriceIds(appliesToPriceIds) + .build() + ) + fun discount(usage: Discount.UsageDiscount) = discount(Discount.ofUsage(usage)) fun discount(amount: AmountDiscount) = discount(Discount.ofAmount(amount)) @@ -49529,14 +63548,6 @@ private constructor( fun item(item: JsonField) = apply { this.item = item } - fun maxGroupTieredPackageConfig( - maxGroupTieredPackageConfig: MaxGroupTieredPackageConfig - ) = maxGroupTieredPackageConfig(JsonField.of(maxGroupTieredPackageConfig)) - - fun maxGroupTieredPackageConfig( - maxGroupTieredPackageConfig: JsonField - ) = apply { this.maxGroupTieredPackageConfig = maxGroupTieredPackageConfig } - fun maximum(maximum: Maximum?) = maximum(JsonField.ofNullable(maximum)) fun maximum(maximum: Optional) = maximum(maximum.orElse(null)) @@ -49608,6 +63619,32 @@ private constructor( fun priceType(priceType: JsonField) = apply { this.priceType = priceType } + fun scalableMatrixWithTieredPricingConfig( + scalableMatrixWithTieredPricingConfig: ScalableMatrixWithTieredPricingConfig + ) = + scalableMatrixWithTieredPricingConfig( + JsonField.of(scalableMatrixWithTieredPricingConfig) + ) + + fun scalableMatrixWithTieredPricingConfig( + scalableMatrixWithTieredPricingConfig: + JsonField + ) = apply { + this.scalableMatrixWithTieredPricingConfig = scalableMatrixWithTieredPricingConfig + } + + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: DimensionalPriceConfiguration? + ) = dimensionalPriceConfiguration(JsonField.ofNullable(dimensionalPriceConfiguration)) + + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: Optional + ) = dimensionalPriceConfiguration(dimensionalPriceConfiguration.orElse(null)) + + fun dimensionalPriceConfiguration( + dimensionalPriceConfiguration: JsonField + ) = apply { this.dimensionalPriceConfiguration = dimensionalPriceConfiguration } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -49627,8 +63664,8 @@ private constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): MaxGroupTieredPackagePrice = - MaxGroupTieredPackagePrice( + fun build(): ScalableMatrixWithTieredPricingPrice = + ScalableMatrixWithTieredPricingPrice( checkRequired("id", id), checkRequired("billableMetric", billableMetric), checkRequired("billingCycleConfiguration", billingCycleConfiguration), @@ -49642,7 +63679,6 @@ private constructor( checkRequired("fixedPriceQuantity", fixedPriceQuantity), checkRequired("invoicingCycleConfiguration", invoicingCycleConfiguration), checkRequired("item", item), - checkRequired("maxGroupTieredPackageConfig", maxGroupTieredPackageConfig), checkRequired("maximum", maximum), checkRequired("maximumAmount", maximumAmount), checkRequired("metadata", metadata), @@ -49652,6 +63688,11 @@ private constructor( checkRequired("name", name), checkRequired("planPhaseOrder", planPhaseOrder), checkRequired("priceType", priceType), + checkRequired( + "scalableMatrixWithTieredPricingConfig", + scalableMatrixWithTieredPricingConfig + ), + dimensionalPriceConfiguration, additionalProperties.toImmutable(), ) } @@ -49693,7 +63734,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillableMetric]. */ + class Builder internal constructor() { private var id: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -49799,7 +63841,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -49860,6 +63903,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -49871,17 +63922,39 @@ private constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -49889,6 +63962,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -49935,6 +64017,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -49954,6 +64044,7 @@ private constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ONE_TIME, MONTHLY, @@ -49963,6 +64054,15 @@ private constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ONE_TIME, MONTHLY, @@ -49970,9 +64070,19 @@ private constructor( SEMI_ANNUAL, ANNUAL, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { ONE_TIME -> Value.ONE_TIME @@ -49984,6 +64094,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ONE_TIME -> Known.ONE_TIME @@ -50057,7 +64176,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [CreditAllocation]. */ + class Builder internal constructor() { private var allowsRollover: JsonField? = null private var currency: JsonField? = null @@ -50176,7 +64296,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -50238,6 +64359,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -50249,17 +64378,39 @@ private constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -50267,6 +64418,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -50352,7 +64512,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Item]. */ + class Builder internal constructor() { private var id: JsonField? = null private var name: JsonField? = null @@ -50421,90 +64582,6 @@ private constructor( "Item{id=$id, name=$name, additionalProperties=$additionalProperties}" } - @NoAutoDetect - class MaxGroupTieredPackageConfig - @JsonCreator - private constructor( - @JsonAnySetter - private val additionalProperties: Map = immutableEmptyMap(), - ) { - - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = additionalProperties - - private var validated: Boolean = false - - fun validate(): MaxGroupTieredPackageConfig = 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(maxGroupTieredPackageConfig: MaxGroupTieredPackageConfig) = - apply { - additionalProperties = - maxGroupTieredPackageConfig.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(): MaxGroupTieredPackageConfig = - MaxGroupTieredPackageConfig(additionalProperties.toImmutable()) - } - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is MaxGroupTieredPackageConfig && 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() = - "MaxGroupTieredPackageConfig{additionalProperties=$additionalProperties}" - } - @NoAutoDetect class Maximum @JsonCreator @@ -50565,7 +64642,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Maximum]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var maximumAmount: JsonField? = null @@ -50703,7 +64781,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -50814,7 +64893,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Minimum]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var minimumAmount: JsonField? = null @@ -50924,33 +65004,72 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { - @JvmField val MAX_GROUP_TIERED_PACKAGE = of("max_group_tiered_package") + @JvmField + val SCALABLE_MATRIX_WITH_TIERED_PRICING = of("scalable_matrix_with_tiered_pricing") @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { - MAX_GROUP_TIERED_PACKAGE, + SCALABLE_MATRIX_WITH_TIERED_PRICING, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { - MAX_GROUP_TIERED_PACKAGE, + SCALABLE_MATRIX_WITH_TIERED_PRICING, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { - MAX_GROUP_TIERED_PACKAGE -> Value.MAX_GROUP_TIERED_PACKAGE + SCALABLE_MATRIX_WITH_TIERED_PRICING -> Value.SCALABLE_MATRIX_WITH_TIERED_PRICING else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { - MAX_GROUP_TIERED_PACKAGE -> Known.MAX_GROUP_TIERED_PACKAGE + SCALABLE_MATRIX_WITH_TIERED_PRICING -> Known.SCALABLE_MATRIX_WITH_TIERED_PRICING else -> throw OrbInvalidDataException("Unknown ModelType: $value") } @@ -50975,6 +65094,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -50986,17 +65113,38 @@ private constructor( @JvmStatic fun of(value: String) = PriceType(JsonField.of(value)) } + /** An enum containing [PriceType]'s known values. */ enum class Known { USAGE_PRICE, FIXED_PRICE, } + /** + * An enum containing [PriceType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [PriceType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { USAGE_PRICE, FIXED_PRICE, + /** + * An enum member indicating that [PriceType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { USAGE_PRICE -> Value.USAGE_PRICE @@ -51004,6 +65152,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { USAGE_PRICE -> Known.USAGE_PRICE @@ -51026,21 +65183,250 @@ private constructor( override fun toString() = value.toString() } + @NoAutoDetect + class ScalableMatrixWithTieredPricingConfig + @JsonCreator + private constructor( + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): ScalableMatrixWithTieredPricingConfig = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + /** A builder for [ScalableMatrixWithTieredPricingConfig]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from( + scalableMatrixWithTieredPricingConfig: ScalableMatrixWithTieredPricingConfig + ) = apply { + additionalProperties = + scalableMatrixWithTieredPricingConfig.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(): ScalableMatrixWithTieredPricingConfig = + ScalableMatrixWithTieredPricingConfig(additionalProperties.toImmutable()) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is ScalableMatrixWithTieredPricingConfig && 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() = + "ScalableMatrixWithTieredPricingConfig{additionalProperties=$additionalProperties}" + } + + @NoAutoDetect + class DimensionalPriceConfiguration + @JsonCreator + private constructor( + @JsonProperty("dimension_values") + @ExcludeMissing + private val dimensionValues: JsonField> = JsonMissing.of(), + @JsonProperty("dimensional_price_group_id") + @ExcludeMissing + private val dimensionalPriceGroupId: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { + + fun dimensionValues(): List = dimensionValues.getRequired("dimension_values") + + fun dimensionalPriceGroupId(): String = + dimensionalPriceGroupId.getRequired("dimensional_price_group_id") + + @JsonProperty("dimension_values") + @ExcludeMissing + fun _dimensionValues(): JsonField> = dimensionValues + + @JsonProperty("dimensional_price_group_id") + @ExcludeMissing + fun _dimensionalPriceGroupId(): JsonField = dimensionalPriceGroupId + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): DimensionalPriceConfiguration = apply { + if (validated) { + return@apply + } + + dimensionValues() + dimensionalPriceGroupId() + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + /** A builder for [DimensionalPriceConfiguration]. */ + class Builder internal constructor() { + + private var dimensionValues: JsonField>? = null + private var dimensionalPriceGroupId: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(dimensionalPriceConfiguration: DimensionalPriceConfiguration) = + apply { + dimensionValues = + dimensionalPriceConfiguration.dimensionValues.map { it.toMutableList() } + dimensionalPriceGroupId = + dimensionalPriceConfiguration.dimensionalPriceGroupId + additionalProperties = + dimensionalPriceConfiguration.additionalProperties.toMutableMap() + } + + fun dimensionValues(dimensionValues: List) = + dimensionValues(JsonField.of(dimensionValues)) + + fun dimensionValues(dimensionValues: JsonField>) = apply { + this.dimensionValues = dimensionValues.map { it.toMutableList() } + } + + fun addDimensionValue(dimensionValue: String) = apply { + dimensionValues = + (dimensionValues ?: JsonField.of(mutableListOf())).apply { + asKnown() + .orElseThrow { + IllegalStateException( + "Field was set to non-list type: ${javaClass.simpleName}" + ) + } + .add(dimensionValue) + } + } + + fun dimensionalPriceGroupId(dimensionalPriceGroupId: String) = + dimensionalPriceGroupId(JsonField.of(dimensionalPriceGroupId)) + + fun dimensionalPriceGroupId(dimensionalPriceGroupId: JsonField) = apply { + this.dimensionalPriceGroupId = dimensionalPriceGroupId + } + + 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(): DimensionalPriceConfiguration = + DimensionalPriceConfiguration( + checkRequired("dimensionValues", dimensionValues).map { it.toImmutable() }, + checkRequired("dimensionalPriceGroupId", dimensionalPriceGroupId), + additionalProperties.toImmutable(), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is DimensionalPriceConfiguration && dimensionValues == other.dimensionValues && dimensionalPriceGroupId == other.dimensionalPriceGroupId && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(dimensionValues, dimensionalPriceGroupId, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "DimensionalPriceConfiguration{dimensionValues=$dimensionValues, dimensionalPriceGroupId=$dimensionalPriceGroupId, additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true } - return /* spotless:off */ other is MaxGroupTieredPackagePrice && 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 && maxGroupTieredPackageConfig == other.maxGroupTieredPackageConfig && 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 ScalableMatrixWithTieredPricingPrice && 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 && scalableMatrixWithTieredPricingConfig == other.scalableMatrixWithTieredPricingConfig && dimensionalPriceConfiguration == other.dimensionalPriceConfiguration && 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, maxGroupTieredPackageConfig, 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, scalableMatrixWithTieredPricingConfig, dimensionalPriceConfiguration, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "MaxGroupTieredPackagePrice{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, maxGroupTieredPackageConfig=$maxGroupTieredPackageConfig, maximum=$maximum, maximumAmount=$maximumAmount, metadata=$metadata, minimum=$minimum, minimumAmount=$minimumAmount, modelType=$modelType, name=$name, planPhaseOrder=$planPhaseOrder, priceType=$priceType, additionalProperties=$additionalProperties}" + "ScalableMatrixWithTieredPricingPrice{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, scalableMatrixWithTieredPricingConfig=$scalableMatrixWithTieredPricingConfig, dimensionalPriceConfiguration=$dimensionalPriceConfiguration, 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 2bc785e2..42fe1b61 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 @@ -21,6 +21,7 @@ import com.withorb.api.core.JsonField import com.withorb.api.core.JsonMissing import com.withorb.api.core.JsonValue import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.getOrThrow import com.withorb.api.core.http.Headers @@ -45,11 +46,11 @@ import kotlin.jvm.optionals.getOrNull * price model configurations possible in this endpoint. */ class PriceCreateParams -constructor( +private constructor( private val body: PriceCreateBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun newFloatingUnitPrice(): Optional = body.newFloatingUnitPrice() @@ -124,15 +125,23 @@ constructor( fun newFloatingGroupedTieredPackagePrice(): Optional = body.newFloatingGroupedTieredPackagePrice() + fun newFloatingScalableMatrixWithUnitPricingPrice(): + Optional = + body.newFloatingScalableMatrixWithUnitPricingPrice() + + fun newFloatingScalableMatrixWithTieredPricingPrice(): + Optional = + body.newFloatingScalableMatrixWithTieredPricingPrice() + fun _additionalHeaders(): Headers = additionalHeaders fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getBody(): PriceCreateBody = body + @JvmSynthetic internal fun _body(): PriceCreateBody = body - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams @JsonDeserialize(using = PriceCreateBody.Deserializer::class) @JsonSerialize(using = PriceCreateBody.Serializer::class) @@ -176,6 +185,12 @@ constructor( private val newFloatingBulkWithProrationPrice: NewFloatingBulkWithProrationPrice? = null, private val newFloatingGroupedTieredPackagePrice: NewFloatingGroupedTieredPackagePrice? = null, + private val newFloatingScalableMatrixWithUnitPricingPrice: + NewFloatingScalableMatrixWithUnitPricingPrice? = + null, + private val newFloatingScalableMatrixWithTieredPricingPrice: + NewFloatingScalableMatrixWithTieredPricingPrice? = + null, private val _json: JsonValue? = null, ) { @@ -260,6 +275,14 @@ constructor( fun newFloatingGroupedTieredPackagePrice(): Optional = Optional.ofNullable(newFloatingGroupedTieredPackagePrice) + fun newFloatingScalableMatrixWithUnitPricingPrice(): + Optional = + Optional.ofNullable(newFloatingScalableMatrixWithUnitPricingPrice) + + fun newFloatingScalableMatrixWithTieredPricingPrice(): + Optional = + Optional.ofNullable(newFloatingScalableMatrixWithTieredPricingPrice) + fun isNewFloatingUnitPrice(): Boolean = newFloatingUnitPrice != null fun isNewFloatingPackagePrice(): Boolean = newFloatingPackagePrice != null @@ -324,6 +347,12 @@ constructor( fun isNewFloatingGroupedTieredPackagePrice(): Boolean = newFloatingGroupedTieredPackagePrice != null + fun isNewFloatingScalableMatrixWithUnitPricingPrice(): Boolean = + newFloatingScalableMatrixWithUnitPricingPrice != null + + fun isNewFloatingScalableMatrixWithTieredPricingPrice(): Boolean = + newFloatingScalableMatrixWithTieredPricingPrice != null + fun asNewFloatingUnitPrice(): NewFloatingUnitPrice = newFloatingUnitPrice.getOrThrow("newFloatingUnitPrice") @@ -413,6 +442,18 @@ constructor( fun asNewFloatingGroupedTieredPackagePrice(): NewFloatingGroupedTieredPackagePrice = newFloatingGroupedTieredPackagePrice.getOrThrow("newFloatingGroupedTieredPackagePrice") + fun asNewFloatingScalableMatrixWithUnitPricingPrice(): + NewFloatingScalableMatrixWithUnitPricingPrice = + newFloatingScalableMatrixWithUnitPricingPrice.getOrThrow( + "newFloatingScalableMatrixWithUnitPricingPrice" + ) + + fun asNewFloatingScalableMatrixWithTieredPricingPrice(): + NewFloatingScalableMatrixWithTieredPricingPrice = + newFloatingScalableMatrixWithTieredPricingPrice.getOrThrow( + "newFloatingScalableMatrixWithTieredPricingPrice" + ) + fun _json(): Optional = Optional.ofNullable(_json) fun accept(visitor: Visitor): T { @@ -494,6 +535,14 @@ constructor( visitor.visitNewFloatingGroupedTieredPackagePrice( newFloatingGroupedTieredPackagePrice ) + newFloatingScalableMatrixWithUnitPricingPrice != null -> + visitor.visitNewFloatingScalableMatrixWithUnitPricingPrice( + newFloatingScalableMatrixWithUnitPricingPrice + ) + newFloatingScalableMatrixWithTieredPricingPrice != null -> + visitor.visitNewFloatingScalableMatrixWithTieredPricingPrice( + newFloatingScalableMatrixWithTieredPricingPrice + ) else -> visitor.unknown(_json) } } @@ -503,10 +552,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 && newFloatingMaxGroupTieredPackagePrice == other.newFloatingMaxGroupTieredPackagePrice && 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 && newFloatingMaxGroupTieredPackagePrice == other.newFloatingMaxGroupTieredPackagePrice && 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 && newFloatingScalableMatrixWithUnitPricingPrice == other.newFloatingScalableMatrixWithUnitPricingPrice && newFloatingScalableMatrixWithTieredPricingPrice == other.newFloatingScalableMatrixWithTieredPricingPrice /* spotless:on */ } - override fun hashCode(): Int = /* spotless:off */ Objects.hash(newFloatingUnitPrice, newFloatingPackagePrice, newFloatingMatrixPrice, newFloatingMatrixWithAllocationPrice, newFloatingTieredPrice, newFloatingTieredBpsPrice, newFloatingBpsPrice, newFloatingBulkBpsPrice, newFloatingBulkPrice, newFloatingThresholdTotalAmountPrice, newFloatingTieredPackagePrice, newFloatingGroupedTieredPrice, newFloatingMaxGroupTieredPackagePrice, 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, newFloatingMaxGroupTieredPackagePrice, newFloatingTieredWithMinimumPrice, newFloatingPackageWithAllocationPrice, newFloatingTieredPackageWithMinimumPrice, newFloatingUnitWithPercentPrice, newFloatingTieredWithProrationPrice, newFloatingUnitWithProrationPrice, newFloatingGroupedAllocationPrice, newFloatingGroupedWithProratedMinimumPrice, newFloatingGroupedWithMeteredMinimumPrice, newFloatingMatrixWithDisplayNamePrice, newFloatingBulkWithProrationPrice, newFloatingGroupedTieredPackagePrice, newFloatingScalableMatrixWithUnitPricingPrice, newFloatingScalableMatrixWithTieredPricingPrice) /* spotless:on */ override fun toString(): String = when { @@ -560,6 +609,10 @@ constructor( "PriceCreateBody{newFloatingBulkWithProrationPrice=$newFloatingBulkWithProrationPrice}" newFloatingGroupedTieredPackagePrice != null -> "PriceCreateBody{newFloatingGroupedTieredPackagePrice=$newFloatingGroupedTieredPackagePrice}" + newFloatingScalableMatrixWithUnitPricingPrice != null -> + "PriceCreateBody{newFloatingScalableMatrixWithUnitPricingPrice=$newFloatingScalableMatrixWithUnitPricingPrice}" + newFloatingScalableMatrixWithTieredPricingPrice != null -> + "PriceCreateBody{newFloatingScalableMatrixWithTieredPricingPrice=$newFloatingScalableMatrixWithTieredPricingPrice}" _json != null -> "PriceCreateBody{_unknown=$_json}" else -> throw IllegalStateException("Invalid PriceCreateBody") } @@ -728,8 +781,32 @@ constructor( PriceCreateBody( newFloatingGroupedTieredPackagePrice = newFloatingGroupedTieredPackagePrice ) + + @JvmStatic + fun ofNewFloatingScalableMatrixWithUnitPricingPrice( + newFloatingScalableMatrixWithUnitPricingPrice: + NewFloatingScalableMatrixWithUnitPricingPrice + ) = + PriceCreateBody( + newFloatingScalableMatrixWithUnitPricingPrice = + newFloatingScalableMatrixWithUnitPricingPrice + ) + + @JvmStatic + fun ofNewFloatingScalableMatrixWithTieredPricingPrice( + newFloatingScalableMatrixWithTieredPricingPrice: + NewFloatingScalableMatrixWithTieredPricingPrice + ) = + PriceCreateBody( + newFloatingScalableMatrixWithTieredPricingPrice = + newFloatingScalableMatrixWithTieredPricingPrice + ) } + /** + * An interface that defines how to map each variant of [PriceCreateBody] to a value of type + * [T]. + */ interface Visitor { fun visitNewFloatingUnitPrice(newFloatingUnitPrice: NewFloatingUnitPrice): T @@ -819,12 +896,32 @@ constructor( newFloatingGroupedTieredPackagePrice: NewFloatingGroupedTieredPackagePrice ): T + fun visitNewFloatingScalableMatrixWithUnitPricingPrice( + newFloatingScalableMatrixWithUnitPricingPrice: + NewFloatingScalableMatrixWithUnitPricingPrice + ): T + + fun visitNewFloatingScalableMatrixWithTieredPricingPrice( + newFloatingScalableMatrixWithTieredPricingPrice: + NewFloatingScalableMatrixWithTieredPricingPrice + ): T + + /** + * Maps an unknown variant of [PriceCreateBody] to a value of type [T]. + * + * An instance of [PriceCreateBody] can contain an unknown variant if it was + * deserialized from data that doesn't match any known variant. For example, if the SDK + * is on an older version than the API, then the API may respond with new variants that + * the SDK is unaware of. + * + * @throws OrbInvalidDataException in the default implementation. + */ fun unknown(json: JsonValue?): T { throw OrbInvalidDataException("Unknown PriceCreateBody: $json") } } - class Deserializer : BaseDeserializer(PriceCreateBody::class) { + internal class Deserializer : BaseDeserializer(PriceCreateBody::class) { override fun ObjectCodec.deserialize(node: JsonNode): PriceCreateBody { val json = JsonValue.fromJsonNode(node) @@ -1035,13 +1132,37 @@ constructor( ) } } + "scalable_matrix_with_unit_pricing" -> { + tryDeserialize( + node, + jacksonTypeRef() + ) + ?.let { + return PriceCreateBody( + newFloatingScalableMatrixWithUnitPricingPrice = it, + _json = json + ) + } + } + "scalable_matrix_with_tiered_pricing" -> { + tryDeserialize( + node, + jacksonTypeRef() + ) + ?.let { + return PriceCreateBody( + newFloatingScalableMatrixWithTieredPricingPrice = it, + _json = json + ) + } + } } return PriceCreateBody(_json = json) } } - class Serializer : BaseSerializer(PriceCreateBody::class) { + internal class Serializer : BaseSerializer(PriceCreateBody::class) { override fun serialize( value: PriceCreateBody, @@ -1099,6 +1220,10 @@ constructor( generator.writeObject(value.newFloatingBulkWithProrationPrice) value.newFloatingGroupedTieredPackagePrice != null -> generator.writeObject(value.newFloatingGroupedTieredPackagePrice) + value.newFloatingScalableMatrixWithUnitPricingPrice != null -> + generator.writeObject(value.newFloatingScalableMatrixWithUnitPricingPrice) + value.newFloatingScalableMatrixWithTieredPricingPrice != null -> + generator.writeObject(value.newFloatingScalableMatrixWithTieredPricingPrice) value._json != null -> generator.writeObject(value._json) else -> throw IllegalStateException("Invalid PriceCreateBody") } @@ -1113,8 +1238,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [PriceCreateParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var body: PriceCreateBody? = null private var additionalHeaders: Headers.Builder = Headers.builder() @@ -1305,6 +1431,26 @@ constructor( ) } + fun forNewFloatingScalableMatrixWithUnitPricingPrice( + newFloatingScalableMatrixWithUnitPricingPrice: + NewFloatingScalableMatrixWithUnitPricingPrice + ) = apply { + body = + PriceCreateBody.ofNewFloatingScalableMatrixWithUnitPricingPrice( + newFloatingScalableMatrixWithUnitPricingPrice + ) + } + + fun forNewFloatingScalableMatrixWithTieredPricingPrice( + newFloatingScalableMatrixWithTieredPricingPrice: + NewFloatingScalableMatrixWithTieredPricingPrice + ) = apply { + body = + PriceCreateBody.ofNewFloatingScalableMatrixWithTieredPricingPrice( + newFloatingScalableMatrixWithTieredPricingPrice + ) + } + fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() putAllAdditionalHeaders(additionalHeaders) @@ -1642,7 +1788,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewFloatingUnitPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var currency: JsonField? = null @@ -1947,6 +2094,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -1966,6 +2121,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -1975,6 +2131,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -1982,9 +2147,19 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -1996,6 +2171,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -2028,6 +2212,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -2037,21 +2229,51 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { UNIT, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { UNIT, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { UNIT -> Value.UNIT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { UNIT -> Known.UNIT @@ -2114,7 +2336,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [UnitConfig]. */ + class Builder internal constructor() { private var unitAmount: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -2232,7 +2455,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -2298,6 +2522,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -2309,17 +2541,39 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -2327,6 +2581,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -2422,7 +2685,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -2489,6 +2753,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -2500,17 +2772,39 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -2518,6 +2812,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -2592,7 +2895,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -2892,7 +3196,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewFloatingPackagePrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var currency: JsonField? = null @@ -3198,6 +3503,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -3217,6 +3530,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -3226,6 +3540,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -3233,9 +3556,19 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -3247,6 +3580,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -3279,6 +3621,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -3288,21 +3638,51 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { PACKAGE, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PACKAGE, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { PACKAGE -> Value.PACKAGE else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { PACKAGE -> Known.PACKAGE @@ -3383,7 +3763,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [PackageConfig]. */ + class Builder internal constructor() { private var packageAmount: JsonField? = null private var packageSize: JsonField? = null @@ -3519,7 +3900,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -3585,6 +3967,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -3596,17 +3986,39 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -3614,6 +4026,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -3709,7 +4130,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -3776,6 +4198,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -3787,17 +4217,39 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -3805,6 +4257,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -3879,7 +4340,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -4179,7 +4641,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewFloatingMatrixPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var currency: JsonField? = null @@ -4484,6 +4947,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -4503,6 +4974,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -4512,6 +4984,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -4519,9 +5000,19 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -4533,6 +5024,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -4624,7 +5124,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MatrixConfig]. */ + class Builder internal constructor() { private var defaultUnitAmount: JsonField? = null private var dimensions: JsonField>? = null @@ -4790,7 +5291,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MatrixValue]. */ + class Builder internal constructor() { private var dimensionValues: JsonField>? = null private var unitAmount: JsonField? = null @@ -4920,6 +5422,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -4929,21 +5439,51 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { MATRIX, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { MATRIX, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { MATRIX -> Value.MATRIX else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { MATRIX -> Known.MATRIX @@ -5017,7 +5557,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -5083,6 +5624,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -5094,17 +5643,39 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -5112,6 +5683,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -5207,7 +5787,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -5274,6 +5855,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -5285,17 +5874,39 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -5303,6 +5914,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -5377,7 +5997,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -5680,7 +6301,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewFloatingMatrixWithAllocationPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var currency: JsonField? = null @@ -5992,6 +6614,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -6011,6 +6641,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -6020,6 +6651,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -6027,9 +6667,19 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -6041,6 +6691,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -6144,7 +6803,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MatrixWithAllocationConfig]. */ + class Builder internal constructor() { private var allocation: JsonField? = null private var defaultUnitAmount: JsonField? = null @@ -6323,7 +6983,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MatrixValue]. */ + class Builder internal constructor() { private var dimensionValues: JsonField>? = null private var unitAmount: JsonField? = null @@ -6453,6 +7114,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -6462,21 +7131,51 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { MATRIX_WITH_ALLOCATION, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { MATRIX_WITH_ALLOCATION, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { MATRIX_WITH_ALLOCATION -> Value.MATRIX_WITH_ALLOCATION else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { MATRIX_WITH_ALLOCATION -> Known.MATRIX_WITH_ALLOCATION @@ -6550,7 +7249,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -6616,6 +7316,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -6627,17 +7335,39 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -6645,6 +7375,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -6740,7 +7479,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -6807,6 +7547,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -6818,17 +7566,39 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -6836,6 +7606,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -6910,7 +7689,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -7210,7 +7990,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewFloatingTieredPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var currency: JsonField? = null @@ -7515,6 +8296,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -7534,6 +8323,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -7543,6 +8333,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -7550,9 +8349,19 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -7564,6 +8373,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -7596,6 +8414,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -7605,21 +8431,51 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { TIERED, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { TIERED, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { TIERED -> Value.TIERED else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { TIERED -> Known.TIERED @@ -7680,7 +8536,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TieredConfig]. */ + class Builder internal constructor() { private var tiers: JsonField>? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -7808,7 +8665,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Tier]. */ + class Builder internal constructor() { private var firstUnit: JsonField? = null private var unitAmount: JsonField? = null @@ -7972,7 +8830,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -8038,6 +8897,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -8049,17 +8916,39 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -8067,6 +8956,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -8162,7 +9060,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -8229,6 +9128,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -8240,17 +9147,39 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -8258,6 +9187,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -8332,7 +9270,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -8632,7 +9571,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewFloatingTieredBpsPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var currency: JsonField? = null @@ -8938,6 +9878,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -8957,6 +9905,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -8966,6 +9915,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -8973,9 +9931,19 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -8987,6 +9955,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -9019,6 +9996,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -9028,21 +10013,51 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { TIERED_BPS, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { TIERED_BPS, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { TIERED_BPS -> Value.TIERED_BPS else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { TIERED_BPS -> Known.TIERED_BPS @@ -9107,7 +10122,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TieredBpsConfig]. */ + class Builder internal constructor() { private var tiers: JsonField>? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -9255,7 +10271,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Tier]. */ + class Builder internal constructor() { private var bps: JsonField? = null private var minimumAmount: JsonField? = null @@ -9433,7 +10450,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -9499,6 +10517,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -9510,17 +10536,39 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -9528,6 +10576,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -9623,7 +10680,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -9690,6 +10748,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -9701,17 +10767,39 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -9719,6 +10807,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -9793,7 +10890,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -10093,7 +11191,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewFloatingBpsPrice]. */ + class Builder internal constructor() { private var bpsConfig: JsonField? = null private var cadence: JsonField? = null @@ -10441,7 +11540,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BpsConfig]. */ + class Builder internal constructor() { private var bps: JsonField? = null private var perUnitMaximum: JsonField = JsonMissing.of() @@ -10528,6 +11628,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -10547,6 +11655,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -10556,6 +11665,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -10563,9 +11681,19 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -10577,6 +11705,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -10609,6 +11746,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -10618,21 +11763,51 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { BPS, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { BPS, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { BPS -> Value.BPS else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { BPS -> Known.BPS @@ -10706,7 +11881,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -10772,6 +11948,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -10783,17 +11967,39 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -10801,6 +12007,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -10896,7 +12111,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -10963,6 +12179,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -10974,17 +12198,39 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -10992,6 +12238,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -11066,7 +12321,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -11366,7 +12622,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewFloatingBulkBpsPrice]. */ + class Builder internal constructor() { private var bulkBpsConfig: JsonField? = null private var cadence: JsonField? = null @@ -11710,7 +12967,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BulkBpsConfig]. */ + class Builder internal constructor() { private var tiers: JsonField>? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -11846,7 +13104,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Tier]. */ + class Builder internal constructor() { private var bps: JsonField? = null private var maximumAmount: JsonField = JsonMissing.of() @@ -11967,6 +13226,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -11986,6 +13253,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -11995,6 +13263,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -12002,9 +13279,19 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -12016,6 +13303,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -12048,6 +13344,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -12057,21 +13361,51 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { BULK_BPS, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { BULK_BPS, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { BULK_BPS -> Value.BULK_BPS else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { BULK_BPS -> Known.BULK_BPS @@ -12145,7 +13479,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -12211,6 +13546,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -12222,17 +13565,39 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -12240,6 +13605,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -12335,7 +13709,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -12402,6 +13777,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -12413,17 +13796,39 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -12431,6 +13836,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -12505,7 +13919,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -12805,7 +14220,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewFloatingBulkPrice]. */ + class Builder internal constructor() { private var bulkConfig: JsonField? = null private var cadence: JsonField? = null @@ -13142,7 +14558,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BulkConfig]. */ + class Builder internal constructor() { private var tiers: JsonField>? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -13258,7 +14675,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Tier]. */ + class Builder internal constructor() { private var unitAmount: JsonField? = null private var maximumUnits: JsonField = JsonMissing.of() @@ -13369,6 +14787,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -13388,6 +14814,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -13397,6 +14824,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -13404,9 +14840,19 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -13418,6 +14864,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -13450,6 +14905,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -13459,21 +14922,51 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { BULK, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { BULK, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { BULK -> Value.BULK else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { BULK -> Known.BULK @@ -13547,7 +15040,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -13613,6 +15107,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -13624,17 +15126,39 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -13642,6 +15166,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -13737,7 +15270,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -13804,6 +15338,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -13815,17 +15357,39 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -13833,6 +15397,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -13907,7 +15480,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -14210,7 +15784,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewFloatingThresholdTotalAmountPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var currency: JsonField? = null @@ -14522,6 +16097,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -14541,6 +16124,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -14550,6 +16134,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -14557,9 +16150,19 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -14571,6 +16174,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -14603,6 +16215,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -14612,21 +16232,51 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { THRESHOLD_TOTAL_AMOUNT, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { THRESHOLD_TOTAL_AMOUNT, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { THRESHOLD_TOTAL_AMOUNT -> Value.THRESHOLD_TOTAL_AMOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { THRESHOLD_TOTAL_AMOUNT -> Known.THRESHOLD_TOTAL_AMOUNT @@ -14677,7 +16327,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [ThresholdTotalAmountConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -14783,7 +16434,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -14849,6 +16501,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -14860,17 +16520,39 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -14878,6 +16560,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -14973,7 +16664,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -15040,6 +16732,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -15051,17 +16751,39 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -15069,6 +16791,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -15143,7 +16874,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -15444,7 +17176,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewFloatingTieredPackagePrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var currency: JsonField? = null @@ -15754,6 +17487,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -15773,6 +17514,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -15782,6 +17524,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -15789,9 +17540,19 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -15803,6 +17564,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -15835,6 +17605,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -15844,21 +17622,51 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { TIERED_PACKAGE, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { TIERED_PACKAGE, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { TIERED_PACKAGE -> Value.TIERED_PACKAGE else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { TIERED_PACKAGE -> Known.TIERED_PACKAGE @@ -15909,7 +17717,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TieredPackageConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -16014,7 +17823,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -16080,6 +17890,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -16091,17 +17909,39 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -16109,6 +17949,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -16204,7 +18053,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -16271,6 +18121,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -16282,17 +18140,39 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -16300,6 +18180,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -16374,7 +18263,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -16675,7 +18565,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewFloatingGroupedTieredPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var currency: JsonField? = null @@ -16985,6 +18876,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -17004,6 +18903,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -17013,6 +18913,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -17020,9 +18929,19 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -17034,6 +18953,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -17089,7 +19017,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [GroupedTieredConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -17148,6 +19077,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -17157,21 +19094,51 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { GROUPED_TIERED, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { GROUPED_TIERED, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { GROUPED_TIERED -> Value.GROUPED_TIERED else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { GROUPED_TIERED -> Known.GROUPED_TIERED @@ -17245,7 +19212,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -17311,6 +19279,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -17322,17 +19298,39 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -17340,6 +19338,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -17435,7 +19442,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -17502,6 +19510,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -17513,17 +19529,39 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -17531,6 +19569,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -17605,7 +19652,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -17908,7 +19956,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewFloatingMaxGroupTieredPackagePrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var currency: JsonField? = null @@ -18221,6 +20270,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -18240,6 +20297,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -18249,6 +20307,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -18256,9 +20323,19 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -18270,6 +20347,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -18325,7 +20411,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MaxGroupTieredPackageConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -18386,6 +20473,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -18395,21 +20490,51 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { MAX_GROUP_TIERED_PACKAGE, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { MAX_GROUP_TIERED_PACKAGE, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { MAX_GROUP_TIERED_PACKAGE -> Value.MAX_GROUP_TIERED_PACKAGE else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { MAX_GROUP_TIERED_PACKAGE -> Known.MAX_GROUP_TIERED_PACKAGE @@ -18483,7 +20608,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -18549,6 +20675,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -18560,17 +20694,39 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -18578,6 +20734,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -18673,7 +20838,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -18740,6 +20906,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -18751,17 +20925,39 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -18769,6 +20965,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -18843,7 +21048,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -19144,7 +21350,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewFloatingTieredWithMinimumPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var currency: JsonField? = null @@ -19455,6 +21662,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -19474,6 +21689,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -19483,6 +21699,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -19490,9 +21715,19 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -19504,6 +21739,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -19536,6 +21780,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -19545,21 +21797,51 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { TIERED_WITH_MINIMUM, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { TIERED_WITH_MINIMUM, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { TIERED_WITH_MINIMUM -> Value.TIERED_WITH_MINIMUM else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { TIERED_WITH_MINIMUM -> Known.TIERED_WITH_MINIMUM @@ -19610,7 +21892,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TieredWithMinimumConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -19716,7 +21999,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -19782,6 +22066,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -19793,17 +22085,39 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -19811,6 +22125,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -19906,7 +22229,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -19973,6 +22297,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -19984,17 +22316,39 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -20002,6 +22356,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -20076,7 +22439,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -20379,7 +22743,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewFloatingPackageWithAllocationPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var currency: JsonField? = null @@ -20692,6 +23057,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -20711,6 +23084,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -20720,6 +23094,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -20727,9 +23110,19 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -20741,6 +23134,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -20773,6 +23175,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -20782,21 +23192,51 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { PACKAGE_WITH_ALLOCATION, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PACKAGE_WITH_ALLOCATION, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { PACKAGE_WITH_ALLOCATION -> Value.PACKAGE_WITH_ALLOCATION else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { PACKAGE_WITH_ALLOCATION -> Known.PACKAGE_WITH_ALLOCATION @@ -20847,7 +23287,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [PackageWithAllocationConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -20954,7 +23395,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -21020,6 +23462,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -21031,17 +23481,39 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -21049,6 +23521,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -21144,7 +23625,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -21211,6 +23693,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -21222,17 +23712,39 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -21240,6 +23752,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -21314,7 +23835,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -21617,7 +24139,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewFloatingTieredPackageWithMinimumPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var currency: JsonField? = null @@ -21931,6 +24454,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -21950,6 +24481,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -21959,6 +24491,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -21966,9 +24507,19 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -21980,6 +24531,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -22012,6 +24572,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -22021,21 +24589,51 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { TIERED_PACKAGE_WITH_MINIMUM, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { TIERED_PACKAGE_WITH_MINIMUM, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { TIERED_PACKAGE_WITH_MINIMUM -> Value.TIERED_PACKAGE_WITH_MINIMUM else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { TIERED_PACKAGE_WITH_MINIMUM -> Known.TIERED_PACKAGE_WITH_MINIMUM @@ -22086,7 +24684,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TieredPackageWithMinimumConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -22193,7 +24792,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -22259,6 +24859,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -22270,17 +24878,39 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -22288,6 +24918,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -22383,7 +25022,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -22450,6 +25090,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -22461,17 +25109,39 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -22479,6 +25149,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -22553,7 +25232,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -22854,7 +25534,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewFloatingUnitWithPercentPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var currency: JsonField? = null @@ -23165,6 +25846,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -23184,6 +25873,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -23193,6 +25883,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -23200,9 +25899,19 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -23214,6 +25923,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -23246,6 +25964,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -23255,21 +25981,51 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { UNIT_WITH_PERCENT, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { UNIT_WITH_PERCENT, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { UNIT_WITH_PERCENT -> Value.UNIT_WITH_PERCENT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { UNIT_WITH_PERCENT -> Known.UNIT_WITH_PERCENT @@ -23320,7 +26076,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [UnitWithPercentConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -23425,7 +26182,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -23491,6 +26249,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -23502,17 +26268,39 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -23520,6 +26308,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -23615,7 +26412,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -23682,6 +26480,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -23693,17 +26499,39 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -23711,6 +26539,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -23785,7 +26622,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -24088,7 +26926,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewFloatingTieredWithProrationPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var currency: JsonField? = null @@ -24400,6 +27239,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -24419,6 +27266,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -24428,6 +27276,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -24435,9 +27292,19 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -24449,6 +27316,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -24481,6 +27357,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -24490,21 +27374,51 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { TIERED_WITH_PRORATION, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { TIERED_WITH_PRORATION, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { TIERED_WITH_PRORATION -> Value.TIERED_WITH_PRORATION else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { TIERED_WITH_PRORATION -> Known.TIERED_WITH_PRORATION @@ -24555,7 +27469,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TieredWithProrationConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -24661,7 +27576,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -24727,6 +27643,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -24738,17 +27662,39 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -24756,6 +27702,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -24851,7 +27806,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -24918,6 +27874,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -24929,17 +27893,39 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -24947,6 +27933,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -25021,7 +28016,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -25322,7 +28318,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewFloatingUnitWithProrationPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var currency: JsonField? = null @@ -25633,6 +28630,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -25652,6 +28657,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -25661,6 +28667,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -25668,9 +28683,19 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -25682,6 +28707,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -25714,6 +28748,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -25723,21 +28765,51 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { UNIT_WITH_PRORATION, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { UNIT_WITH_PRORATION, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { UNIT_WITH_PRORATION -> Value.UNIT_WITH_PRORATION else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { UNIT_WITH_PRORATION -> Known.UNIT_WITH_PRORATION @@ -25788,7 +28860,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [UnitWithProrationConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -25894,7 +28967,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -25960,6 +29034,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -25971,17 +29053,39 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -25989,6 +29093,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -26084,7 +29197,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -26151,6 +29265,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -26162,17 +29284,39 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -26180,6 +29324,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -26254,7 +29407,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -26555,7 +29709,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewFloatingGroupedAllocationPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var currency: JsonField? = null @@ -26866,6 +30021,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -26885,6 +30048,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -26894,6 +30058,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -26901,9 +30074,19 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -26915,6 +30098,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -26970,7 +30162,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [GroupedAllocationConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -27030,6 +30223,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -27039,21 +30240,51 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { GROUPED_ALLOCATION, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { GROUPED_ALLOCATION, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { GROUPED_ALLOCATION -> Value.GROUPED_ALLOCATION else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { GROUPED_ALLOCATION -> Known.GROUPED_ALLOCATION @@ -27127,7 +30358,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -27193,6 +30425,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -27204,17 +30444,39 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -27222,6 +30484,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -27317,7 +30588,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -27384,6 +30656,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -27395,17 +30675,39 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -27413,6 +30715,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -27487,7 +30798,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -27790,7 +31102,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewFloatingGroupedWithProratedMinimumPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var currency: JsonField? = null @@ -28109,6 +31422,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -28128,6 +31449,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -28137,6 +31459,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -28144,9 +31475,19 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -28158,6 +31499,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -28213,7 +31563,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [GroupedWithProratedMinimumConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -28275,6 +31626,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -28284,21 +31643,51 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { GROUPED_WITH_PRORATED_MINIMUM, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { GROUPED_WITH_PRORATED_MINIMUM, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { GROUPED_WITH_PRORATED_MINIMUM -> Value.GROUPED_WITH_PRORATED_MINIMUM else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { GROUPED_WITH_PRORATED_MINIMUM -> Known.GROUPED_WITH_PRORATED_MINIMUM @@ -28372,7 +31761,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -28438,6 +31828,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -28449,17 +31847,39 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -28467,6 +31887,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -28562,7 +31991,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -28629,6 +32059,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -28640,17 +32078,39 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -28658,6 +32118,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -28732,7 +32201,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -29035,7 +32505,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewFloatingGroupedWithMeteredMinimumPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var currency: JsonField? = null @@ -29353,6 +32824,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -29372,6 +32851,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -29381,6 +32861,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -29388,9 +32877,19 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -29402,6 +32901,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -29457,7 +32965,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [GroupedWithMeteredMinimumConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -29519,6 +33028,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -29528,21 +33045,51 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { GROUPED_WITH_METERED_MINIMUM, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { GROUPED_WITH_METERED_MINIMUM, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { GROUPED_WITH_METERED_MINIMUM -> Value.GROUPED_WITH_METERED_MINIMUM else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { GROUPED_WITH_METERED_MINIMUM -> Known.GROUPED_WITH_METERED_MINIMUM @@ -29616,7 +33163,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -29682,6 +33230,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -29693,17 +33249,39 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -29711,6 +33289,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -29806,7 +33393,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -29873,6 +33461,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -29884,17 +33480,39 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -29902,6 +33520,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -29976,7 +33603,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -30279,7 +33907,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewFloatingMatrixWithDisplayNamePrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var currency: JsonField? = null @@ -30592,6 +34221,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -30611,6 +34248,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -30620,6 +34258,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -30627,9 +34274,19 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -30641,6 +34298,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -30696,7 +34362,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MatrixWithDisplayNameConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -30757,6 +34424,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -30766,21 +34441,51 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { MATRIX_WITH_DISPLAY_NAME, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { MATRIX_WITH_DISPLAY_NAME, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { MATRIX_WITH_DISPLAY_NAME -> Value.MATRIX_WITH_DISPLAY_NAME else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { MATRIX_WITH_DISPLAY_NAME -> Known.MATRIX_WITH_DISPLAY_NAME @@ -30854,7 +34559,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -30920,6 +34626,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -30931,17 +34645,39 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -30949,6 +34685,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -31044,7 +34789,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -31111,6 +34857,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -31122,17 +34876,39 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -31140,6 +34916,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -31214,7 +34999,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -31515,7 +35301,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewFloatingBulkWithProrationPrice]. */ + class Builder internal constructor() { private var bulkWithProrationConfig: JsonField? = null private var cadence: JsonField? = null @@ -31848,7 +35635,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BulkWithProrationConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -31909,6 +35697,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -31928,6 +35724,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -31937,6 +35734,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -31944,9 +35750,19 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -31958,6 +35774,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -31990,6 +35815,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -31999,21 +35832,51 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { BULK_WITH_PRORATION, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { BULK_WITH_PRORATION, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { BULK_WITH_PRORATION -> Value.BULK_WITH_PRORATION else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { BULK_WITH_PRORATION -> Known.BULK_WITH_PRORATION @@ -32087,7 +35950,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -32153,6 +36017,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -32164,17 +36036,39 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -32182,6 +36076,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -32277,7 +36180,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -32344,6 +36248,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -32355,17 +36267,39 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -32373,6 +36307,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -32447,7 +36390,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -32750,7 +36694,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewFloatingGroupedTieredPackagePrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var currency: JsonField? = null @@ -33062,6 +37007,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -33081,6 +37034,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -33090,6 +37044,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -33097,9 +37060,19 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -33111,6 +37084,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -33166,7 +37148,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [GroupedTieredPackageConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -33226,6 +37209,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -33235,21 +37226,51 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { GROUPED_TIERED_PACKAGE, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { GROUPED_TIERED_PACKAGE, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { GROUPED_TIERED_PACKAGE -> Value.GROUPED_TIERED_PACKAGE else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { GROUPED_TIERED_PACKAGE -> Known.GROUPED_TIERED_PACKAGE @@ -33323,7 +37344,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -33389,6 +37411,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -33400,17 +37430,39 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -33418,6 +37470,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -33513,7 +37574,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -33580,6 +37642,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -33591,17 +37661,39 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -33609,6 +37701,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -33683,7 +37784,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -33752,6 +37854,2839 @@ constructor( "NewFloatingGroupedTieredPackagePrice{cadence=$cadence, currency=$currency, groupedTieredPackageConfig=$groupedTieredPackageConfig, 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 NewFloatingScalableMatrixWithUnitPricingPrice + @JsonCreator + private constructor( + @JsonProperty("cadence") + @ExcludeMissing + private val cadence: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + private val currency: 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("scalable_matrix_with_unit_pricing_config") + @ExcludeMissing + private val scalableMatrixWithUnitPricingConfig: + 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") + + /** 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") + + fun scalableMatrixWithUnitPricingConfig(): ScalableMatrixWithUnitPricingConfig = + scalableMatrixWithUnitPricingConfig.getRequired( + "scalable_matrix_with_unit_pricing_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")) + + /** + * 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 + + /** 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 + + @JsonProperty("scalable_matrix_with_unit_pricing_config") + @ExcludeMissing + fun _scalableMatrixWithUnitPricingConfig(): JsonField = + scalableMatrixWithUnitPricingConfig + + /** 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(): NewFloatingScalableMatrixWithUnitPricingPrice = apply { + if (validated) { + return@apply + } + + cadence() + currency() + itemId() + modelType() + name() + scalableMatrixWithUnitPricingConfig().validate() + 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() + } + + /** A builder for [NewFloatingScalableMatrixWithUnitPricingPrice]. */ + class Builder internal constructor() { + + private var cadence: JsonField? = null + private var currency: JsonField? = null + private var itemId: JsonField? = null + private var modelType: JsonField? = null + private var name: JsonField? = null + private var scalableMatrixWithUnitPricingConfig: + 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( + newFloatingScalableMatrixWithUnitPricingPrice: + NewFloatingScalableMatrixWithUnitPricingPrice + ) = apply { + cadence = newFloatingScalableMatrixWithUnitPricingPrice.cadence + currency = newFloatingScalableMatrixWithUnitPricingPrice.currency + itemId = newFloatingScalableMatrixWithUnitPricingPrice.itemId + modelType = newFloatingScalableMatrixWithUnitPricingPrice.modelType + name = newFloatingScalableMatrixWithUnitPricingPrice.name + scalableMatrixWithUnitPricingConfig = + newFloatingScalableMatrixWithUnitPricingPrice + .scalableMatrixWithUnitPricingConfig + billableMetricId = newFloatingScalableMatrixWithUnitPricingPrice.billableMetricId + billedInAdvance = newFloatingScalableMatrixWithUnitPricingPrice.billedInAdvance + billingCycleConfiguration = + newFloatingScalableMatrixWithUnitPricingPrice.billingCycleConfiguration + conversionRate = newFloatingScalableMatrixWithUnitPricingPrice.conversionRate + externalPriceId = newFloatingScalableMatrixWithUnitPricingPrice.externalPriceId + fixedPriceQuantity = + newFloatingScalableMatrixWithUnitPricingPrice.fixedPriceQuantity + invoiceGroupingKey = + newFloatingScalableMatrixWithUnitPricingPrice.invoiceGroupingKey + invoicingCycleConfiguration = + newFloatingScalableMatrixWithUnitPricingPrice.invoicingCycleConfiguration + metadata = newFloatingScalableMatrixWithUnitPricingPrice.metadata + additionalProperties = + newFloatingScalableMatrixWithUnitPricingPrice.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 } + + /** 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 } + + fun scalableMatrixWithUnitPricingConfig( + scalableMatrixWithUnitPricingConfig: ScalableMatrixWithUnitPricingConfig + ) = + scalableMatrixWithUnitPricingConfig( + JsonField.of(scalableMatrixWithUnitPricingConfig) + ) + + fun scalableMatrixWithUnitPricingConfig( + scalableMatrixWithUnitPricingConfig: JsonField + ) = apply { + this.scalableMatrixWithUnitPricingConfig = scalableMatrixWithUnitPricingConfig + } + + /** + * 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(): NewFloatingScalableMatrixWithUnitPricingPrice = + NewFloatingScalableMatrixWithUnitPricingPrice( + checkRequired("cadence", cadence), + checkRequired("currency", currency), + checkRequired("itemId", itemId), + checkRequired("modelType", modelType), + checkRequired("name", name), + checkRequired( + "scalableMatrixWithUnitPricingConfig", + scalableMatrixWithUnitPricingConfig + ), + billableMetricId, + billedInAdvance, + billingCycleConfiguration, + conversionRate, + externalPriceId, + fixedPriceQuantity, + invoiceGroupingKey, + invoicingCycleConfiguration, + metadata, + additionalProperties.toImmutable(), + ) + } + + /** The cadence to bill for this price on. */ + class Cadence + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ + @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)) + } + + /** An enum containing [Cadence]'s known values. */ + enum class Known { + ANNUAL, + SEMI_ANNUAL, + MONTHLY, + QUARTERLY, + ONE_TIME, + CUSTOM, + } + + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + ANNUAL, + SEMI_ANNUAL, + MONTHLY, + QUARTERLY, + ONE_TIME, + CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ + 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 + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ + 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() + } + + class ModelType + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField + val SCALABLE_MATRIX_WITH_UNIT_PRICING = of("scalable_matrix_with_unit_pricing") + + @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) + } + + /** An enum containing [ModelType]'s known values. */ + enum class Known { + SCALABLE_MATRIX_WITH_UNIT_PRICING, + } + + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + SCALABLE_MATRIX_WITH_UNIT_PRICING, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + SCALABLE_MATRIX_WITH_UNIT_PRICING -> Value.SCALABLE_MATRIX_WITH_UNIT_PRICING + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + SCALABLE_MATRIX_WITH_UNIT_PRICING -> Known.SCALABLE_MATRIX_WITH_UNIT_PRICING + 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 ScalableMatrixWithUnitPricingConfig + @JsonCreator + private constructor( + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): ScalableMatrixWithUnitPricingConfig = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + /** A builder for [ScalableMatrixWithUnitPricingConfig]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from( + scalableMatrixWithUnitPricingConfig: ScalableMatrixWithUnitPricingConfig + ) = apply { + additionalProperties = + scalableMatrixWithUnitPricingConfig.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(): ScalableMatrixWithUnitPricingConfig = + ScalableMatrixWithUnitPricingConfig(additionalProperties.toImmutable()) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is ScalableMatrixWithUnitPricingConfig && 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() = + "ScalableMatrixWithUnitPricingConfig{additionalProperties=$additionalProperties}" + } + + /** 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() + } + + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { + + 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(), + ) + } + + /** The unit of billing period duration. */ + class DurationUnit + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ + @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)) + } + + /** An enum containing [DurationUnit]'s known values. */ + enum class Known { + DAY, + MONTH, + } + + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + DAY, + MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + DAY -> Value.DAY + MONTH -> Value.MONTH + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ + 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() + } + + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { + + 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(), + ) + } + + /** The unit of billing period duration. */ + class DurationUnit + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ + @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)) + } + + /** An enum containing [DurationUnit]'s known values. */ + enum class Known { + DAY, + MONTH, + } + + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + DAY, + MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + DAY -> Value.DAY + MONTH -> Value.MONTH + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ + 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() + } + + /** A builder for [Metadata]. */ + class Builder internal constructor() { + + 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 NewFloatingScalableMatrixWithUnitPricingPrice && cadence == other.cadence && currency == other.currency && itemId == other.itemId && modelType == other.modelType && name == other.name && scalableMatrixWithUnitPricingConfig == other.scalableMatrixWithUnitPricingConfig && 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, scalableMatrixWithUnitPricingConfig, billableMetricId, billedInAdvance, billingCycleConfiguration, conversionRate, externalPriceId, fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, metadata, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "NewFloatingScalableMatrixWithUnitPricingPrice{cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, scalableMatrixWithUnitPricingConfig=$scalableMatrixWithUnitPricingConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" + } + + @NoAutoDetect + class NewFloatingScalableMatrixWithTieredPricingPrice + @JsonCreator + private constructor( + @JsonProperty("cadence") + @ExcludeMissing + private val cadence: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + private val currency: 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("scalable_matrix_with_tiered_pricing_config") + @ExcludeMissing + private val scalableMatrixWithTieredPricingConfig: + 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") + + /** 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") + + fun scalableMatrixWithTieredPricingConfig(): ScalableMatrixWithTieredPricingConfig = + scalableMatrixWithTieredPricingConfig.getRequired( + "scalable_matrix_with_tiered_pricing_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")) + + /** + * 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 + + /** 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 + + @JsonProperty("scalable_matrix_with_tiered_pricing_config") + @ExcludeMissing + fun _scalableMatrixWithTieredPricingConfig(): + JsonField = scalableMatrixWithTieredPricingConfig + + /** 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(): NewFloatingScalableMatrixWithTieredPricingPrice = apply { + if (validated) { + return@apply + } + + cadence() + currency() + itemId() + modelType() + name() + scalableMatrixWithTieredPricingConfig().validate() + 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() + } + + /** A builder for [NewFloatingScalableMatrixWithTieredPricingPrice]. */ + class Builder internal constructor() { + + private var cadence: JsonField? = null + private var currency: JsonField? = null + private var itemId: JsonField? = null + private var modelType: JsonField? = null + private var name: JsonField? = null + private var scalableMatrixWithTieredPricingConfig: + 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( + newFloatingScalableMatrixWithTieredPricingPrice: + NewFloatingScalableMatrixWithTieredPricingPrice + ) = apply { + cadence = newFloatingScalableMatrixWithTieredPricingPrice.cadence + currency = newFloatingScalableMatrixWithTieredPricingPrice.currency + itemId = newFloatingScalableMatrixWithTieredPricingPrice.itemId + modelType = newFloatingScalableMatrixWithTieredPricingPrice.modelType + name = newFloatingScalableMatrixWithTieredPricingPrice.name + scalableMatrixWithTieredPricingConfig = + newFloatingScalableMatrixWithTieredPricingPrice + .scalableMatrixWithTieredPricingConfig + billableMetricId = newFloatingScalableMatrixWithTieredPricingPrice.billableMetricId + billedInAdvance = newFloatingScalableMatrixWithTieredPricingPrice.billedInAdvance + billingCycleConfiguration = + newFloatingScalableMatrixWithTieredPricingPrice.billingCycleConfiguration + conversionRate = newFloatingScalableMatrixWithTieredPricingPrice.conversionRate + externalPriceId = newFloatingScalableMatrixWithTieredPricingPrice.externalPriceId + fixedPriceQuantity = + newFloatingScalableMatrixWithTieredPricingPrice.fixedPriceQuantity + invoiceGroupingKey = + newFloatingScalableMatrixWithTieredPricingPrice.invoiceGroupingKey + invoicingCycleConfiguration = + newFloatingScalableMatrixWithTieredPricingPrice.invoicingCycleConfiguration + metadata = newFloatingScalableMatrixWithTieredPricingPrice.metadata + additionalProperties = + newFloatingScalableMatrixWithTieredPricingPrice.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 } + + /** 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 } + + fun scalableMatrixWithTieredPricingConfig( + scalableMatrixWithTieredPricingConfig: ScalableMatrixWithTieredPricingConfig + ) = + scalableMatrixWithTieredPricingConfig( + JsonField.of(scalableMatrixWithTieredPricingConfig) + ) + + fun scalableMatrixWithTieredPricingConfig( + scalableMatrixWithTieredPricingConfig: + JsonField + ) = apply { + this.scalableMatrixWithTieredPricingConfig = scalableMatrixWithTieredPricingConfig + } + + /** + * 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(): NewFloatingScalableMatrixWithTieredPricingPrice = + NewFloatingScalableMatrixWithTieredPricingPrice( + checkRequired("cadence", cadence), + checkRequired("currency", currency), + checkRequired("itemId", itemId), + checkRequired("modelType", modelType), + checkRequired("name", name), + checkRequired( + "scalableMatrixWithTieredPricingConfig", + scalableMatrixWithTieredPricingConfig + ), + billableMetricId, + billedInAdvance, + billingCycleConfiguration, + conversionRate, + externalPriceId, + fixedPriceQuantity, + invoiceGroupingKey, + invoicingCycleConfiguration, + metadata, + additionalProperties.toImmutable(), + ) + } + + /** The cadence to bill for this price on. */ + class Cadence + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ + @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)) + } + + /** An enum containing [Cadence]'s known values. */ + enum class Known { + ANNUAL, + SEMI_ANNUAL, + MONTHLY, + QUARTERLY, + ONE_TIME, + CUSTOM, + } + + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + ANNUAL, + SEMI_ANNUAL, + MONTHLY, + QUARTERLY, + ONE_TIME, + CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ + 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 + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ + 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() + } + + class ModelType + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField + val SCALABLE_MATRIX_WITH_TIERED_PRICING = of("scalable_matrix_with_tiered_pricing") + + @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) + } + + /** An enum containing [ModelType]'s known values. */ + enum class Known { + SCALABLE_MATRIX_WITH_TIERED_PRICING, + } + + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + SCALABLE_MATRIX_WITH_TIERED_PRICING, + /** + * An enum member indicating that [ModelType] was instantiated with an unknown + * value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + SCALABLE_MATRIX_WITH_TIERED_PRICING -> Value.SCALABLE_MATRIX_WITH_TIERED_PRICING + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + SCALABLE_MATRIX_WITH_TIERED_PRICING -> Known.SCALABLE_MATRIX_WITH_TIERED_PRICING + 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 ScalableMatrixWithTieredPricingConfig + @JsonCreator + private constructor( + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): ScalableMatrixWithTieredPricingConfig = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + /** A builder for [ScalableMatrixWithTieredPricingConfig]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from( + scalableMatrixWithTieredPricingConfig: ScalableMatrixWithTieredPricingConfig + ) = apply { + additionalProperties = + scalableMatrixWithTieredPricingConfig.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(): ScalableMatrixWithTieredPricingConfig = + ScalableMatrixWithTieredPricingConfig(additionalProperties.toImmutable()) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is ScalableMatrixWithTieredPricingConfig && 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() = + "ScalableMatrixWithTieredPricingConfig{additionalProperties=$additionalProperties}" + } + + /** 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() + } + + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { + + 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(), + ) + } + + /** The unit of billing period duration. */ + class DurationUnit + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ + @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)) + } + + /** An enum containing [DurationUnit]'s known values. */ + enum class Known { + DAY, + MONTH, + } + + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + DAY, + MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + DAY -> Value.DAY + MONTH -> Value.MONTH + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ + 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() + } + + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { + + 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(), + ) + } + + /** The unit of billing period duration. */ + class DurationUnit + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ + @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)) + } + + /** An enum containing [DurationUnit]'s known values. */ + enum class Known { + DAY, + MONTH, + } + + /** + * An enum containing [DurationUnit]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + DAY, + MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with an + * unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + DAY -> Value.DAY + MONTH -> Value.MONTH + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ + 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() + } + + /** A builder for [Metadata]. */ + class Builder internal constructor() { + + 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 NewFloatingScalableMatrixWithTieredPricingPrice && cadence == other.cadence && currency == other.currency && itemId == other.itemId && modelType == other.modelType && name == other.name && scalableMatrixWithTieredPricingConfig == other.scalableMatrixWithTieredPricingConfig && 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, scalableMatrixWithTieredPricingConfig, billableMetricId, billedInAdvance, billingCycleConfiguration, conversionRate, externalPriceId, fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, metadata, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "NewFloatingScalableMatrixWithTieredPricingPrice{cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, scalableMatrixWithTieredPricingConfig=$scalableMatrixWithTieredPricingConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true 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 cea9a59d..af33f1bd 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 @@ -11,6 +11,7 @@ import com.withorb.api.core.JsonField import com.withorb.api.core.JsonMissing import com.withorb.api.core.JsonValue import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -40,12 +41,12 @@ import java.util.Optional * endpoint because it employs a JSON body rather than query parameters. */ class PriceEvaluateParams -constructor( +private constructor( private val priceId: String, private val body: PriceEvaluateBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun priceId(): String = priceId @@ -103,11 +104,11 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getBody(): PriceEvaluateBody = body + @JvmSynthetic internal fun _body(): PriceEvaluateBody = body - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun getPathParam(index: Int): String { return when (index) { @@ -232,7 +233,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [PriceEvaluateBody]. */ + class Builder internal constructor() { private var timeframeEnd: JsonField? = null private var timeframeStart: JsonField? = null @@ -401,8 +403,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [PriceEvaluateParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var priceId: String? = null private var body: PriceEvaluateBody.Builder = PriceEvaluateBody.builder() diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceEvaluateResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceEvaluateResponse.kt index 84bc3f95..3f3d5702 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceEvaluateResponse.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceEvaluateResponse.kt @@ -52,7 +52,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [PriceEvaluateResponse]. */ + class Builder internal constructor() { private var data: JsonField>? = null private var additionalProperties: MutableMap = mutableMapOf() 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 937dbba9..52101f08 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 @@ -3,6 +3,7 @@ package com.withorb.api.models import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -14,11 +15,11 @@ import java.util.Objects * aliases. */ class PriceExternalPriceIdFetchParams -constructor( +private constructor( private val externalPriceId: String, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun externalPriceId(): String = externalPriceId @@ -26,9 +27,9 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun getPathParam(index: Int): String { return when (index) { @@ -44,8 +45,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [PriceExternalPriceIdFetchParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var externalPriceId: String? = null private var additionalHeaders: Headers.Builder = Headers.builder() diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceExternalPriceIdUpdateParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceExternalPriceIdUpdateParams.kt index 2170a1b4..05cab5d3 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceExternalPriceIdUpdateParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceExternalPriceIdUpdateParams.kt @@ -11,6 +11,7 @@ import com.withorb.api.core.JsonField import com.withorb.api.core.JsonMissing import com.withorb.api.core.JsonValue import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -24,12 +25,12 @@ import java.util.Optional * metadata value, it will clear any existing metadata for that price. */ class PriceExternalPriceIdUpdateParams -constructor( +private constructor( private val externalPriceId: String, private val body: PriceExternalPriceIdUpdateBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun externalPriceId(): String = externalPriceId @@ -53,11 +54,11 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getBody(): PriceExternalPriceIdUpdateBody = body + @JvmSynthetic internal fun _body(): PriceExternalPriceIdUpdateBody = body - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun getPathParam(index: Int): String { return when (index) { @@ -113,7 +114,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [PriceExternalPriceIdUpdateBody]. */ + class Builder internal constructor() { private var metadata: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -195,8 +197,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [PriceExternalPriceIdUpdateParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var externalPriceId: String? = null private var body: PriceExternalPriceIdUpdateBody.Builder = @@ -399,7 +402,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceFetchParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceFetchParams.kt index 65509e69..538ad6e6 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceFetchParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceFetchParams.kt @@ -3,6 +3,7 @@ package com.withorb.api.models import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -10,11 +11,11 @@ import java.util.Objects /** This endpoint returns a price given an identifier. */ class PriceFetchParams -constructor( +private constructor( private val priceId: String, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun priceId(): String = priceId @@ -22,9 +23,9 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun getPathParam(index: Int): String { return when (index) { @@ -40,8 +41,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [PriceFetchParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var priceId: String? = null private var additionalHeaders: Headers.Builder = Headers.builder() 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 c9ba68e8..e0fecf33 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 @@ -183,8 +183,7 @@ private constructor( } } - class AutoPager - constructor( + class AutoPager( private val firstPage: PriceListPage, ) : Iterable { 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 56d4f816..0f7b0454 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 @@ -186,8 +186,7 @@ private constructor( } } - class AutoPager - constructor( + class AutoPager( private val firstPage: PriceListPageAsync, ) { 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 3e8c8bd1..8a79cde0 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 @@ -3,6 +3,7 @@ package com.withorb.api.models import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams import java.util.Objects @@ -13,12 +14,12 @@ import java.util.Optional * [price creation endpoint](/api-reference/price/create-price). */ class PriceListParams -constructor( +private constructor( private val cursor: String?, private val limit: Long?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { /** * Cursor for pagination. This can be populated by the `next_cursor` value returned from the @@ -33,10 +34,9 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic - internal fun getQueryParams(): QueryParams { + override fun _queryParams(): QueryParams { val queryParams = QueryParams.builder() this.cursor?.let { queryParams.put("cursor", listOf(it.toString())) } this.limit?.let { queryParams.put("limit", listOf(it.toString())) } @@ -51,8 +51,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [PriceListParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var cursor: String? = null private var limit: Long? = null diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceUpdateParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceUpdateParams.kt index 7b36acbc..4a895755 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceUpdateParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/PriceUpdateParams.kt @@ -11,6 +11,7 @@ import com.withorb.api.core.JsonField import com.withorb.api.core.JsonMissing import com.withorb.api.core.JsonValue import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -24,12 +25,12 @@ import java.util.Optional * metadata value, it will clear any existing metadata for that price. */ class PriceUpdateParams -constructor( +private constructor( private val priceId: String, private val body: PriceUpdateBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun priceId(): String = priceId @@ -53,11 +54,11 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getBody(): PriceUpdateBody = body + @JvmSynthetic internal fun _body(): PriceUpdateBody = body - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun getPathParam(index: Int): String { return when (index) { @@ -113,7 +114,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [PriceUpdateBody]. */ + class Builder internal constructor() { private var metadata: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -193,8 +195,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [PriceUpdateParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var priceId: String? = null private var body: PriceUpdateBody.Builder = PriceUpdateBody.builder() @@ -392,7 +395,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() 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 21e9b232..973a1f0a 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 @@ -457,7 +457,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Subscription]. */ + class Builder internal constructor() { private var id: JsonField? = null private var activePlanPhaseOrder: JsonField? = null @@ -1087,7 +1088,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AdjustmentInterval]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustment: JsonField? = null @@ -1344,6 +1346,10 @@ private constructor( @JvmStatic fun ofMaximum(maximum: MaximumAdjustment) = Adjustment(maximum = maximum) } + /** + * An interface that defines how to map each variant of [Adjustment] to a value of type + * [T]. + */ interface Visitor { fun visitAmountDiscount(amountDiscount: AmountDiscountAdjustment): T @@ -1356,12 +1362,22 @@ private constructor( fun visitMaximum(maximum: MaximumAdjustment): T + /** + * Maps an unknown variant of [Adjustment] to a value of type [T]. + * + * An instance of [Adjustment] can contain an unknown variant if it was deserialized + * from data that doesn't match any known variant. For example, if the SDK is on an + * older version than the API, then the API may respond with new variants that the + * SDK is unaware of. + * + * @throws OrbInvalidDataException in the default implementation. + */ fun unknown(json: JsonValue?): T { throw OrbInvalidDataException("Unknown Adjustment: $json") } } - class Deserializer : BaseDeserializer(Adjustment::class) { + internal class Deserializer : BaseDeserializer(Adjustment::class) { override fun ObjectCodec.deserialize(node: JsonNode): Adjustment { val json = JsonValue.fromJsonNode(node) @@ -1415,7 +1431,7 @@ private constructor( } } - class Serializer : BaseSerializer(Adjustment::class) { + internal class Serializer : BaseSerializer(Adjustment::class) { override fun serialize( value: Adjustment, @@ -1554,7 +1570,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AmountDiscountAdjustment]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustmentType: JsonField? = null @@ -1713,6 +1730,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -1723,21 +1748,53 @@ private constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { AMOUNT_DISCOUNT, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { AMOUNT_DISCOUNT, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { AMOUNT_DISCOUNT -> Value.AMOUNT_DISCOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { AMOUNT_DISCOUNT -> Known.AMOUNT_DISCOUNT @@ -1897,7 +1954,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [PercentageDiscountAdjustment]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustmentType: JsonField? = null @@ -2059,6 +2117,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -2069,21 +2135,53 @@ private constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { PERCENTAGE_DISCOUNT, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PERCENTAGE_DISCOUNT, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { PERCENTAGE_DISCOUNT -> Value.PERCENTAGE_DISCOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { PERCENTAGE_DISCOUNT -> Known.PERCENTAGE_DISCOUNT @@ -2242,7 +2340,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [UsageDiscountAdjustment]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustmentType: JsonField? = null @@ -2401,6 +2500,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -2411,21 +2518,53 @@ private constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { USAGE_DISCOUNT, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { USAGE_DISCOUNT, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { USAGE_DISCOUNT -> Value.USAGE_DISCOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { USAGE_DISCOUNT -> Known.USAGE_DISCOUNT @@ -2594,7 +2733,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MinimumAdjustment]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustmentType: JsonField? = null @@ -2761,6 +2901,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -2771,21 +2919,53 @@ private constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { MINIMUM, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { MINIMUM, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { MINIMUM -> Value.MINIMUM else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { MINIMUM -> Known.MINIMUM @@ -2944,7 +3124,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MaximumAdjustment]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustmentType: JsonField? = null @@ -3102,6 +3283,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -3112,21 +3301,53 @@ private constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { MAXIMUM, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { MAXIMUM, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { MAXIMUM -> Value.MAXIMUM else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { MAXIMUM -> Known.MAXIMUM @@ -3262,7 +3483,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleAnchorConfiguration]. */ + class Builder internal constructor() { private var day: JsonField? = null private var month: JsonField = JsonMissing.of() @@ -3486,6 +3708,10 @@ private constructor( @JvmStatic fun ofUsage(usage: UsageDiscountInterval) = DiscountInterval(usage = usage) } + /** + * An interface that defines how to map each variant of [DiscountInterval] to a value of + * type [T]. + */ interface Visitor { fun visitAmount(amount: AmountDiscountInterval): T @@ -3494,12 +3720,22 @@ private constructor( fun visitUsage(usage: UsageDiscountInterval): T + /** + * Maps an unknown variant of [DiscountInterval] to a value of type [T]. + * + * An instance of [DiscountInterval] can contain an unknown variant if it was + * deserialized from data that doesn't match any known variant. For example, if the SDK + * is on an older version than the API, then the API may respond with new variants that + * the SDK is unaware of. + * + * @throws OrbInvalidDataException in the default implementation. + */ fun unknown(json: JsonValue?): T { throw OrbInvalidDataException("Unknown DiscountInterval: $json") } } - class Deserializer : BaseDeserializer(DiscountInterval::class) { + internal class Deserializer : BaseDeserializer(DiscountInterval::class) { override fun ObjectCodec.deserialize(node: JsonNode): DiscountInterval { val json = JsonValue.fromJsonNode(node) @@ -3537,7 +3773,7 @@ private constructor( } } - class Serializer : BaseSerializer(DiscountInterval::class) { + internal class Serializer : BaseSerializer(DiscountInterval::class) { override fun serialize( value: DiscountInterval, @@ -3656,7 +3892,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AmountDiscountInterval]. */ + class Builder internal constructor() { private var amountDiscount: JsonField? = null private var appliesToPriceIds: JsonField>? = null @@ -3805,6 +4042,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -3814,21 +4059,52 @@ private constructor( @JvmStatic fun of(value: String) = DiscountType(JsonField.of(value)) } + /** An enum containing [DiscountType]'s known values. */ enum class Known { AMOUNT, } + /** + * An enum containing [DiscountType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DiscountType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { AMOUNT, + /** + * An enum member indicating that [DiscountType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { AMOUNT -> Value.AMOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { AMOUNT -> Known.AMOUNT @@ -3970,7 +4246,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [PercentageDiscountInterval]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var appliesToPriceIntervalIds: JsonField>? = null @@ -4125,6 +4402,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -4134,21 +4419,52 @@ private constructor( @JvmStatic fun of(value: String) = DiscountType(JsonField.of(value)) } + /** An enum containing [DiscountType]'s known values. */ enum class Known { PERCENTAGE, } + /** + * An enum containing [DiscountType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DiscountType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PERCENTAGE, + /** + * An enum member indicating that [DiscountType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { PERCENTAGE -> Value.PERCENTAGE else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { PERCENTAGE -> Known.PERCENTAGE @@ -4296,7 +4612,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [UsageDiscountInterval]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var appliesToPriceIntervalIds: JsonField>? = null @@ -4450,6 +4767,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -4459,21 +4784,52 @@ private constructor( @JvmStatic fun of(value: String) = DiscountType(JsonField.of(value)) } + /** An enum containing [DiscountType]'s known values. */ enum class Known { USAGE, } + /** + * An enum containing [DiscountType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DiscountType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { USAGE, + /** + * An enum member indicating that [DiscountType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { USAGE -> Value.USAGE else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { USAGE -> Known.USAGE @@ -4580,7 +4936,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [FixedFeeQuantitySchedule]. */ + class Builder internal constructor() { private var endDate: JsonField? = null private var priceId: JsonField? = null @@ -4762,7 +5119,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MaximumInterval]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var appliesToPriceIntervalIds: JsonField>? = null @@ -4945,7 +5303,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -5091,7 +5450,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MinimumInterval]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var appliesToPriceIntervalIds: JsonField>? = null @@ -5430,7 +5790,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [PriceInterval]. */ + class Builder internal constructor() { private var id: JsonField? = null private var billingCycleDay: JsonField? = null @@ -5981,6 +6342,36 @@ private constructor( fun price(maxGroupTieredPackage: Price.MaxGroupTieredPackagePrice) = price(Price.ofMaxGroupTieredPackage(maxGroupTieredPackage)) + /** + * The Price resource represents a price that can be billed on a subscription, resulting + * in a charge on an invoice in the form of an invoice line item. Prices take a quantity + * and determine an amount to bill. + * + * Orb supports a few different pricing models out of the box. Each of these models is + * serialized differently in a given Price object. The model_type field determines the + * key for the configuration object that is present. + * + * For more on the types of prices, see + * [the core concepts documentation](/core-concepts#plan-and-price) + */ + fun price(scalableMatrixWithUnitPricing: Price.ScalableMatrixWithUnitPricingPrice) = + price(Price.ofScalableMatrixWithUnitPricing(scalableMatrixWithUnitPricing)) + + /** + * The Price resource represents a price that can be billed on a subscription, resulting + * in a charge on an invoice in the form of an invoice line item. Prices take a quantity + * and determine an amount to bill. + * + * Orb supports a few different pricing models out of the box. Each of these models is + * serialized differently in a given Price object. The model_type field determines the + * key for the configuration object that is present. + * + * For more on the types of prices, see + * [the core concepts documentation](/core-concepts#plan-and-price) + */ + fun price(scalableMatrixWithTieredPricing: Price.ScalableMatrixWithTieredPricingPrice) = + price(Price.ofScalableMatrixWithTieredPricing(scalableMatrixWithTieredPricing)) + /** * The start date of the price interval. This is the date that Orb starts billing for * this price. @@ -6085,7 +6476,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [FixedFeeQuantityTransition]. */ + class Builder internal constructor() { private var effectiveDate: JsonField? = null private var priceId: JsonField? = null @@ -6241,7 +6633,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [RedeemedCoupon]. */ + class Builder internal constructor() { private var couponId: JsonField? = null private var endDate: JsonField? = null @@ -6324,6 +6717,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -6337,19 +6738,37 @@ private constructor( @JvmStatic fun of(value: String) = Status(JsonField.of(value)) } + /** An enum containing [Status]'s known values. */ enum class Known { ACTIVE, ENDED, UPCOMING, } + /** + * An enum containing [Status]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Status] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ACTIVE, ENDED, UPCOMING, + /** An enum member indicating that [Status] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { ACTIVE -> Value.ACTIVE @@ -6358,6 +6777,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { ACTIVE -> Known.ACTIVE @@ -6421,7 +6848,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TrialInfo]. */ + class Builder internal constructor() { private var endDate: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() 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 04a706ef..9cdcd9b3 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 @@ -12,6 +12,7 @@ import com.withorb.api.core.JsonField import com.withorb.api.core.JsonMissing import com.withorb.api.core.JsonValue import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -74,12 +75,12 @@ import java.util.Optional * [cancellation behaviors](/product-catalog/creating-subscriptions#cancellation-behaviors). */ class SubscriptionCancelParams -constructor( +private constructor( private val subscriptionId: String, private val body: SubscriptionCancelBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun subscriptionId(): String = subscriptionId @@ -107,11 +108,11 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getBody(): SubscriptionCancelBody = body + @JvmSynthetic internal fun _body(): SubscriptionCancelBody = body - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun getPathParam(index: Int): String { return when (index) { @@ -180,7 +181,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [SubscriptionCancelBody]. */ + class Builder internal constructor() { private var cancelOption: JsonField? = null private var cancellationDate: JsonField = JsonMissing.of() @@ -275,8 +277,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [SubscriptionCancelParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var subscriptionId: String? = null private var body: SubscriptionCancelBody.Builder = SubscriptionCancelBody.builder() @@ -457,6 +460,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -470,19 +481,39 @@ constructor( @JvmStatic fun of(value: String) = CancelOption(JsonField.of(value)) } + /** An enum containing [CancelOption]'s known values. */ enum class Known { END_OF_SUBSCRIPTION_TERM, IMMEDIATE, REQUESTED_DATE, } + /** + * An enum containing [CancelOption]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [CancelOption] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { END_OF_SUBSCRIPTION_TERM, IMMEDIATE, REQUESTED_DATE, + /** + * An enum member indicating that [CancelOption] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { END_OF_SUBSCRIPTION_TERM -> Value.END_OF_SUBSCRIPTION_TERM @@ -491,6 +522,14 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { END_OF_SUBSCRIPTION_TERM -> Known.END_OF_SUBSCRIPTION_TERM 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 d99dbb7a..494f2c3d 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 @@ -440,7 +440,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [SubscriptionCancelResponse]. */ + class Builder internal constructor() { private var id: JsonField? = null private var activePlanPhaseOrder: JsonField? = null @@ -1075,7 +1076,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AdjustmentInterval]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustment: JsonField? = null @@ -1332,6 +1334,10 @@ private constructor( @JvmStatic fun ofMaximum(maximum: MaximumAdjustment) = Adjustment(maximum = maximum) } + /** + * An interface that defines how to map each variant of [Adjustment] to a value of type + * [T]. + */ interface Visitor { fun visitAmountDiscount(amountDiscount: AmountDiscountAdjustment): T @@ -1344,12 +1350,22 @@ private constructor( fun visitMaximum(maximum: MaximumAdjustment): T + /** + * Maps an unknown variant of [Adjustment] to a value of type [T]. + * + * An instance of [Adjustment] can contain an unknown variant if it was deserialized + * from data that doesn't match any known variant. For example, if the SDK is on an + * older version than the API, then the API may respond with new variants that the + * SDK is unaware of. + * + * @throws OrbInvalidDataException in the default implementation. + */ fun unknown(json: JsonValue?): T { throw OrbInvalidDataException("Unknown Adjustment: $json") } } - class Deserializer : BaseDeserializer(Adjustment::class) { + internal class Deserializer : BaseDeserializer(Adjustment::class) { override fun ObjectCodec.deserialize(node: JsonNode): Adjustment { val json = JsonValue.fromJsonNode(node) @@ -1403,7 +1419,7 @@ private constructor( } } - class Serializer : BaseSerializer(Adjustment::class) { + internal class Serializer : BaseSerializer(Adjustment::class) { override fun serialize( value: Adjustment, @@ -1542,7 +1558,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AmountDiscountAdjustment]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustmentType: JsonField? = null @@ -1701,6 +1718,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -1711,21 +1736,53 @@ private constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { AMOUNT_DISCOUNT, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { AMOUNT_DISCOUNT, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { AMOUNT_DISCOUNT -> Value.AMOUNT_DISCOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { AMOUNT_DISCOUNT -> Known.AMOUNT_DISCOUNT @@ -1885,7 +1942,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [PercentageDiscountAdjustment]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustmentType: JsonField? = null @@ -2047,6 +2105,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -2057,21 +2123,53 @@ private constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { PERCENTAGE_DISCOUNT, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PERCENTAGE_DISCOUNT, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { PERCENTAGE_DISCOUNT -> Value.PERCENTAGE_DISCOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { PERCENTAGE_DISCOUNT -> Known.PERCENTAGE_DISCOUNT @@ -2230,7 +2328,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [UsageDiscountAdjustment]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustmentType: JsonField? = null @@ -2389,6 +2488,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -2399,21 +2506,53 @@ private constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { USAGE_DISCOUNT, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { USAGE_DISCOUNT, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { USAGE_DISCOUNT -> Value.USAGE_DISCOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { USAGE_DISCOUNT -> Known.USAGE_DISCOUNT @@ -2582,7 +2721,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MinimumAdjustment]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustmentType: JsonField? = null @@ -2749,6 +2889,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -2759,21 +2907,53 @@ private constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { MINIMUM, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { MINIMUM, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { MINIMUM -> Value.MINIMUM else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { MINIMUM -> Known.MINIMUM @@ -2932,7 +3112,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MaximumAdjustment]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustmentType: JsonField? = null @@ -3090,6 +3271,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -3100,21 +3289,53 @@ private constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { MAXIMUM, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { MAXIMUM, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { MAXIMUM -> Value.MAXIMUM else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { MAXIMUM -> Known.MAXIMUM @@ -3250,7 +3471,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleAnchorConfiguration]. */ + class Builder internal constructor() { private var day: JsonField? = null private var month: JsonField = JsonMissing.of() @@ -3474,6 +3696,10 @@ private constructor( @JvmStatic fun ofUsage(usage: UsageDiscountInterval) = DiscountInterval(usage = usage) } + /** + * An interface that defines how to map each variant of [DiscountInterval] to a value of + * type [T]. + */ interface Visitor { fun visitAmount(amount: AmountDiscountInterval): T @@ -3482,12 +3708,22 @@ private constructor( fun visitUsage(usage: UsageDiscountInterval): T + /** + * Maps an unknown variant of [DiscountInterval] to a value of type [T]. + * + * An instance of [DiscountInterval] can contain an unknown variant if it was + * deserialized from data that doesn't match any known variant. For example, if the SDK + * is on an older version than the API, then the API may respond with new variants that + * the SDK is unaware of. + * + * @throws OrbInvalidDataException in the default implementation. + */ fun unknown(json: JsonValue?): T { throw OrbInvalidDataException("Unknown DiscountInterval: $json") } } - class Deserializer : BaseDeserializer(DiscountInterval::class) { + internal class Deserializer : BaseDeserializer(DiscountInterval::class) { override fun ObjectCodec.deserialize(node: JsonNode): DiscountInterval { val json = JsonValue.fromJsonNode(node) @@ -3525,7 +3761,7 @@ private constructor( } } - class Serializer : BaseSerializer(DiscountInterval::class) { + internal class Serializer : BaseSerializer(DiscountInterval::class) { override fun serialize( value: DiscountInterval, @@ -3644,7 +3880,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AmountDiscountInterval]. */ + class Builder internal constructor() { private var amountDiscount: JsonField? = null private var appliesToPriceIds: JsonField>? = null @@ -3793,6 +4030,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -3802,21 +4047,52 @@ private constructor( @JvmStatic fun of(value: String) = DiscountType(JsonField.of(value)) } + /** An enum containing [DiscountType]'s known values. */ enum class Known { AMOUNT, } + /** + * An enum containing [DiscountType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DiscountType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { AMOUNT, + /** + * An enum member indicating that [DiscountType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { AMOUNT -> Value.AMOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { AMOUNT -> Known.AMOUNT @@ -3958,7 +4234,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [PercentageDiscountInterval]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var appliesToPriceIntervalIds: JsonField>? = null @@ -4113,6 +4390,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -4122,21 +4407,52 @@ private constructor( @JvmStatic fun of(value: String) = DiscountType(JsonField.of(value)) } + /** An enum containing [DiscountType]'s known values. */ enum class Known { PERCENTAGE, } + /** + * An enum containing [DiscountType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DiscountType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PERCENTAGE, + /** + * An enum member indicating that [DiscountType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { PERCENTAGE -> Value.PERCENTAGE else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { PERCENTAGE -> Known.PERCENTAGE @@ -4284,7 +4600,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [UsageDiscountInterval]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var appliesToPriceIntervalIds: JsonField>? = null @@ -4438,6 +4755,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -4447,21 +4772,52 @@ private constructor( @JvmStatic fun of(value: String) = DiscountType(JsonField.of(value)) } + /** An enum containing [DiscountType]'s known values. */ enum class Known { USAGE, } + /** + * An enum containing [DiscountType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DiscountType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { USAGE, + /** + * An enum member indicating that [DiscountType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { USAGE -> Value.USAGE else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { USAGE -> Known.USAGE @@ -4568,7 +4924,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [FixedFeeQuantitySchedule]. */ + class Builder internal constructor() { private var endDate: JsonField? = null private var priceId: JsonField? = null @@ -4750,7 +5107,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MaximumInterval]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var appliesToPriceIntervalIds: JsonField>? = null @@ -4933,7 +5291,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -5079,7 +5438,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MinimumInterval]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var appliesToPriceIntervalIds: JsonField>? = null @@ -5418,7 +5778,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [PriceInterval]. */ + class Builder internal constructor() { private var id: JsonField? = null private var billingCycleDay: JsonField? = null @@ -5969,6 +6330,36 @@ private constructor( fun price(maxGroupTieredPackage: Price.MaxGroupTieredPackagePrice) = price(Price.ofMaxGroupTieredPackage(maxGroupTieredPackage)) + /** + * The Price resource represents a price that can be billed on a subscription, resulting + * in a charge on an invoice in the form of an invoice line item. Prices take a quantity + * and determine an amount to bill. + * + * Orb supports a few different pricing models out of the box. Each of these models is + * serialized differently in a given Price object. The model_type field determines the + * key for the configuration object that is present. + * + * For more on the types of prices, see + * [the core concepts documentation](/core-concepts#plan-and-price) + */ + fun price(scalableMatrixWithUnitPricing: Price.ScalableMatrixWithUnitPricingPrice) = + price(Price.ofScalableMatrixWithUnitPricing(scalableMatrixWithUnitPricing)) + + /** + * The Price resource represents a price that can be billed on a subscription, resulting + * in a charge on an invoice in the form of an invoice line item. Prices take a quantity + * and determine an amount to bill. + * + * Orb supports a few different pricing models out of the box. Each of these models is + * serialized differently in a given Price object. The model_type field determines the + * key for the configuration object that is present. + * + * For more on the types of prices, see + * [the core concepts documentation](/core-concepts#plan-and-price) + */ + fun price(scalableMatrixWithTieredPricing: Price.ScalableMatrixWithTieredPricingPrice) = + price(Price.ofScalableMatrixWithTieredPricing(scalableMatrixWithTieredPricing)) + /** * The start date of the price interval. This is the date that Orb starts billing for * this price. @@ -6073,7 +6464,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [FixedFeeQuantityTransition]. */ + class Builder internal constructor() { private var effectiveDate: JsonField? = null private var priceId: JsonField? = null @@ -6229,7 +6621,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [RedeemedCoupon]. */ + class Builder internal constructor() { private var couponId: JsonField? = null private var endDate: JsonField? = null @@ -6312,6 +6705,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -6325,19 +6726,37 @@ private constructor( @JvmStatic fun of(value: String) = Status(JsonField.of(value)) } + /** An enum containing [Status]'s known values. */ enum class Known { ACTIVE, ENDED, UPCOMING, } + /** + * An enum containing [Status]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Status] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ACTIVE, ENDED, UPCOMING, + /** An enum member indicating that [Status] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { ACTIVE -> Value.ACTIVE @@ -6346,6 +6765,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { ACTIVE -> Known.ACTIVE @@ -6409,7 +6836,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TrialInfo]. */ + class Builder internal constructor() { private var endDate: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() 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 51980a4c..bd837551 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 @@ -21,6 +21,7 @@ import com.withorb.api.core.JsonField import com.withorb.api.core.JsonMissing import com.withorb.api.core.JsonValue import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.getOrThrow import com.withorb.api.core.http.Headers @@ -266,11 +267,11 @@ import kotlin.jvm.optionals.getOrNull * usage amounts hit $10.00 for a subscription that invoices in USD. */ class SubscriptionCreateParams -constructor( +private constructor( private val body: SubscriptionCreateBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { /** * Additional adjustments to be added to the subscription. (Only available for accounts that @@ -564,11 +565,11 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getBody(): SubscriptionCreateBody = body + @JvmSynthetic internal fun _body(): SubscriptionCreateBody = body - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams @NoAutoDetect class SubscriptionCreateBody @@ -1091,7 +1092,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [SubscriptionCreateBody]. */ + class Builder internal constructor() { private var addAdjustments: JsonField>? = null private var addPrices: JsonField>? = null @@ -1934,8 +1936,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [SubscriptionCreateParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var body: SubscriptionCreateBody.Builder = SubscriptionCreateBody.builder() private var additionalHeaders: Headers.Builder = Headers.builder() @@ -2795,7 +2798,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AddAdjustment]. */ + class Builder internal constructor() { private var adjustment: JsonField? = null private var endDate: JsonField = JsonMissing.of() @@ -3071,6 +3075,10 @@ constructor( fun ofNewMaximum(newMaximum: NewMaximum) = Adjustment(newMaximum = newMaximum) } + /** + * An interface that defines how to map each variant of [Adjustment] to a value of type + * [T]. + */ interface Visitor { fun visitNewPercentageDiscount(newPercentageDiscount: NewPercentageDiscount): T @@ -3083,12 +3091,22 @@ constructor( fun visitNewMaximum(newMaximum: NewMaximum): T + /** + * Maps an unknown variant of [Adjustment] to a value of type [T]. + * + * An instance of [Adjustment] can contain an unknown variant if it was deserialized + * from data that doesn't match any known variant. For example, if the SDK is on an + * older version than the API, then the API may respond with new variants that the + * SDK is unaware of. + * + * @throws OrbInvalidDataException in the default implementation. + */ fun unknown(json: JsonValue?): T { throw OrbInvalidDataException("Unknown Adjustment: $json") } } - class Deserializer : BaseDeserializer(Adjustment::class) { + internal class Deserializer : BaseDeserializer(Adjustment::class) { override fun ObjectCodec.deserialize(node: JsonNode): Adjustment { val json = JsonValue.fromJsonNode(node) @@ -3138,7 +3156,7 @@ constructor( } } - class Serializer : BaseSerializer(Adjustment::class) { + internal class Serializer : BaseSerializer(Adjustment::class) { override fun serialize( value: Adjustment, @@ -3242,7 +3260,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewPercentageDiscount]. */ + class Builder internal constructor() { private var adjustmentType: JsonField? = null private var appliesToPriceIds: JsonField>? = null @@ -3353,6 +3372,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -3363,21 +3390,53 @@ constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { PERCENTAGE_DISCOUNT, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PERCENTAGE_DISCOUNT, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { PERCENTAGE_DISCOUNT -> Value.PERCENTAGE_DISCOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { PERCENTAGE_DISCOUNT -> Known.PERCENTAGE_DISCOUNT @@ -3498,7 +3557,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewUsageDiscount]. */ + class Builder internal constructor() { private var adjustmentType: JsonField? = null private var appliesToPriceIds: JsonField>? = null @@ -3608,6 +3668,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -3618,21 +3686,53 @@ constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { USAGE_DISCOUNT, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { USAGE_DISCOUNT, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { USAGE_DISCOUNT -> Value.USAGE_DISCOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { USAGE_DISCOUNT -> Known.USAGE_DISCOUNT @@ -3753,7 +3853,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewAmountDiscount]. */ + class Builder internal constructor() { private var adjustmentType: JsonField? = null private var amountDiscount: JsonField? = null @@ -3863,6 +3964,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -3873,21 +3982,53 @@ constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { AMOUNT_DISCOUNT, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { AMOUNT_DISCOUNT, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { AMOUNT_DISCOUNT -> Value.AMOUNT_DISCOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { AMOUNT_DISCOUNT -> Known.AMOUNT_DISCOUNT @@ -4018,7 +4159,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewMinimum]. */ + class Builder internal constructor() { private var adjustmentType: JsonField? = null private var appliesToPriceIds: JsonField>? = null @@ -4136,6 +4278,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -4146,21 +4296,53 @@ constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { MINIMUM, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { MINIMUM, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { MINIMUM -> Value.MINIMUM else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { MINIMUM -> Known.MINIMUM @@ -4281,7 +4463,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewMaximum]. */ + class Builder internal constructor() { private var adjustmentType: JsonField? = null private var appliesToPriceIds: JsonField>? = null @@ -4390,6 +4573,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -4400,21 +4591,53 @@ constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { MAXIMUM, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { MAXIMUM, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { MAXIMUM -> Value.MAXIMUM else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { MAXIMUM -> Known.MAXIMUM @@ -4647,7 +4870,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AddPrice]. */ + class Builder internal constructor() { private var discounts: JsonField>? = null private var endDate: JsonField = JsonMissing.of() @@ -5071,7 +5295,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Discount]. */ + class Builder internal constructor() { private var discountType: JsonField? = null private var amountDiscount: JsonField = JsonMissing.of() @@ -5205,6 +5430,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -5218,19 +5451,41 @@ constructor( @JvmStatic fun of(value: String) = DiscountType(JsonField.of(value)) } + /** An enum containing [DiscountType]'s known values. */ enum class Known { PERCENTAGE, USAGE, AMOUNT, } + /** + * An enum containing [DiscountType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DiscountType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PERCENTAGE, USAGE, AMOUNT, + /** + * An enum member indicating that [DiscountType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { PERCENTAGE -> Value.PERCENTAGE @@ -5239,6 +5494,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { PERCENTAGE -> Known.PERCENTAGE @@ -5812,6 +6076,9 @@ constructor( ) = Price(newSubscriptionBulkWithProration = newSubscriptionBulkWithProration) } + /** + * An interface that defines how to map each variant of [Price] to a value of type [T]. + */ interface Visitor { fun visitNewSubscriptionUnit(newSubscriptionUnit: NewSubscriptionUnitPrice): T @@ -5877,12 +6144,22 @@ constructor( newSubscriptionBulkWithProration: NewSubscriptionBulkWithProrationPrice ): T + /** + * Maps an unknown variant of [Price] to a value of type [T]. + * + * An instance of [Price] can contain an unknown variant if it was deserialized from + * data that doesn't match any known variant. For example, if the SDK is on an older + * version than the API, then the API may respond with new variants that the SDK is + * unaware of. + * + * @throws OrbInvalidDataException in the default implementation. + */ fun unknown(json: JsonValue?): T { throw OrbInvalidDataException("Unknown Price: $json") } } - class Deserializer : BaseDeserializer(Price::class) { + internal class Deserializer : BaseDeserializer(Price::class) { override fun ObjectCodec.deserialize(node: JsonNode): Price { val json = JsonValue.fromJsonNode(node) @@ -6094,7 +6371,7 @@ constructor( } } - class Serializer : BaseSerializer(Price::class) { + internal class Serializer : BaseSerializer(Price::class) { override fun serialize( value: Price, @@ -6426,7 +6703,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionUnitPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var itemId: JsonField? = null @@ -6800,6 +7078,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -6820,6 +7106,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -6829,6 +7116,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -6836,9 +7132,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -6850,6 +7157,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -6882,6 +7198,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -6892,21 +7216,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { UNIT, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { UNIT, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { UNIT -> Value.UNIT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { UNIT -> Known.UNIT @@ -6969,7 +7324,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [UnitConfig]. */ + class Builder internal constructor() { private var unitAmount: JsonField? = null private var additionalProperties: MutableMap = @@ -7093,7 +7449,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -7161,6 +7518,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -7173,17 +7538,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -7191,6 +7579,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -7289,7 +7686,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -7358,6 +7756,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -7370,17 +7776,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -7388,6 +7817,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -7463,7 +7901,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -7815,7 +8254,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionPackagePrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var itemId: JsonField? = null @@ -8191,6 +8631,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -8211,6 +8659,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -8220,6 +8669,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -8227,9 +8685,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -8241,6 +8710,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -8273,6 +8751,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -8283,21 +8769,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { PACKAGE, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PACKAGE, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { PACKAGE -> Value.PACKAGE else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { PACKAGE -> Known.PACKAGE @@ -8378,7 +8895,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [PackageConfig]. */ + class Builder internal constructor() { private var packageAmount: JsonField? = null private var packageSize: JsonField? = null @@ -8520,7 +9038,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -8588,6 +9107,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -8600,17 +9127,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -8618,6 +9168,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -8716,7 +9275,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -8785,6 +9345,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -8797,17 +9365,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -8815,6 +9406,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -8890,7 +9490,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -9242,7 +9843,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionMatrixPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var itemId: JsonField? = null @@ -9618,6 +10220,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -9638,6 +10248,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -9647,6 +10258,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -9654,9 +10274,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -9668,6 +10299,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -9767,7 +10407,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MatrixConfig]. */ + class Builder internal constructor() { private var defaultUnitAmount: JsonField? = null private var dimensions: JsonField>? = null @@ -9940,7 +10581,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MatrixValue]. */ + class Builder internal constructor() { private var dimensionValues: JsonField>? = null private var unitAmount: JsonField? = null @@ -10074,6 +10716,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -10084,21 +10734,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { MATRIX, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { MATRIX, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { MATRIX -> Value.MATRIX else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { MATRIX -> Known.MATRIX @@ -10177,7 +10858,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -10245,6 +10927,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -10257,17 +10947,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -10275,6 +10988,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -10373,7 +11095,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -10442,6 +11165,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -10454,17 +11185,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -10472,6 +11226,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -10547,7 +11310,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -10899,7 +11663,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionTieredPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var itemId: JsonField? = null @@ -11275,6 +12040,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -11295,6 +12068,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -11304,6 +12078,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -11311,9 +12094,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -11325,6 +12119,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -11357,6 +12160,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -11367,21 +12178,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { TIERED, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { TIERED, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { TIERED -> Value.TIERED else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { TIERED -> Known.TIERED @@ -11444,7 +12286,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TieredConfig]. */ + class Builder internal constructor() { private var tiers: JsonField>? = null private var additionalProperties: MutableMap = @@ -11584,7 +12427,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Tier]. */ + class Builder internal constructor() { private var firstUnit: JsonField? = null private var unitAmount: JsonField? = null @@ -11772,7 +12616,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -11840,6 +12685,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -11852,17 +12705,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -11870,6 +12746,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -11968,7 +12853,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -12037,6 +12923,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -12049,17 +12943,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -12067,6 +12984,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -12142,7 +13068,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -12495,7 +13422,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionTieredBpsPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var itemId: JsonField? = null @@ -12872,6 +13800,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -12892,6 +13828,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -12901,6 +13838,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -12908,9 +13854,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -12922,6 +13879,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -12954,6 +13920,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -12964,21 +13938,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { TIERED_BPS, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { TIERED_BPS, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { TIERED_BPS -> Value.TIERED_BPS else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { TIERED_BPS -> Known.TIERED_BPS @@ -13047,7 +14052,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TieredBpsConfig]. */ + class Builder internal constructor() { private var tiers: JsonField>? = null private var additionalProperties: MutableMap = @@ -13198,7 +14204,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Tier]. */ + class Builder internal constructor() { private var bps: JsonField? = null private var minimumAmount: JsonField? = null @@ -13382,7 +14389,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -13450,6 +14458,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -13462,17 +14478,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -13480,6 +14519,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -13578,7 +14626,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -13647,6 +14696,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -13659,17 +14716,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -13677,6 +14757,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -13752,7 +14841,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -14104,7 +15194,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionBpsPrice]. */ + class Builder internal constructor() { private var bpsConfig: JsonField? = null private var cadence: JsonField? = null @@ -14523,7 +15614,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BpsConfig]. */ + class Builder internal constructor() { private var bps: JsonField? = null private var perUnitMaximum: JsonField = JsonMissing.of() @@ -14611,6 +15703,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -14631,6 +15731,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -14640,6 +15741,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -14647,9 +15757,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -14661,6 +15782,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -14693,6 +15823,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -14703,21 +15841,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { BPS, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { BPS, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { BPS -> Value.BPS else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { BPS -> Known.BPS @@ -14796,7 +15965,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -14864,6 +16034,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -14876,17 +16054,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -14894,6 +16095,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -14992,7 +16202,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -15061,6 +16272,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -15073,17 +16292,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -15091,6 +16333,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -15166,7 +16417,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -15518,7 +16770,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionBulkBpsPrice]. */ + class Builder internal constructor() { private var bulkBpsConfig: JsonField? = null private var cadence: JsonField? = null @@ -15934,7 +17187,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BulkBpsConfig]. */ + class Builder internal constructor() { private var tiers: JsonField>? = null private var additionalProperties: MutableMap = @@ -16072,7 +17326,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Tier]. */ + class Builder internal constructor() { private var bps: JsonField? = null private var maximumAmount: JsonField = JsonMissing.of() @@ -16194,6 +17449,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -16214,6 +17477,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -16223,6 +17487,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -16230,9 +17503,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -16244,6 +17528,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -16276,6 +17569,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -16286,21 +17587,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { BULK_BPS, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { BULK_BPS, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { BULK_BPS -> Value.BULK_BPS else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { BULK_BPS -> Known.BULK_BPS @@ -16379,7 +17711,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -16447,6 +17780,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -16459,17 +17800,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -16477,6 +17841,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -16575,7 +17948,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -16644,6 +18018,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -16656,17 +18038,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -16674,6 +18079,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -16749,7 +18163,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -17101,7 +18516,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionBulkPrice]. */ + class Builder internal constructor() { private var bulkConfig: JsonField? = null private var cadence: JsonField? = null @@ -17509,7 +18925,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BulkConfig]. */ + class Builder internal constructor() { private var tiers: JsonField>? = null private var additionalProperties: MutableMap = @@ -17627,7 +19044,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Tier]. */ + class Builder internal constructor() { private var unitAmount: JsonField? = null private var maximumUnits: JsonField = JsonMissing.of() @@ -17743,6 +19161,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -17763,6 +19189,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -17772,6 +19199,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -17779,9 +19215,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -17793,6 +19240,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -17825,6 +19281,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -17835,21 +19299,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { BULK, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { BULK, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { BULK -> Value.BULK else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { BULK -> Known.BULK @@ -17928,7 +19423,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -17996,6 +19492,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -18008,17 +19512,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -18026,6 +19553,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -18124,7 +19660,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -18193,6 +19730,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -18205,17 +19750,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -18223,6 +19791,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -18298,7 +19875,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -18653,7 +20231,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionThresholdTotalAmountPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var itemId: JsonField? = null @@ -19037,6 +20616,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -19057,6 +20644,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -19066,6 +20654,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -19073,9 +20670,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -19087,6 +20695,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -19119,6 +20736,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -19129,21 +20754,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { THRESHOLD_TOTAL_AMOUNT, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { THRESHOLD_TOTAL_AMOUNT, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { THRESHOLD_TOTAL_AMOUNT -> Value.THRESHOLD_TOTAL_AMOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { THRESHOLD_TOTAL_AMOUNT -> Known.THRESHOLD_TOTAL_AMOUNT @@ -19194,7 +20850,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [ThresholdTotalAmountConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -19307,7 +20964,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -19375,6 +21033,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -19387,17 +21053,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -19405,6 +21094,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -19503,7 +21201,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -19572,6 +21271,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -19584,17 +21291,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -19602,6 +21332,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -19677,7 +21416,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -20030,7 +21770,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionTieredPackagePrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var itemId: JsonField? = null @@ -20408,6 +22149,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -20428,6 +22177,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -20437,6 +22187,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -20444,9 +22203,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -20458,6 +22228,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -20490,6 +22269,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -20500,21 +22287,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { TIERED_PACKAGE, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { TIERED_PACKAGE, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { TIERED_PACKAGE -> Value.TIERED_PACKAGE else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { TIERED_PACKAGE -> Known.TIERED_PACKAGE @@ -20565,7 +22383,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TieredPackageConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -20677,7 +22496,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -20745,6 +22565,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -20757,17 +22585,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -20775,6 +22626,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -20873,7 +22733,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -20942,6 +22803,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -20954,17 +22823,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -20972,6 +22864,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -21047,7 +22948,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -21402,7 +23304,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionTieredWithMinimumPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var itemId: JsonField? = null @@ -21783,6 +23686,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -21803,6 +23714,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -21812,6 +23724,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -21819,9 +23740,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -21833,6 +23765,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -21865,6 +23806,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -21875,21 +23824,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { TIERED_WITH_MINIMUM, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { TIERED_WITH_MINIMUM, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { TIERED_WITH_MINIMUM -> Value.TIERED_WITH_MINIMUM else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { TIERED_WITH_MINIMUM -> Known.TIERED_WITH_MINIMUM @@ -21940,7 +23920,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TieredWithMinimumConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -22053,7 +24034,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -22121,6 +24103,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -22133,17 +24123,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -22151,6 +24164,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -22249,7 +24271,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -22318,6 +24341,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -22330,17 +24361,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -22348,6 +24402,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -22423,7 +24486,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -22778,7 +24842,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionUnitWithPercentPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var itemId: JsonField? = null @@ -23156,6 +25221,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -23176,6 +25249,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -23185,6 +25259,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -23192,9 +25275,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -23206,6 +25300,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -23238,6 +25341,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -23248,21 +25359,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { UNIT_WITH_PERCENT, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { UNIT_WITH_PERCENT, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { UNIT_WITH_PERCENT -> Value.UNIT_WITH_PERCENT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { UNIT_WITH_PERCENT -> Known.UNIT_WITH_PERCENT @@ -23313,7 +25455,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [UnitWithPercentConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -23425,7 +25568,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -23493,6 +25637,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -23505,17 +25657,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -23523,6 +25698,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -23621,7 +25805,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -23690,6 +25875,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -23702,17 +25895,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -23720,6 +25936,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -23795,7 +26020,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -24150,7 +26376,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionPackageWithAllocationPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var itemId: JsonField? = null @@ -24539,6 +26766,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -24559,6 +26794,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -24568,6 +26804,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -24575,9 +26820,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -24589,6 +26845,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -24621,6 +26886,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -24631,21 +26904,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { PACKAGE_WITH_ALLOCATION, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PACKAGE_WITH_ALLOCATION, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { PACKAGE_WITH_ALLOCATION -> Value.PACKAGE_WITH_ALLOCATION else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { PACKAGE_WITH_ALLOCATION -> Known.PACKAGE_WITH_ALLOCATION @@ -24696,7 +27000,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [PackageWithAllocationConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -24810,7 +27115,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -24878,6 +27184,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -24890,17 +27204,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -24908,6 +27245,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -25006,7 +27352,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -25075,6 +27422,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -25087,17 +27442,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -25105,6 +27483,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -25180,7 +27567,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -25535,7 +27923,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionTierWithProrationPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var itemId: JsonField? = null @@ -25918,6 +28307,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -25938,6 +28335,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -25947,6 +28345,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -25954,9 +28361,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -25968,6 +28386,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -26000,6 +28427,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -26010,21 +28445,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { TIERED_WITH_PRORATION, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { TIERED_WITH_PRORATION, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { TIERED_WITH_PRORATION -> Value.TIERED_WITH_PRORATION else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { TIERED_WITH_PRORATION -> Known.TIERED_WITH_PRORATION @@ -26075,7 +28541,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TieredWithProrationConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -26188,7 +28655,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -26256,6 +28724,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -26268,17 +28744,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -26286,6 +28785,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -26384,7 +28892,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -26453,6 +28962,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -26465,17 +28982,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -26483,6 +29023,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -26558,7 +29107,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -26913,7 +29463,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionUnitWithProrationPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var itemId: JsonField? = null @@ -27294,6 +29845,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -27314,6 +29873,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -27323,6 +29883,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -27330,9 +29899,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -27344,6 +29924,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -27376,6 +29965,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -27386,21 +29983,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { UNIT_WITH_PRORATION, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { UNIT_WITH_PRORATION, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { UNIT_WITH_PRORATION -> Value.UNIT_WITH_PRORATION else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { UNIT_WITH_PRORATION -> Known.UNIT_WITH_PRORATION @@ -27451,7 +30079,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [UnitWithProrationConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -27564,7 +30193,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -27632,6 +30262,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -27644,17 +30282,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -27662,6 +30323,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -27760,7 +30430,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -27829,6 +30500,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -27841,17 +30520,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -27859,6 +30561,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -27934,7 +30645,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -28289,7 +31001,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionGroupedAllocationPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var groupedAllocationConfig: JsonField? = null @@ -28670,6 +31383,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -28690,6 +31411,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -28699,6 +31421,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -28706,9 +31437,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -28720,6 +31462,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -28775,7 +31526,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [GroupedAllocationConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -28837,6 +31589,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -28847,21 +31607,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { GROUPED_ALLOCATION, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { GROUPED_ALLOCATION, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { GROUPED_ALLOCATION -> Value.GROUPED_ALLOCATION else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { GROUPED_ALLOCATION -> Known.GROUPED_ALLOCATION @@ -28940,7 +31731,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -29008,6 +31800,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -29020,17 +31820,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -29038,6 +31861,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -29136,7 +31968,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -29205,6 +32038,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -29217,17 +32058,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -29235,6 +32099,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -29310,7 +32183,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -29668,7 +32542,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionGroupedWithProratedMinimumPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var groupedWithProratedMinimumConfig: @@ -30068,6 +32943,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -30088,6 +32971,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -30097,6 +32981,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -30104,9 +32997,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -30118,6 +33022,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -30173,7 +33086,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [GroupedWithProratedMinimumConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -30236,6 +33150,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -30247,21 +33169,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { GROUPED_WITH_PRORATED_MINIMUM, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { GROUPED_WITH_PRORATED_MINIMUM, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { GROUPED_WITH_PRORATED_MINIMUM -> Value.GROUPED_WITH_PRORATED_MINIMUM else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { GROUPED_WITH_PRORATED_MINIMUM -> Known.GROUPED_WITH_PRORATED_MINIMUM @@ -30340,7 +33293,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -30408,6 +33362,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -30420,17 +33382,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -30438,6 +33423,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -30536,7 +33530,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -30605,6 +33600,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -30617,17 +33620,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -30635,6 +33661,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -30710,7 +33745,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -31065,7 +34101,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionBulkWithProrationPrice]. */ + class Builder internal constructor() { private var bulkWithProrationConfig: JsonField? = null private var cadence: JsonField? = null @@ -31468,7 +34505,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BulkWithProrationConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -31531,6 +34569,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -31551,6 +34597,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -31560,6 +34607,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -31567,9 +34623,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -31581,6 +34648,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -31613,6 +34689,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -31623,21 +34707,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { BULK_WITH_PRORATION, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { BULK_WITH_PRORATION, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { BULK_WITH_PRORATION -> Value.BULK_WITH_PRORATION else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { BULK_WITH_PRORATION -> Known.BULK_WITH_PRORATION @@ -31716,7 +34831,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -31784,6 +34900,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -31796,17 +34920,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -31814,6 +34961,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -31912,7 +35068,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -31981,6 +35138,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -31993,17 +35158,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -32011,6 +35199,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -32086,7 +35283,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -32252,7 +35450,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleAnchorConfiguration]. */ + class Builder internal constructor() { private var day: JsonField? = null private var month: JsonField = JsonMissing.of() @@ -32388,6 +35587,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -32401,19 +35608,40 @@ constructor( @JvmStatic fun of(value: String) = ExternalMarketplace(JsonField.of(value)) } + /** An enum containing [ExternalMarketplace]'s known values. */ enum class Known { GOOGLE, AWS, AZURE, } + /** + * An enum containing [ExternalMarketplace]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ExternalMarketplace] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { GOOGLE, AWS, AZURE, + /** + * An enum member indicating that [ExternalMarketplace] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { GOOGLE -> Value.GOOGLE @@ -32422,6 +35650,14 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { GOOGLE -> Known.GOOGLE @@ -32479,7 +35715,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -32568,7 +35805,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [RemoveAdjustment]. */ + class Builder internal constructor() { private var adjustmentId: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -32683,7 +35921,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [RemovePrice]. */ + class Builder internal constructor() { private var externalPriceId: JsonField = JsonMissing.of() private var priceId: JsonField = JsonMissing.of() @@ -32817,7 +36056,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [ReplaceAdjustment]. */ + class Builder internal constructor() { private var adjustment: JsonField? = null private var replacesAdjustmentId: JsonField? = null @@ -33035,6 +36275,10 @@ constructor( fun ofNewMaximum(newMaximum: NewMaximum) = Adjustment(newMaximum = newMaximum) } + /** + * An interface that defines how to map each variant of [Adjustment] to a value of type + * [T]. + */ interface Visitor { fun visitNewPercentageDiscount(newPercentageDiscount: NewPercentageDiscount): T @@ -33047,12 +36291,22 @@ constructor( fun visitNewMaximum(newMaximum: NewMaximum): T + /** + * Maps an unknown variant of [Adjustment] to a value of type [T]. + * + * An instance of [Adjustment] can contain an unknown variant if it was deserialized + * from data that doesn't match any known variant. For example, if the SDK is on an + * older version than the API, then the API may respond with new variants that the + * SDK is unaware of. + * + * @throws OrbInvalidDataException in the default implementation. + */ fun unknown(json: JsonValue?): T { throw OrbInvalidDataException("Unknown Adjustment: $json") } } - class Deserializer : BaseDeserializer(Adjustment::class) { + internal class Deserializer : BaseDeserializer(Adjustment::class) { override fun ObjectCodec.deserialize(node: JsonNode): Adjustment { val json = JsonValue.fromJsonNode(node) @@ -33102,7 +36356,7 @@ constructor( } } - class Serializer : BaseSerializer(Adjustment::class) { + internal class Serializer : BaseSerializer(Adjustment::class) { override fun serialize( value: Adjustment, @@ -33206,7 +36460,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewPercentageDiscount]. */ + class Builder internal constructor() { private var adjustmentType: JsonField? = null private var appliesToPriceIds: JsonField>? = null @@ -33317,6 +36572,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -33327,21 +36590,53 @@ constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { PERCENTAGE_DISCOUNT, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PERCENTAGE_DISCOUNT, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { PERCENTAGE_DISCOUNT -> Value.PERCENTAGE_DISCOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { PERCENTAGE_DISCOUNT -> Known.PERCENTAGE_DISCOUNT @@ -33462,7 +36757,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewUsageDiscount]. */ + class Builder internal constructor() { private var adjustmentType: JsonField? = null private var appliesToPriceIds: JsonField>? = null @@ -33572,6 +36868,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -33582,21 +36886,53 @@ constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { USAGE_DISCOUNT, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { USAGE_DISCOUNT, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { USAGE_DISCOUNT -> Value.USAGE_DISCOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { USAGE_DISCOUNT -> Known.USAGE_DISCOUNT @@ -33717,7 +37053,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewAmountDiscount]. */ + class Builder internal constructor() { private var adjustmentType: JsonField? = null private var amountDiscount: JsonField? = null @@ -33827,6 +37164,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -33837,21 +37182,53 @@ constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { AMOUNT_DISCOUNT, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { AMOUNT_DISCOUNT, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { AMOUNT_DISCOUNT -> Value.AMOUNT_DISCOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { AMOUNT_DISCOUNT -> Known.AMOUNT_DISCOUNT @@ -33982,7 +37359,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewMinimum]. */ + class Builder internal constructor() { private var adjustmentType: JsonField? = null private var appliesToPriceIds: JsonField>? = null @@ -34100,6 +37478,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -34110,21 +37496,53 @@ constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { MINIMUM, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { MINIMUM, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { MINIMUM -> Value.MINIMUM else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { MINIMUM -> Known.MINIMUM @@ -34245,7 +37663,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewMaximum]. */ + class Builder internal constructor() { private var adjustmentType: JsonField? = null private var appliesToPriceIds: JsonField>? = null @@ -34354,6 +37773,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -34364,21 +37791,53 @@ constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { MAXIMUM, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { MAXIMUM, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { MAXIMUM -> Value.MAXIMUM else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { MAXIMUM -> Known.MAXIMUM @@ -34587,7 +38046,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [ReplacePrice]. */ + class Builder internal constructor() { private var replacesPriceId: JsonField? = null private var discounts: JsonField>? = null @@ -34977,7 +38437,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Discount]. */ + class Builder internal constructor() { private var discountType: JsonField? = null private var amountDiscount: JsonField = JsonMissing.of() @@ -35111,6 +38572,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -35124,19 +38593,41 @@ constructor( @JvmStatic fun of(value: String) = DiscountType(JsonField.of(value)) } + /** An enum containing [DiscountType]'s known values. */ enum class Known { PERCENTAGE, USAGE, AMOUNT, } + /** + * An enum containing [DiscountType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DiscountType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PERCENTAGE, USAGE, AMOUNT, + /** + * An enum member indicating that [DiscountType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { PERCENTAGE -> Value.PERCENTAGE @@ -35145,6 +38636,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { PERCENTAGE -> Known.PERCENTAGE @@ -35718,6 +39218,9 @@ constructor( ) = Price(newSubscriptionBulkWithProration = newSubscriptionBulkWithProration) } + /** + * An interface that defines how to map each variant of [Price] to a value of type [T]. + */ interface Visitor { fun visitNewSubscriptionUnit(newSubscriptionUnit: NewSubscriptionUnitPrice): T @@ -35783,12 +39286,22 @@ constructor( newSubscriptionBulkWithProration: NewSubscriptionBulkWithProrationPrice ): T + /** + * Maps an unknown variant of [Price] to a value of type [T]. + * + * An instance of [Price] can contain an unknown variant if it was deserialized from + * data that doesn't match any known variant. For example, if the SDK is on an older + * version than the API, then the API may respond with new variants that the SDK is + * unaware of. + * + * @throws OrbInvalidDataException in the default implementation. + */ fun unknown(json: JsonValue?): T { throw OrbInvalidDataException("Unknown Price: $json") } } - class Deserializer : BaseDeserializer(Price::class) { + internal class Deserializer : BaseDeserializer(Price::class) { override fun ObjectCodec.deserialize(node: JsonNode): Price { val json = JsonValue.fromJsonNode(node) @@ -36000,7 +39513,7 @@ constructor( } } - class Serializer : BaseSerializer(Price::class) { + internal class Serializer : BaseSerializer(Price::class) { override fun serialize( value: Price, @@ -36332,7 +39845,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionUnitPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var itemId: JsonField? = null @@ -36706,6 +40220,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -36726,6 +40248,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -36735,6 +40258,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -36742,9 +40274,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -36756,6 +40299,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -36788,6 +40340,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -36798,21 +40358,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { UNIT, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { UNIT, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { UNIT -> Value.UNIT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { UNIT -> Known.UNIT @@ -36875,7 +40466,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [UnitConfig]. */ + class Builder internal constructor() { private var unitAmount: JsonField? = null private var additionalProperties: MutableMap = @@ -36999,7 +40591,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -37067,6 +40660,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -37079,17 +40680,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -37097,6 +40721,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -37195,7 +40828,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -37264,6 +40898,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -37276,17 +40918,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -37294,6 +40959,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -37369,7 +41043,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -37721,7 +41396,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionPackagePrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var itemId: JsonField? = null @@ -38097,6 +41773,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -38117,6 +41801,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -38126,6 +41811,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -38133,9 +41827,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -38147,6 +41852,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -38179,6 +41893,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -38189,21 +41911,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { PACKAGE, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PACKAGE, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { PACKAGE -> Value.PACKAGE else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { PACKAGE -> Known.PACKAGE @@ -38284,7 +42037,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [PackageConfig]. */ + class Builder internal constructor() { private var packageAmount: JsonField? = null private var packageSize: JsonField? = null @@ -38426,7 +42180,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -38494,6 +42249,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -38506,17 +42269,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -38524,6 +42310,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -38622,7 +42417,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -38691,6 +42487,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -38703,17 +42507,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -38721,6 +42548,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -38796,7 +42632,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -39148,7 +42985,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionMatrixPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var itemId: JsonField? = null @@ -39524,6 +43362,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -39544,6 +43390,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -39553,6 +43400,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -39560,9 +43416,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -39574,6 +43441,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -39673,7 +43549,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MatrixConfig]. */ + class Builder internal constructor() { private var defaultUnitAmount: JsonField? = null private var dimensions: JsonField>? = null @@ -39846,7 +43723,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MatrixValue]. */ + class Builder internal constructor() { private var dimensionValues: JsonField>? = null private var unitAmount: JsonField? = null @@ -39980,6 +43858,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -39990,21 +43876,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { MATRIX, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { MATRIX, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { MATRIX -> Value.MATRIX else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { MATRIX -> Known.MATRIX @@ -40083,7 +44000,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -40151,6 +44069,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -40163,17 +44089,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -40181,6 +44130,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -40279,7 +44237,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -40348,6 +44307,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -40360,17 +44327,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -40378,6 +44368,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -40453,7 +44452,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -40805,7 +44805,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionTieredPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var itemId: JsonField? = null @@ -41181,6 +45182,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -41201,6 +45210,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -41210,6 +45220,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -41217,9 +45236,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -41231,6 +45261,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -41263,6 +45302,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -41273,21 +45320,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { TIERED, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { TIERED, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { TIERED -> Value.TIERED else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { TIERED -> Known.TIERED @@ -41350,7 +45428,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TieredConfig]. */ + class Builder internal constructor() { private var tiers: JsonField>? = null private var additionalProperties: MutableMap = @@ -41490,7 +45569,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Tier]. */ + class Builder internal constructor() { private var firstUnit: JsonField? = null private var unitAmount: JsonField? = null @@ -41678,7 +45758,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -41746,6 +45827,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -41758,17 +45847,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -41776,6 +45888,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -41874,7 +45995,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -41943,6 +46065,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -41955,17 +46085,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -41973,6 +46126,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -42048,7 +46210,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -42401,7 +46564,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionTieredBpsPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var itemId: JsonField? = null @@ -42778,6 +46942,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -42798,6 +46970,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -42807,6 +46980,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -42814,9 +46996,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -42828,6 +47021,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -42860,6 +47062,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -42870,21 +47080,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { TIERED_BPS, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { TIERED_BPS, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { TIERED_BPS -> Value.TIERED_BPS else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { TIERED_BPS -> Known.TIERED_BPS @@ -42953,7 +47194,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TieredBpsConfig]. */ + class Builder internal constructor() { private var tiers: JsonField>? = null private var additionalProperties: MutableMap = @@ -43104,7 +47346,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Tier]. */ + class Builder internal constructor() { private var bps: JsonField? = null private var minimumAmount: JsonField? = null @@ -43288,7 +47531,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -43356,6 +47600,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -43368,17 +47620,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -43386,6 +47661,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -43484,7 +47768,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -43553,6 +47838,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -43565,17 +47858,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -43583,6 +47899,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -43658,7 +47983,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -44010,7 +48336,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionBpsPrice]. */ + class Builder internal constructor() { private var bpsConfig: JsonField? = null private var cadence: JsonField? = null @@ -44429,7 +48756,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BpsConfig]. */ + class Builder internal constructor() { private var bps: JsonField? = null private var perUnitMaximum: JsonField = JsonMissing.of() @@ -44517,6 +48845,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -44537,6 +48873,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -44546,6 +48883,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -44553,9 +48899,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -44567,6 +48924,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -44599,6 +48965,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -44609,21 +48983,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { BPS, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { BPS, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { BPS -> Value.BPS else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { BPS -> Known.BPS @@ -44702,7 +49107,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -44770,6 +49176,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -44782,17 +49196,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -44800,6 +49237,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -44898,7 +49344,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -44967,6 +49414,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -44979,17 +49434,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -44997,6 +49475,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -45072,7 +49559,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -45424,7 +49912,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionBulkBpsPrice]. */ + class Builder internal constructor() { private var bulkBpsConfig: JsonField? = null private var cadence: JsonField? = null @@ -45840,7 +50329,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BulkBpsConfig]. */ + class Builder internal constructor() { private var tiers: JsonField>? = null private var additionalProperties: MutableMap = @@ -45978,7 +50468,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Tier]. */ + class Builder internal constructor() { private var bps: JsonField? = null private var maximumAmount: JsonField = JsonMissing.of() @@ -46100,6 +50591,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -46120,6 +50619,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -46129,6 +50629,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -46136,9 +50645,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -46150,6 +50670,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -46182,6 +50711,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -46192,21 +50729,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { BULK_BPS, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { BULK_BPS, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { BULK_BPS -> Value.BULK_BPS else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { BULK_BPS -> Known.BULK_BPS @@ -46285,7 +50853,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -46353,6 +50922,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -46365,17 +50942,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -46383,6 +50983,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -46481,7 +51090,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -46550,6 +51160,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -46562,17 +51180,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -46580,6 +51221,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -46655,7 +51305,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -47007,7 +51658,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionBulkPrice]. */ + class Builder internal constructor() { private var bulkConfig: JsonField? = null private var cadence: JsonField? = null @@ -47415,7 +52067,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BulkConfig]. */ + class Builder internal constructor() { private var tiers: JsonField>? = null private var additionalProperties: MutableMap = @@ -47533,7 +52186,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Tier]. */ + class Builder internal constructor() { private var unitAmount: JsonField? = null private var maximumUnits: JsonField = JsonMissing.of() @@ -47649,6 +52303,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -47669,6 +52331,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -47678,6 +52341,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -47685,9 +52357,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -47699,6 +52382,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -47731,6 +52423,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -47741,21 +52441,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { BULK, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { BULK, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { BULK -> Value.BULK else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { BULK -> Known.BULK @@ -47834,7 +52565,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -47902,6 +52634,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -47914,17 +52654,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -47932,6 +52695,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -48030,7 +52802,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -48099,6 +52872,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -48111,17 +52892,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -48129,6 +52933,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -48204,7 +53017,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -48559,7 +53373,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionThresholdTotalAmountPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var itemId: JsonField? = null @@ -48943,6 +53758,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -48963,6 +53786,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -48972,6 +53796,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -48979,9 +53812,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -48993,6 +53837,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -49025,6 +53878,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -49035,21 +53896,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { THRESHOLD_TOTAL_AMOUNT, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { THRESHOLD_TOTAL_AMOUNT, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { THRESHOLD_TOTAL_AMOUNT -> Value.THRESHOLD_TOTAL_AMOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { THRESHOLD_TOTAL_AMOUNT -> Known.THRESHOLD_TOTAL_AMOUNT @@ -49100,7 +53992,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [ThresholdTotalAmountConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -49213,7 +54106,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -49281,6 +54175,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -49293,17 +54195,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -49311,6 +54236,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -49409,7 +54343,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -49478,6 +54413,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -49490,17 +54433,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -49508,6 +54474,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -49583,7 +54558,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -49936,7 +54912,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionTieredPackagePrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var itemId: JsonField? = null @@ -50314,6 +55291,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -50334,6 +55319,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -50343,6 +55329,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -50350,9 +55345,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -50364,6 +55370,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -50396,6 +55411,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -50406,21 +55429,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { TIERED_PACKAGE, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { TIERED_PACKAGE, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { TIERED_PACKAGE -> Value.TIERED_PACKAGE else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { TIERED_PACKAGE -> Known.TIERED_PACKAGE @@ -50471,7 +55525,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TieredPackageConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -50583,7 +55638,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -50651,6 +55707,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -50663,17 +55727,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -50681,6 +55768,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -50779,7 +55875,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -50848,6 +55945,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -50860,17 +55965,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -50878,6 +56006,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -50953,7 +56090,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -51308,7 +56446,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionTieredWithMinimumPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var itemId: JsonField? = null @@ -51689,6 +56828,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -51709,6 +56856,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -51718,6 +56866,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -51725,9 +56882,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -51739,6 +56907,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -51771,6 +56948,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -51781,21 +56966,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { TIERED_WITH_MINIMUM, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { TIERED_WITH_MINIMUM, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { TIERED_WITH_MINIMUM -> Value.TIERED_WITH_MINIMUM else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { TIERED_WITH_MINIMUM -> Known.TIERED_WITH_MINIMUM @@ -51846,7 +57062,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TieredWithMinimumConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -51959,7 +57176,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -52027,6 +57245,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -52039,17 +57265,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -52057,6 +57306,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -52155,7 +57413,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -52224,6 +57483,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -52236,17 +57503,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -52254,6 +57544,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -52329,7 +57628,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -52684,7 +57984,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionUnitWithPercentPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var itemId: JsonField? = null @@ -53062,6 +58363,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -53082,6 +58391,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -53091,6 +58401,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -53098,9 +58417,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -53112,6 +58442,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -53144,6 +58483,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -53154,21 +58501,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { UNIT_WITH_PERCENT, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { UNIT_WITH_PERCENT, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { UNIT_WITH_PERCENT -> Value.UNIT_WITH_PERCENT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { UNIT_WITH_PERCENT -> Known.UNIT_WITH_PERCENT @@ -53219,7 +58597,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [UnitWithPercentConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -53331,7 +58710,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -53399,6 +58779,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -53411,17 +58799,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -53429,6 +58840,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -53527,7 +58947,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -53596,6 +59017,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -53608,17 +59037,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -53626,6 +59078,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -53701,7 +59162,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -54056,7 +59518,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionPackageWithAllocationPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var itemId: JsonField? = null @@ -54445,6 +59908,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -54465,6 +59936,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -54474,6 +59946,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -54481,9 +59962,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -54495,6 +59987,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -54527,6 +60028,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -54537,21 +60046,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { PACKAGE_WITH_ALLOCATION, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PACKAGE_WITH_ALLOCATION, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { PACKAGE_WITH_ALLOCATION -> Value.PACKAGE_WITH_ALLOCATION else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { PACKAGE_WITH_ALLOCATION -> Known.PACKAGE_WITH_ALLOCATION @@ -54602,7 +60142,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [PackageWithAllocationConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -54716,7 +60257,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -54784,6 +60326,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -54796,17 +60346,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -54814,6 +60387,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -54912,7 +60494,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -54981,6 +60564,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -54993,17 +60584,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -55011,6 +60625,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -55086,7 +60709,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -55441,7 +61065,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionTierWithProrationPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var itemId: JsonField? = null @@ -55824,6 +61449,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -55844,6 +61477,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -55853,6 +61487,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -55860,9 +61503,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -55874,6 +61528,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -55906,6 +61569,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -55916,21 +61587,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { TIERED_WITH_PRORATION, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { TIERED_WITH_PRORATION, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { TIERED_WITH_PRORATION -> Value.TIERED_WITH_PRORATION else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { TIERED_WITH_PRORATION -> Known.TIERED_WITH_PRORATION @@ -55981,7 +61683,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TieredWithProrationConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -56094,7 +61797,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -56162,6 +61866,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -56174,17 +61886,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -56192,6 +61927,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -56290,7 +62034,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -56359,6 +62104,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -56371,17 +62124,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -56389,6 +62165,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -56464,7 +62249,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -56819,7 +62605,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionUnitWithProrationPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var itemId: JsonField? = null @@ -57200,6 +62987,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -57220,6 +63015,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -57229,6 +63025,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -57236,9 +63041,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -57250,6 +63066,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -57282,6 +63107,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -57292,21 +63125,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { UNIT_WITH_PRORATION, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { UNIT_WITH_PRORATION, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { UNIT_WITH_PRORATION -> Value.UNIT_WITH_PRORATION else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { UNIT_WITH_PRORATION -> Known.UNIT_WITH_PRORATION @@ -57357,7 +63221,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [UnitWithProrationConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -57470,7 +63335,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -57538,6 +63404,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -57550,17 +63424,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -57568,6 +63465,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -57666,7 +63572,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -57735,6 +63642,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -57747,17 +63662,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -57765,6 +63703,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -57840,7 +63787,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -58195,7 +64143,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionGroupedAllocationPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var groupedAllocationConfig: JsonField? = null @@ -58576,6 +64525,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -58596,6 +64553,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -58605,6 +64563,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -58612,9 +64579,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -58626,6 +64604,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -58681,7 +64668,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [GroupedAllocationConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -58743,6 +64731,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -58753,21 +64749,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { GROUPED_ALLOCATION, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { GROUPED_ALLOCATION, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { GROUPED_ALLOCATION -> Value.GROUPED_ALLOCATION else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { GROUPED_ALLOCATION -> Known.GROUPED_ALLOCATION @@ -58846,7 +64873,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -58914,6 +64942,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -58926,17 +64962,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -58944,6 +65003,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -59042,7 +65110,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -59111,6 +65180,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -59123,17 +65200,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -59141,6 +65241,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -59216,7 +65325,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -59574,7 +65684,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionGroupedWithProratedMinimumPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var groupedWithProratedMinimumConfig: @@ -59974,6 +66085,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -59994,6 +66113,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -60003,6 +66123,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -60010,9 +66139,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -60024,6 +66164,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -60079,7 +66228,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [GroupedWithProratedMinimumConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -60142,6 +66292,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -60153,21 +66311,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { GROUPED_WITH_PRORATED_MINIMUM, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { GROUPED_WITH_PRORATED_MINIMUM, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { GROUPED_WITH_PRORATED_MINIMUM -> Value.GROUPED_WITH_PRORATED_MINIMUM else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { GROUPED_WITH_PRORATED_MINIMUM -> Known.GROUPED_WITH_PRORATED_MINIMUM @@ -60246,7 +66435,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -60314,6 +66504,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -60326,17 +66524,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -60344,6 +66565,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -60442,7 +66672,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -60511,6 +66742,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -60523,17 +66762,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -60541,6 +66803,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -60616,7 +66887,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -60971,7 +67243,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionBulkWithProrationPrice]. */ + class Builder internal constructor() { private var bulkWithProrationConfig: JsonField? = null private var cadence: JsonField? = null @@ -61374,7 +67647,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BulkWithProrationConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -61437,6 +67711,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -61457,6 +67739,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -61466,6 +67749,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -61473,9 +67765,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -61487,6 +67790,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -61519,6 +67831,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -61529,21 +67849,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { BULK_WITH_PRORATION, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { BULK_WITH_PRORATION, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { BULK_WITH_PRORATION -> Value.BULK_WITH_PRORATION else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { BULK_WITH_PRORATION -> Known.BULK_WITH_PRORATION @@ -61622,7 +67973,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -61690,6 +68042,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -61702,17 +68062,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -61720,6 +68103,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -61818,7 +68210,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -61887,6 +68280,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -61899,17 +68300,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -61917,6 +68341,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -61992,7 +68425,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() 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 6502c865..1d565b26 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 @@ -440,7 +440,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [SubscriptionCreateResponse]. */ + class Builder internal constructor() { private var id: JsonField? = null private var activePlanPhaseOrder: JsonField? = null @@ -1075,7 +1076,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AdjustmentInterval]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustment: JsonField? = null @@ -1332,6 +1334,10 @@ private constructor( @JvmStatic fun ofMaximum(maximum: MaximumAdjustment) = Adjustment(maximum = maximum) } + /** + * An interface that defines how to map each variant of [Adjustment] to a value of type + * [T]. + */ interface Visitor { fun visitAmountDiscount(amountDiscount: AmountDiscountAdjustment): T @@ -1344,12 +1350,22 @@ private constructor( fun visitMaximum(maximum: MaximumAdjustment): T + /** + * Maps an unknown variant of [Adjustment] to a value of type [T]. + * + * An instance of [Adjustment] can contain an unknown variant if it was deserialized + * from data that doesn't match any known variant. For example, if the SDK is on an + * older version than the API, then the API may respond with new variants that the + * SDK is unaware of. + * + * @throws OrbInvalidDataException in the default implementation. + */ fun unknown(json: JsonValue?): T { throw OrbInvalidDataException("Unknown Adjustment: $json") } } - class Deserializer : BaseDeserializer(Adjustment::class) { + internal class Deserializer : BaseDeserializer(Adjustment::class) { override fun ObjectCodec.deserialize(node: JsonNode): Adjustment { val json = JsonValue.fromJsonNode(node) @@ -1403,7 +1419,7 @@ private constructor( } } - class Serializer : BaseSerializer(Adjustment::class) { + internal class Serializer : BaseSerializer(Adjustment::class) { override fun serialize( value: Adjustment, @@ -1542,7 +1558,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AmountDiscountAdjustment]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustmentType: JsonField? = null @@ -1701,6 +1718,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -1711,21 +1736,53 @@ private constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { AMOUNT_DISCOUNT, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { AMOUNT_DISCOUNT, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { AMOUNT_DISCOUNT -> Value.AMOUNT_DISCOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { AMOUNT_DISCOUNT -> Known.AMOUNT_DISCOUNT @@ -1885,7 +1942,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [PercentageDiscountAdjustment]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustmentType: JsonField? = null @@ -2047,6 +2105,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -2057,21 +2123,53 @@ private constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { PERCENTAGE_DISCOUNT, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PERCENTAGE_DISCOUNT, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { PERCENTAGE_DISCOUNT -> Value.PERCENTAGE_DISCOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { PERCENTAGE_DISCOUNT -> Known.PERCENTAGE_DISCOUNT @@ -2230,7 +2328,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [UsageDiscountAdjustment]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustmentType: JsonField? = null @@ -2389,6 +2488,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -2399,21 +2506,53 @@ private constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { USAGE_DISCOUNT, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { USAGE_DISCOUNT, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { USAGE_DISCOUNT -> Value.USAGE_DISCOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { USAGE_DISCOUNT -> Known.USAGE_DISCOUNT @@ -2582,7 +2721,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MinimumAdjustment]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustmentType: JsonField? = null @@ -2749,6 +2889,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -2759,21 +2907,53 @@ private constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { MINIMUM, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { MINIMUM, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { MINIMUM -> Value.MINIMUM else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { MINIMUM -> Known.MINIMUM @@ -2932,7 +3112,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MaximumAdjustment]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustmentType: JsonField? = null @@ -3090,6 +3271,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -3100,21 +3289,53 @@ private constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { MAXIMUM, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { MAXIMUM, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { MAXIMUM -> Value.MAXIMUM else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { MAXIMUM -> Known.MAXIMUM @@ -3250,7 +3471,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleAnchorConfiguration]. */ + class Builder internal constructor() { private var day: JsonField? = null private var month: JsonField = JsonMissing.of() @@ -3474,6 +3696,10 @@ private constructor( @JvmStatic fun ofUsage(usage: UsageDiscountInterval) = DiscountInterval(usage = usage) } + /** + * An interface that defines how to map each variant of [DiscountInterval] to a value of + * type [T]. + */ interface Visitor { fun visitAmount(amount: AmountDiscountInterval): T @@ -3482,12 +3708,22 @@ private constructor( fun visitUsage(usage: UsageDiscountInterval): T + /** + * Maps an unknown variant of [DiscountInterval] to a value of type [T]. + * + * An instance of [DiscountInterval] can contain an unknown variant if it was + * deserialized from data that doesn't match any known variant. For example, if the SDK + * is on an older version than the API, then the API may respond with new variants that + * the SDK is unaware of. + * + * @throws OrbInvalidDataException in the default implementation. + */ fun unknown(json: JsonValue?): T { throw OrbInvalidDataException("Unknown DiscountInterval: $json") } } - class Deserializer : BaseDeserializer(DiscountInterval::class) { + internal class Deserializer : BaseDeserializer(DiscountInterval::class) { override fun ObjectCodec.deserialize(node: JsonNode): DiscountInterval { val json = JsonValue.fromJsonNode(node) @@ -3525,7 +3761,7 @@ private constructor( } } - class Serializer : BaseSerializer(DiscountInterval::class) { + internal class Serializer : BaseSerializer(DiscountInterval::class) { override fun serialize( value: DiscountInterval, @@ -3644,7 +3880,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AmountDiscountInterval]. */ + class Builder internal constructor() { private var amountDiscount: JsonField? = null private var appliesToPriceIds: JsonField>? = null @@ -3793,6 +4030,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -3802,21 +4047,52 @@ private constructor( @JvmStatic fun of(value: String) = DiscountType(JsonField.of(value)) } + /** An enum containing [DiscountType]'s known values. */ enum class Known { AMOUNT, } + /** + * An enum containing [DiscountType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DiscountType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { AMOUNT, + /** + * An enum member indicating that [DiscountType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { AMOUNT -> Value.AMOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { AMOUNT -> Known.AMOUNT @@ -3958,7 +4234,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [PercentageDiscountInterval]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var appliesToPriceIntervalIds: JsonField>? = null @@ -4113,6 +4390,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -4122,21 +4407,52 @@ private constructor( @JvmStatic fun of(value: String) = DiscountType(JsonField.of(value)) } + /** An enum containing [DiscountType]'s known values. */ enum class Known { PERCENTAGE, } + /** + * An enum containing [DiscountType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DiscountType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PERCENTAGE, + /** + * An enum member indicating that [DiscountType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { PERCENTAGE -> Value.PERCENTAGE else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { PERCENTAGE -> Known.PERCENTAGE @@ -4284,7 +4600,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [UsageDiscountInterval]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var appliesToPriceIntervalIds: JsonField>? = null @@ -4438,6 +4755,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -4447,21 +4772,52 @@ private constructor( @JvmStatic fun of(value: String) = DiscountType(JsonField.of(value)) } + /** An enum containing [DiscountType]'s known values. */ enum class Known { USAGE, } + /** + * An enum containing [DiscountType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DiscountType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { USAGE, + /** + * An enum member indicating that [DiscountType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { USAGE -> Value.USAGE else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { USAGE -> Known.USAGE @@ -4568,7 +4924,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [FixedFeeQuantitySchedule]. */ + class Builder internal constructor() { private var endDate: JsonField? = null private var priceId: JsonField? = null @@ -4750,7 +5107,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MaximumInterval]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var appliesToPriceIntervalIds: JsonField>? = null @@ -4933,7 +5291,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -5079,7 +5438,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MinimumInterval]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var appliesToPriceIntervalIds: JsonField>? = null @@ -5418,7 +5778,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [PriceInterval]. */ + class Builder internal constructor() { private var id: JsonField? = null private var billingCycleDay: JsonField? = null @@ -5969,6 +6330,36 @@ private constructor( fun price(maxGroupTieredPackage: Price.MaxGroupTieredPackagePrice) = price(Price.ofMaxGroupTieredPackage(maxGroupTieredPackage)) + /** + * The Price resource represents a price that can be billed on a subscription, resulting + * in a charge on an invoice in the form of an invoice line item. Prices take a quantity + * and determine an amount to bill. + * + * Orb supports a few different pricing models out of the box. Each of these models is + * serialized differently in a given Price object. The model_type field determines the + * key for the configuration object that is present. + * + * For more on the types of prices, see + * [the core concepts documentation](/core-concepts#plan-and-price) + */ + fun price(scalableMatrixWithUnitPricing: Price.ScalableMatrixWithUnitPricingPrice) = + price(Price.ofScalableMatrixWithUnitPricing(scalableMatrixWithUnitPricing)) + + /** + * The Price resource represents a price that can be billed on a subscription, resulting + * in a charge on an invoice in the form of an invoice line item. Prices take a quantity + * and determine an amount to bill. + * + * Orb supports a few different pricing models out of the box. Each of these models is + * serialized differently in a given Price object. The model_type field determines the + * key for the configuration object that is present. + * + * For more on the types of prices, see + * [the core concepts documentation](/core-concepts#plan-and-price) + */ + fun price(scalableMatrixWithTieredPricing: Price.ScalableMatrixWithTieredPricingPrice) = + price(Price.ofScalableMatrixWithTieredPricing(scalableMatrixWithTieredPricing)) + /** * The start date of the price interval. This is the date that Orb starts billing for * this price. @@ -6073,7 +6464,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [FixedFeeQuantityTransition]. */ + class Builder internal constructor() { private var effectiveDate: JsonField? = null private var priceId: JsonField? = null @@ -6229,7 +6621,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [RedeemedCoupon]. */ + class Builder internal constructor() { private var couponId: JsonField? = null private var endDate: JsonField? = null @@ -6312,6 +6705,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -6325,19 +6726,37 @@ private constructor( @JvmStatic fun of(value: String) = Status(JsonField.of(value)) } + /** An enum containing [Status]'s known values. */ enum class Known { ACTIVE, ENDED, UPCOMING, } + /** + * An enum containing [Status]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Status] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ACTIVE, ENDED, UPCOMING, + /** An enum member indicating that [Status] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { ACTIVE -> Value.ACTIVE @@ -6346,6 +6765,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { ACTIVE -> Known.ACTIVE @@ -6409,7 +6836,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TrialInfo]. */ + class Builder internal constructor() { private var endDate: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() 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 61c4803a..46601a0a 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 @@ -6,6 +6,7 @@ import com.fasterxml.jackson.annotation.JsonCreator import com.withorb.api.core.Enum import com.withorb.api.core.JsonField import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -27,7 +28,7 @@ import java.util.Optional * subscription has started and stopped on the same day). */ class SubscriptionFetchCostsParams -constructor( +private constructor( private val subscriptionId: String, private val currency: String?, private val timeframeEnd: OffsetDateTime?, @@ -35,7 +36,7 @@ constructor( private val viewMode: ViewMode?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun subscriptionId(): String = subscriptionId @@ -59,10 +60,9 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic - internal fun getQueryParams(): QueryParams { + override fun _queryParams(): QueryParams { val queryParams = QueryParams.builder() this.currency?.let { queryParams.put("currency", listOf(it.toString())) } this.timeframeEnd?.let { @@ -96,8 +96,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [SubscriptionFetchCostsParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var subscriptionId: String? = null private var currency: String? = null @@ -277,6 +278,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -288,17 +297,35 @@ constructor( @JvmStatic fun of(value: String) = ViewMode(JsonField.of(value)) } + /** An enum containing [ViewMode]'s known values. */ enum class Known { PERIODIC, CUMULATIVE, } + /** + * An enum containing [ViewMode]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ViewMode] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PERIODIC, CUMULATIVE, + /** An enum member indicating that [ViewMode] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { PERIODIC -> Value.PERIODIC @@ -306,6 +333,14 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { PERIODIC -> Known.PERIODIC 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 d3be7fa8..1a1c2966 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 @@ -54,7 +54,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [SubscriptionFetchCostsResponse]. */ + class Builder internal constructor() { private var data: JsonField>? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -190,7 +191,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Data]. */ + class Builder internal constructor() { private var perPriceCosts: JsonField>? = null private var subtotal: JsonField? = null @@ -376,7 +378,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [PerPriceCost]. */ + class Builder internal constructor() { private var price: JsonField? = null private var subtotal: JsonField? = null @@ -789,6 +792,37 @@ private constructor( fun price(maxGroupTieredPackage: Price.MaxGroupTieredPackagePrice) = price(Price.ofMaxGroupTieredPackage(maxGroupTieredPackage)) + /** + * The Price resource represents a price that can be billed on a subscription, + * resulting in a charge on an invoice in the form of an invoice line item. Prices + * take a quantity and determine an amount to bill. + * + * Orb supports a few different pricing models out of the box. Each of these models + * is serialized differently in a given Price object. The model_type field + * determines the key for the configuration object that is present. + * + * For more on the types of prices, see + * [the core concepts documentation](/core-concepts#plan-and-price) + */ + fun price(scalableMatrixWithUnitPricing: Price.ScalableMatrixWithUnitPricingPrice) = + price(Price.ofScalableMatrixWithUnitPricing(scalableMatrixWithUnitPricing)) + + /** + * The Price resource represents a price that can be billed on a subscription, + * resulting in a charge on an invoice in the form of an invoice line item. Prices + * take a quantity and determine an amount to bill. + * + * Orb supports a few different pricing models out of the box. Each of these models + * is serialized differently in a given Price object. The model_type field + * determines the key for the configuration object that is present. + * + * For more on the types of prices, see + * [the core concepts documentation](/core-concepts#plan-and-price) + */ + fun price( + scalableMatrixWithTieredPricing: Price.ScalableMatrixWithTieredPricingPrice + ) = price(Price.ofScalableMatrixWithTieredPricing(scalableMatrixWithTieredPricing)) + /** * 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 3e6a6ce6..b06df764 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 @@ -3,6 +3,7 @@ package com.withorb.api.models import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -13,11 +14,11 @@ import java.util.Objects * identifier. */ class SubscriptionFetchParams -constructor( +private constructor( private val subscriptionId: String, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun subscriptionId(): String = subscriptionId @@ -25,9 +26,9 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun getPathParam(index: Int): String { return when (index) { @@ -43,8 +44,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [SubscriptionFetchParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var subscriptionId: String? = null private var additionalHeaders: Headers.Builder = Headers.builder() 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 805a2741..267521bc 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 @@ -192,8 +192,7 @@ private constructor( } } - class AutoPager - constructor( + class AutoPager( private val firstPage: SubscriptionFetchSchedulePage, ) : Iterable { 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 5212bec0..f44351ed 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 @@ -195,8 +195,7 @@ private constructor( } } - class AutoPager - constructor( + class AutoPager( private val firstPage: SubscriptionFetchSchedulePageAsync, ) { 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 df91b277..aa331206 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 @@ -3,6 +3,7 @@ package com.withorb.api.models import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -17,7 +18,7 @@ import java.util.Optional * initial plan along with past and future plan changes. */ class SubscriptionFetchScheduleParams -constructor( +private constructor( private val subscriptionId: String, private val cursor: String?, private val limit: Long?, @@ -27,7 +28,7 @@ constructor( private val startDateLte: OffsetDateTime?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun subscriptionId(): String = subscriptionId @@ -52,10 +53,9 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic - internal fun getQueryParams(): QueryParams { + override fun _queryParams(): QueryParams { val queryParams = QueryParams.builder() this.cursor?.let { queryParams.put("cursor", listOf(it.toString())) } this.limit?.let { queryParams.put("limit", listOf(it.toString())) } @@ -101,8 +101,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [SubscriptionFetchScheduleParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var subscriptionId: String? = null private var cursor: String? = null diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionFetchScheduleResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionFetchScheduleResponse.kt index b5c386f4..cac40253 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionFetchScheduleResponse.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionFetchScheduleResponse.kt @@ -80,7 +80,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [SubscriptionFetchScheduleResponse]. */ + class Builder internal constructor() { private var createdAt: JsonField? = null private var endDate: JsonField? = null @@ -210,7 +211,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Plan]. */ + class Builder internal constructor() { private var id: JsonField? = null private var externalPlanId: JsonField? = null 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 5aa17853..f67d49ad 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 @@ -6,6 +6,7 @@ import com.fasterxml.jackson.annotation.JsonCreator import com.withorb.api.core.Enum import com.withorb.api.core.JsonField import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -192,7 +193,7 @@ import java.util.Optional * - `second_dimension_value`: `aws` */ class SubscriptionFetchUsageParams -constructor( +private constructor( private val subscriptionId: String, private val billableMetricId: String?, private val firstDimensionKey: String?, @@ -206,7 +207,7 @@ constructor( private val viewMode: ViewMode?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun subscriptionId(): String = subscriptionId @@ -248,10 +249,9 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic - internal fun getQueryParams(): QueryParams { + override fun _queryParams(): QueryParams { val queryParams = QueryParams.builder() this.billableMetricId?.let { queryParams.put("billable_metric_id", listOf(it.toString())) } this.firstDimensionKey?.let { @@ -299,8 +299,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [SubscriptionFetchUsageParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var subscriptionId: String? = null private var billableMetricId: String? = null @@ -545,6 +546,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -554,21 +563,49 @@ constructor( @JvmStatic fun of(value: String) = Granularity(JsonField.of(value)) } + /** An enum containing [Granularity]'s known values. */ enum class Known { DAY, } + /** + * An enum containing [Granularity]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Granularity] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, + /** + * An enum member indicating that [Granularity] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -601,6 +638,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -612,17 +657,35 @@ constructor( @JvmStatic fun of(value: String) = ViewMode(JsonField.of(value)) } + /** An enum containing [ViewMode]'s known values. */ enum class Known { PERIODIC, CUMULATIVE, } + /** + * An enum containing [ViewMode]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ViewMode] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PERIODIC, CUMULATIVE, + /** An enum member indicating that [ViewMode] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { PERIODIC -> Value.PERIODIC @@ -630,6 +693,14 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { PERIODIC -> Known.PERIODIC 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 ea696fe9..3110f38d 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 @@ -193,8 +193,7 @@ private constructor( } } - class AutoPager - constructor( + class AutoPager( private val firstPage: SubscriptionListPage, ) : Iterable { 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 7ec4b472..683bd73a 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 @@ -196,8 +196,7 @@ private constructor( } } - class AutoPager - constructor( + class AutoPager( private val firstPage: SubscriptionListPageAsync, ) { 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 22259679..649c4277 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 @@ -6,6 +6,7 @@ import com.fasterxml.jackson.annotation.JsonCreator import com.withorb.api.core.Enum import com.withorb.api.core.JsonField import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams import com.withorb.api.core.toImmutable @@ -26,7 +27,7 @@ import java.util.Optional * customer_id[] or external_customer_id[] query parameters. */ class SubscriptionListParams -constructor( +private constructor( private val createdAtGt: OffsetDateTime?, private val createdAtGte: OffsetDateTime?, private val createdAtLt: OffsetDateTime?, @@ -38,7 +39,7 @@ constructor( private val status: Status?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun createdAtGt(): Optional = Optional.ofNullable(createdAtGt) @@ -67,10 +68,9 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic - internal fun getQueryParams(): QueryParams { + override fun _queryParams(): QueryParams { val queryParams = QueryParams.builder() this.createdAtGt?.let { queryParams.put( @@ -114,8 +114,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [SubscriptionListParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var createdAtGt: OffsetDateTime? = null private var createdAtGte: OffsetDateTime? = null @@ -327,6 +328,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -340,19 +349,37 @@ constructor( @JvmStatic fun of(value: String) = Status(JsonField.of(value)) } + /** An enum containing [Status]'s known values. */ enum class Known { ACTIVE, ENDED, UPCOMING, } + /** + * An enum containing [Status]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Status] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ACTIVE, ENDED, UPCOMING, + /** An enum member indicating that [Status] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { ACTIVE -> Value.ACTIVE @@ -361,6 +388,14 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { ACTIVE -> Known.ACTIVE 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 6981337c..f31eba18 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 @@ -21,6 +21,7 @@ import com.withorb.api.core.JsonField import com.withorb.api.core.JsonMissing import com.withorb.api.core.JsonValue import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.getOrThrow import com.withorb.api.core.http.Headers @@ -99,12 +100,12 @@ import kotlin.jvm.optionals.getOrNull * `fixed_fee_quantity_transitions` property on a subscription’s serialized price intervals. */ class SubscriptionPriceIntervalsParams -constructor( +private constructor( private val subscriptionId: String, private val body: SubscriptionPriceIntervalsBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun subscriptionId(): String = subscriptionId @@ -138,11 +139,11 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getBody(): SubscriptionPriceIntervalsBody = body + @JvmSynthetic internal fun _body(): SubscriptionPriceIntervalsBody = body - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun getPathParam(index: Int): String { return when (index) { @@ -226,7 +227,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [SubscriptionPriceIntervalsBody]. */ + class Builder internal constructor() { private var add: JsonField>? = null private var addAdjustments: JsonField>? = null @@ -389,8 +391,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [SubscriptionPriceIntervalsParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var subscriptionId: String? = null private var body: SubscriptionPriceIntervalsBody.Builder = @@ -761,7 +764,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Add]. */ + class Builder internal constructor() { private var startDate: JsonField? = null private var allocationPrice: JsonField = JsonMissing.of() @@ -860,6 +864,20 @@ constructor( fun addDiscount(amountDiscountCreationParams: Discount.AmountDiscountCreationParams) = addDiscount(Discount.ofAmountDiscountCreationParams(amountDiscountCreationParams)) + /** A list of discounts to initialize on the price interval. */ + fun addAmountDiscountCreationParamsDiscount(amountDiscount: Double) = + addDiscount( + Discount.AmountDiscountCreationParams.builder() + .discountType( + SubscriptionPriceIntervalsParams.Add.Discount + .AmountDiscountCreationParams + .DiscountType + .AMOUNT + ) + .amountDiscount(amountDiscount) + .build() + ) + /** A list of discounts to initialize on the price interval. */ fun addDiscount( percentageDiscountCreationParams: Discount.PercentageDiscountCreationParams @@ -868,10 +886,38 @@ constructor( Discount.ofPercentageDiscountCreationParams(percentageDiscountCreationParams) ) + /** A list of discounts to initialize on the price interval. */ + fun addPercentageDiscountCreationParamsDiscount(percentageDiscount: Double) = + addDiscount( + Discount.PercentageDiscountCreationParams.builder() + .discountType( + SubscriptionPriceIntervalsParams.Add.Discount + .PercentageDiscountCreationParams + .DiscountType + .PERCENTAGE + ) + .percentageDiscount(percentageDiscount) + .build() + ) + /** A list of discounts to initialize on the price interval. */ fun addDiscount(usageDiscountCreationParams: Discount.UsageDiscountCreationParams) = addDiscount(Discount.ofUsageDiscountCreationParams(usageDiscountCreationParams)) + /** A list of discounts to initialize on the price interval. */ + fun addUsageDiscountCreationParamsDiscount(usageDiscount: Double) = + addDiscount( + Discount.UsageDiscountCreationParams.builder() + .discountType( + SubscriptionPriceIntervalsParams.Add.Discount + .UsageDiscountCreationParams + .DiscountType + .USAGE + ) + .usageDiscount(usageDiscount) + .build() + ) + /** * The end date of the price interval. This is the date that the price will stop billing * on the subscription. @@ -1138,6 +1184,28 @@ constructor( fun price(newFloatingGroupedTieredPackage: Price.NewFloatingGroupedTieredPackagePrice) = price(Price.ofNewFloatingGroupedTieredPackage(newFloatingGroupedTieredPackage)) + /** The definition of a new price to create and add to the subscription. */ + fun price( + newFloatingScalableMatrixWithUnitPricing: + Price.NewFloatingScalableMatrixWithUnitPricingPrice + ) = + price( + Price.ofNewFloatingScalableMatrixWithUnitPricing( + newFloatingScalableMatrixWithUnitPricing + ) + ) + + /** The definition of a new price to create and add to the subscription. */ + fun price( + newFloatingScalableMatrixWithTieredPricing: + Price.NewFloatingScalableMatrixWithTieredPricingPrice + ) = + price( + Price.ofNewFloatingScalableMatrixWithTieredPricing( + newFloatingScalableMatrixWithTieredPricing + ) + ) + /** The id of the price to add to the subscription. */ fun priceId(priceId: String?) = priceId(JsonField.ofNullable(priceId)) @@ -1267,18 +1335,32 @@ constructor( StartDate(billingCycleRelative = billingCycleRelative) } + /** + * An interface that defines how to map each variant of [StartDate] to a value of type + * [T]. + */ interface Visitor { fun visitDateTime(dateTime: OffsetDateTime): T fun visitBillingCycleRelative(billingCycleRelative: BillingCycleRelativeDate): T + /** + * Maps an unknown variant of [StartDate] to a value of type [T]. + * + * An instance of [StartDate] can contain an unknown variant if it was deserialized + * from data that doesn't match any known variant. For example, if the SDK is on an + * older version than the API, then the API may respond with new variants that the + * SDK is unaware of. + * + * @throws OrbInvalidDataException in the default implementation. + */ fun unknown(json: JsonValue?): T { throw OrbInvalidDataException("Unknown StartDate: $json") } } - class Deserializer : BaseDeserializer(StartDate::class) { + internal class Deserializer : BaseDeserializer(StartDate::class) { override fun ObjectCodec.deserialize(node: JsonNode): StartDate { val json = JsonValue.fromJsonNode(node) @@ -1294,7 +1376,7 @@ constructor( } } - class Serializer : BaseSerializer(StartDate::class) { + internal class Serializer : BaseSerializer(StartDate::class) { override fun serialize( value: StartDate, @@ -1397,7 +1479,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AllocationPrice]. */ + class Builder internal constructor() { private var amount: JsonField? = null private var cadence: JsonField? = null @@ -1496,6 +1579,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -1515,6 +1606,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ONE_TIME, MONTHLY, @@ -1524,6 +1616,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ONE_TIME, MONTHLY, @@ -1531,9 +1632,20 @@ constructor( SEMI_ANNUAL, ANNUAL, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { ONE_TIME -> Value.ONE_TIME @@ -1545,6 +1657,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { ONE_TIME -> Known.ONE_TIME @@ -1711,6 +1832,10 @@ constructor( ) = Discount(usageDiscountCreationParams = usageDiscountCreationParams) } + /** + * An interface that defines how to map each variant of [Discount] to a value of type + * [T]. + */ interface Visitor { fun visitAmountDiscountCreationParams( @@ -1725,12 +1850,22 @@ constructor( usageDiscountCreationParams: UsageDiscountCreationParams ): T + /** + * Maps an unknown variant of [Discount] to a value of type [T]. + * + * An instance of [Discount] can contain an unknown variant if it was deserialized + * from data that doesn't match any known variant. For example, if the SDK is on an + * older version than the API, then the API may respond with new variants that the + * SDK is unaware of. + * + * @throws OrbInvalidDataException in the default implementation. + */ fun unknown(json: JsonValue?): T { throw OrbInvalidDataException("Unknown Discount: $json") } } - class Deserializer : BaseDeserializer(Discount::class) { + internal class Deserializer : BaseDeserializer(Discount::class) { override fun ObjectCodec.deserialize(node: JsonNode): Discount { val json = JsonValue.fromJsonNode(node) @@ -1774,7 +1909,7 @@ constructor( } } - class Serializer : BaseSerializer(Discount::class) { + internal class Serializer : BaseSerializer(Discount::class) { override fun serialize( value: Discount, @@ -1845,7 +1980,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AmountDiscountCreationParams]. */ + class Builder internal constructor() { private var amountDiscount: JsonField? = null private var discountType: JsonField? = null @@ -1912,6 +2048,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -1922,21 +2066,53 @@ constructor( @JvmStatic fun of(value: String) = DiscountType(JsonField.of(value)) } + /** An enum containing [DiscountType]'s known values. */ enum class Known { AMOUNT, } + /** + * An enum containing [DiscountType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DiscountType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { AMOUNT, + /** + * An enum member indicating that [DiscountType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { AMOUNT -> Value.AMOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { AMOUNT -> Known.AMOUNT @@ -2034,7 +2210,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [PercentageDiscountCreationParams]. */ + class Builder internal constructor() { private var discountType: JsonField? = null private var percentageDiscount: JsonField? = null @@ -2108,6 +2285,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -2118,218 +2303,291 @@ constructor( @JvmStatic fun of(value: String) = DiscountType(JsonField.of(value)) } + /** An enum containing [DiscountType]'s known values. */ enum class Known { PERCENTAGE, } + /** + * An enum containing [DiscountType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DiscountType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PERCENTAGE, + /** + * An enum member indicating that [DiscountType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { PERCENTAGE -> Value.PERCENTAGE else -> Value._UNKNOWN } - fun known(): Known = - when (this) { - PERCENTAGE -> Known.PERCENTAGE - else -> throw OrbInvalidDataException("Unknown DiscountType: $value") - } - - fun asString(): String = _value().asStringOrThrow() - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is DiscountType && 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 PercentageDiscountCreationParams && discountType == other.discountType && percentageDiscount == other.percentageDiscount && additionalProperties == other.additionalProperties /* spotless:on */ - } - - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(discountType, percentageDiscount, additionalProperties) } - /* spotless:on */ - - override fun hashCode(): Int = hashCode - - override fun toString() = - "PercentageDiscountCreationParams{discountType=$discountType, percentageDiscount=$percentageDiscount, additionalProperties=$additionalProperties}" - } - - @NoAutoDetect - class UsageDiscountCreationParams - @JsonCreator - private constructor( - @JsonProperty("discount_type") - @ExcludeMissing - private val discountType: JsonField = JsonMissing.of(), - @JsonProperty("usage_discount") - @ExcludeMissing - private val usageDiscount: JsonField = JsonMissing.of(), - @JsonAnySetter - private val additionalProperties: Map = immutableEmptyMap(), - ) { - - fun discountType(): DiscountType = discountType.getRequired("discount_type") - - /** - * Only available if discount_type is `usage`. Number of usage units that this - * discount is for. - */ - fun usageDiscount(): Double = usageDiscount.getRequired("usage_discount") - - @JsonProperty("discount_type") - @ExcludeMissing - fun _discountType(): JsonField = discountType - - /** - * Only available if discount_type is `usage`. Number of usage units that this - * discount is for. - */ - @JsonProperty("usage_discount") - @ExcludeMissing - fun _usageDiscount(): JsonField = usageDiscount - - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = additionalProperties - - private var validated: Boolean = false - - fun validate(): UsageDiscountCreationParams = apply { - if (validated) { - return@apply - } - - discountType() - usageDiscount() - validated = true - } - - fun toBuilder() = Builder().from(this) - - companion object { - - @JvmStatic fun builder() = Builder() - } - - class Builder { - - private var discountType: JsonField? = null - private var usageDiscount: JsonField? = null - private var additionalProperties: MutableMap = mutableMapOf() - - @JvmSynthetic - internal fun from(usageDiscountCreationParams: UsageDiscountCreationParams) = - apply { - discountType = usageDiscountCreationParams.discountType - usageDiscount = usageDiscountCreationParams.usageDiscount - additionalProperties = - usageDiscountCreationParams.additionalProperties.toMutableMap() - } - - fun discountType(discountType: DiscountType) = - discountType(JsonField.of(discountType)) - - fun discountType(discountType: JsonField) = apply { - this.discountType = discountType - } - - /** - * Only available if discount_type is `usage`. Number of usage units that this - * discount is for. - */ - fun usageDiscount(usageDiscount: Double) = - usageDiscount(JsonField.of(usageDiscount)) - /** - * Only available if discount_type is `usage`. Number of usage units that this - * discount is for. + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. */ - fun usageDiscount(usageDiscount: JsonField) = apply { - this.usageDiscount = usageDiscount - } - - 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(): UsageDiscountCreationParams = - UsageDiscountCreationParams( - checkRequired("discountType", discountType), - checkRequired("usageDiscount", usageDiscount), - additionalProperties.toImmutable(), - ) - } - - class DiscountType - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { - - @com.fasterxml.jackson.annotation.JsonValue - fun _value(): JsonField = value - - companion object { - - @JvmField val USAGE = of("usage") - - @JvmStatic fun of(value: String) = DiscountType(JsonField.of(value)) - } - - enum class Known { - USAGE, - } - - enum class Value { - USAGE, - _UNKNOWN, - } - - fun value(): Value = - when (this) { - USAGE -> Value.USAGE - else -> Value._UNKNOWN - } - fun known(): Known = when (this) { - USAGE -> Known.USAGE + PERCENTAGE -> Known.PERCENTAGE + else -> throw OrbInvalidDataException("Unknown DiscountType: $value") + } + + fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is DiscountType && 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 PercentageDiscountCreationParams && discountType == other.discountType && percentageDiscount == other.percentageDiscount && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(discountType, percentageDiscount, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "PercentageDiscountCreationParams{discountType=$discountType, percentageDiscount=$percentageDiscount, additionalProperties=$additionalProperties}" + } + + @NoAutoDetect + class UsageDiscountCreationParams + @JsonCreator + private constructor( + @JsonProperty("discount_type") + @ExcludeMissing + private val discountType: JsonField = JsonMissing.of(), + @JsonProperty("usage_discount") + @ExcludeMissing + private val usageDiscount: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { + + fun discountType(): DiscountType = discountType.getRequired("discount_type") + + /** + * Only available if discount_type is `usage`. Number of usage units that this + * discount is for. + */ + fun usageDiscount(): Double = usageDiscount.getRequired("usage_discount") + + @JsonProperty("discount_type") + @ExcludeMissing + fun _discountType(): JsonField = discountType + + /** + * Only available if discount_type is `usage`. Number of usage units that this + * discount is for. + */ + @JsonProperty("usage_discount") + @ExcludeMissing + fun _usageDiscount(): JsonField = usageDiscount + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): UsageDiscountCreationParams = apply { + if (validated) { + return@apply + } + + discountType() + usageDiscount() + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + /** A builder for [UsageDiscountCreationParams]. */ + class Builder internal constructor() { + + private var discountType: JsonField? = null + private var usageDiscount: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(usageDiscountCreationParams: UsageDiscountCreationParams) = + apply { + discountType = usageDiscountCreationParams.discountType + usageDiscount = usageDiscountCreationParams.usageDiscount + additionalProperties = + usageDiscountCreationParams.additionalProperties.toMutableMap() + } + + fun discountType(discountType: DiscountType) = + discountType(JsonField.of(discountType)) + + fun discountType(discountType: JsonField) = apply { + this.discountType = discountType + } + + /** + * Only available if discount_type is `usage`. Number of usage units that this + * discount is for. + */ + fun usageDiscount(usageDiscount: Double) = + usageDiscount(JsonField.of(usageDiscount)) + + /** + * Only available if discount_type is `usage`. Number of usage units that this + * discount is for. + */ + fun usageDiscount(usageDiscount: JsonField) = apply { + this.usageDiscount = usageDiscount + } + + 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(): UsageDiscountCreationParams = + UsageDiscountCreationParams( + checkRequired("discountType", discountType), + checkRequired("usageDiscount", usageDiscount), + additionalProperties.toImmutable(), + ) + } + + class DiscountType + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue + fun _value(): JsonField = value + + companion object { + + @JvmField val USAGE = of("usage") + + @JvmStatic fun of(value: String) = DiscountType(JsonField.of(value)) + } + + /** An enum containing [DiscountType]'s known values. */ + enum class Known { + USAGE, + } + + /** + * An enum containing [DiscountType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DiscountType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + USAGE, + /** + * An enum member indicating that [DiscountType] was instantiated with an + * unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + USAGE -> Value.USAGE + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ + fun known(): Known = + when (this) { + USAGE -> Known.USAGE else -> throw OrbInvalidDataException("Unknown DiscountType: $value") } @@ -2452,18 +2710,32 @@ constructor( EndDate(billingCycleRelative = billingCycleRelative) } + /** + * An interface that defines how to map each variant of [EndDate] to a value of type + * [T]. + */ interface Visitor { fun visitDateTime(dateTime: OffsetDateTime): T fun visitBillingCycleRelative(billingCycleRelative: BillingCycleRelativeDate): T + /** + * Maps an unknown variant of [EndDate] to a value of type [T]. + * + * An instance of [EndDate] can contain an unknown variant if it was deserialized + * from data that doesn't match any known variant. For example, if the SDK is on an + * older version than the API, then the API may respond with new variants that the + * SDK is unaware of. + * + * @throws OrbInvalidDataException in the default implementation. + */ fun unknown(json: JsonValue?): T { throw OrbInvalidDataException("Unknown EndDate: $json") } } - class Deserializer : BaseDeserializer(EndDate::class) { + internal class Deserializer : BaseDeserializer(EndDate::class) { override fun ObjectCodec.deserialize(node: JsonNode): EndDate { val json = JsonValue.fromJsonNode(node) @@ -2479,7 +2751,7 @@ constructor( } } - class Serializer : BaseSerializer(EndDate::class) { + internal class Serializer : BaseSerializer(EndDate::class) { override fun serialize( value: EndDate, @@ -2548,7 +2820,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [FixedFeeQuantityTransition]. */ + class Builder internal constructor() { private var effectiveDate: JsonField? = null private var quantity: JsonField? = null @@ -2667,6 +2940,12 @@ constructor( private val newFloatingBulkWithProration: NewFloatingBulkWithProrationPrice? = null, private val newFloatingGroupedTieredPackage: NewFloatingGroupedTieredPackagePrice? = null, + private val newFloatingScalableMatrixWithUnitPricing: + NewFloatingScalableMatrixWithUnitPricingPrice? = + null, + private val newFloatingScalableMatrixWithTieredPricing: + NewFloatingScalableMatrixWithTieredPricingPrice? = + null, private val _json: JsonValue? = null, ) { @@ -2751,6 +3030,14 @@ constructor( fun newFloatingGroupedTieredPackage(): Optional = Optional.ofNullable(newFloatingGroupedTieredPackage) + fun newFloatingScalableMatrixWithUnitPricing(): + Optional = + Optional.ofNullable(newFloatingScalableMatrixWithUnitPricing) + + fun newFloatingScalableMatrixWithTieredPricing(): + Optional = + Optional.ofNullable(newFloatingScalableMatrixWithTieredPricing) + fun isNewFloatingUnit(): Boolean = newFloatingUnit != null fun isNewFloatingPackage(): Boolean = newFloatingPackage != null @@ -2810,6 +3097,12 @@ constructor( fun isNewFloatingGroupedTieredPackage(): Boolean = newFloatingGroupedTieredPackage != null + fun isNewFloatingScalableMatrixWithUnitPricing(): Boolean = + newFloatingScalableMatrixWithUnitPricing != null + + fun isNewFloatingScalableMatrixWithTieredPricing(): Boolean = + newFloatingScalableMatrixWithTieredPricing != null + fun asNewFloatingUnit(): NewFloatingUnitPrice = newFloatingUnit.getOrThrow("newFloatingUnit") @@ -2893,6 +3186,18 @@ constructor( fun asNewFloatingGroupedTieredPackage(): NewFloatingGroupedTieredPackagePrice = newFloatingGroupedTieredPackage.getOrThrow("newFloatingGroupedTieredPackage") + fun asNewFloatingScalableMatrixWithUnitPricing(): + NewFloatingScalableMatrixWithUnitPricingPrice = + newFloatingScalableMatrixWithUnitPricing.getOrThrow( + "newFloatingScalableMatrixWithUnitPricing" + ) + + fun asNewFloatingScalableMatrixWithTieredPricing(): + NewFloatingScalableMatrixWithTieredPricingPrice = + newFloatingScalableMatrixWithTieredPricing.getOrThrow( + "newFloatingScalableMatrixWithTieredPricing" + ) + fun _json(): Optional = Optional.ofNullable(_json) fun accept(visitor: Visitor): T { @@ -2960,6 +3265,14 @@ constructor( visitor.visitNewFloatingGroupedTieredPackage( newFloatingGroupedTieredPackage ) + newFloatingScalableMatrixWithUnitPricing != null -> + visitor.visitNewFloatingScalableMatrixWithUnitPricing( + newFloatingScalableMatrixWithUnitPricing + ) + newFloatingScalableMatrixWithTieredPricing != null -> + visitor.visitNewFloatingScalableMatrixWithTieredPricing( + newFloatingScalableMatrixWithTieredPricing + ) else -> visitor.unknown(_json) } } @@ -3119,6 +3432,20 @@ constructor( ) { newFloatingGroupedTieredPackage.validate() } + + override fun visitNewFloatingScalableMatrixWithUnitPricing( + newFloatingScalableMatrixWithUnitPricing: + NewFloatingScalableMatrixWithUnitPricingPrice + ) { + newFloatingScalableMatrixWithUnitPricing.validate() + } + + override fun visitNewFloatingScalableMatrixWithTieredPricing( + newFloatingScalableMatrixWithTieredPricing: + NewFloatingScalableMatrixWithTieredPricingPrice + ) { + newFloatingScalableMatrixWithTieredPricing.validate() + } } ) validated = true @@ -3129,10 +3456,10 @@ constructor( return true } - return /* spotless:off */ other is Price && newFloatingUnit == other.newFloatingUnit && newFloatingPackage == other.newFloatingPackage && newFloatingMatrix == other.newFloatingMatrix && newFloatingMatrixWithAllocation == other.newFloatingMatrixWithAllocation && newFloatingTiered == other.newFloatingTiered && newFloatingTieredBps == other.newFloatingTieredBps && newFloatingBps == other.newFloatingBps && newFloatingBulkBps == other.newFloatingBulkBps && newFloatingBulk == other.newFloatingBulk && newFloatingThresholdTotalAmount == other.newFloatingThresholdTotalAmount && newFloatingTieredPackage == other.newFloatingTieredPackage && newFloatingGroupedTiered == other.newFloatingGroupedTiered && newFloatingMaxGroupTieredPackage == other.newFloatingMaxGroupTieredPackage && newFloatingTieredWithMinimum == other.newFloatingTieredWithMinimum && newFloatingPackageWithAllocation == other.newFloatingPackageWithAllocation && newFloatingTieredPackageWithMinimum == other.newFloatingTieredPackageWithMinimum && newFloatingUnitWithPercent == other.newFloatingUnitWithPercent && newFloatingTieredWithProration == other.newFloatingTieredWithProration && newFloatingUnitWithProration == other.newFloatingUnitWithProration && newFloatingGroupedAllocation == other.newFloatingGroupedAllocation && newFloatingGroupedWithProratedMinimum == other.newFloatingGroupedWithProratedMinimum && newFloatingGroupedWithMeteredMinimum == other.newFloatingGroupedWithMeteredMinimum && newFloatingMatrixWithDisplayName == other.newFloatingMatrixWithDisplayName && newFloatingBulkWithProration == other.newFloatingBulkWithProration && newFloatingGroupedTieredPackage == other.newFloatingGroupedTieredPackage /* spotless:on */ + return /* spotless:off */ other is Price && newFloatingUnit == other.newFloatingUnit && newFloatingPackage == other.newFloatingPackage && newFloatingMatrix == other.newFloatingMatrix && newFloatingMatrixWithAllocation == other.newFloatingMatrixWithAllocation && newFloatingTiered == other.newFloatingTiered && newFloatingTieredBps == other.newFloatingTieredBps && newFloatingBps == other.newFloatingBps && newFloatingBulkBps == other.newFloatingBulkBps && newFloatingBulk == other.newFloatingBulk && newFloatingThresholdTotalAmount == other.newFloatingThresholdTotalAmount && newFloatingTieredPackage == other.newFloatingTieredPackage && newFloatingGroupedTiered == other.newFloatingGroupedTiered && newFloatingMaxGroupTieredPackage == other.newFloatingMaxGroupTieredPackage && newFloatingTieredWithMinimum == other.newFloatingTieredWithMinimum && newFloatingPackageWithAllocation == other.newFloatingPackageWithAllocation && newFloatingTieredPackageWithMinimum == other.newFloatingTieredPackageWithMinimum && newFloatingUnitWithPercent == other.newFloatingUnitWithPercent && newFloatingTieredWithProration == other.newFloatingTieredWithProration && newFloatingUnitWithProration == other.newFloatingUnitWithProration && newFloatingGroupedAllocation == other.newFloatingGroupedAllocation && newFloatingGroupedWithProratedMinimum == other.newFloatingGroupedWithProratedMinimum && newFloatingGroupedWithMeteredMinimum == other.newFloatingGroupedWithMeteredMinimum && newFloatingMatrixWithDisplayName == other.newFloatingMatrixWithDisplayName && newFloatingBulkWithProration == other.newFloatingBulkWithProration && newFloatingGroupedTieredPackage == other.newFloatingGroupedTieredPackage && newFloatingScalableMatrixWithUnitPricing == other.newFloatingScalableMatrixWithUnitPricing && newFloatingScalableMatrixWithTieredPricing == other.newFloatingScalableMatrixWithTieredPricing /* spotless:on */ } - override fun hashCode(): Int = /* spotless:off */ Objects.hash(newFloatingUnit, newFloatingPackage, newFloatingMatrix, newFloatingMatrixWithAllocation, newFloatingTiered, newFloatingTieredBps, newFloatingBps, newFloatingBulkBps, newFloatingBulk, newFloatingThresholdTotalAmount, newFloatingTieredPackage, newFloatingGroupedTiered, newFloatingMaxGroupTieredPackage, newFloatingTieredWithMinimum, newFloatingPackageWithAllocation, newFloatingTieredPackageWithMinimum, newFloatingUnitWithPercent, newFloatingTieredWithProration, newFloatingUnitWithProration, newFloatingGroupedAllocation, newFloatingGroupedWithProratedMinimum, newFloatingGroupedWithMeteredMinimum, newFloatingMatrixWithDisplayName, newFloatingBulkWithProration, newFloatingGroupedTieredPackage) /* spotless:on */ + override fun hashCode(): Int = /* spotless:off */ Objects.hash(newFloatingUnit, newFloatingPackage, newFloatingMatrix, newFloatingMatrixWithAllocation, newFloatingTiered, newFloatingTieredBps, newFloatingBps, newFloatingBulkBps, newFloatingBulk, newFloatingThresholdTotalAmount, newFloatingTieredPackage, newFloatingGroupedTiered, newFloatingMaxGroupTieredPackage, newFloatingTieredWithMinimum, newFloatingPackageWithAllocation, newFloatingTieredPackageWithMinimum, newFloatingUnitWithPercent, newFloatingTieredWithProration, newFloatingUnitWithProration, newFloatingGroupedAllocation, newFloatingGroupedWithProratedMinimum, newFloatingGroupedWithMeteredMinimum, newFloatingMatrixWithDisplayName, newFloatingBulkWithProration, newFloatingGroupedTieredPackage, newFloatingScalableMatrixWithUnitPricing, newFloatingScalableMatrixWithTieredPricing) /* spotless:on */ override fun toString(): String = when { @@ -3179,6 +3506,10 @@ constructor( "Price{newFloatingBulkWithProration=$newFloatingBulkWithProration}" newFloatingGroupedTieredPackage != null -> "Price{newFloatingGroupedTieredPackage=$newFloatingGroupedTieredPackage}" + newFloatingScalableMatrixWithUnitPricing != null -> + "Price{newFloatingScalableMatrixWithUnitPricing=$newFloatingScalableMatrixWithUnitPricing}" + newFloatingScalableMatrixWithTieredPricing != null -> + "Price{newFloatingScalableMatrixWithTieredPricing=$newFloatingScalableMatrixWithTieredPricing}" _json != null -> "Price{_unknown=$_json}" else -> throw IllegalStateException("Invalid Price") } @@ -3309,8 +3640,31 @@ constructor( fun ofNewFloatingGroupedTieredPackage( newFloatingGroupedTieredPackage: NewFloatingGroupedTieredPackagePrice ) = Price(newFloatingGroupedTieredPackage = newFloatingGroupedTieredPackage) + + @JvmStatic + fun ofNewFloatingScalableMatrixWithUnitPricing( + newFloatingScalableMatrixWithUnitPricing: + NewFloatingScalableMatrixWithUnitPricingPrice + ) = + Price( + newFloatingScalableMatrixWithUnitPricing = + newFloatingScalableMatrixWithUnitPricing + ) + + @JvmStatic + fun ofNewFloatingScalableMatrixWithTieredPricing( + newFloatingScalableMatrixWithTieredPricing: + NewFloatingScalableMatrixWithTieredPricingPrice + ) = + Price( + newFloatingScalableMatrixWithTieredPricing = + newFloatingScalableMatrixWithTieredPricing + ) } + /** + * An interface that defines how to map each variant of [Price] to a value of type [T]. + */ interface Visitor { fun visitNewFloatingUnit(newFloatingUnit: NewFloatingUnitPrice): T @@ -3398,12 +3752,32 @@ constructor( newFloatingGroupedTieredPackage: NewFloatingGroupedTieredPackagePrice ): T + fun visitNewFloatingScalableMatrixWithUnitPricing( + newFloatingScalableMatrixWithUnitPricing: + NewFloatingScalableMatrixWithUnitPricingPrice + ): T + + fun visitNewFloatingScalableMatrixWithTieredPricing( + newFloatingScalableMatrixWithTieredPricing: + NewFloatingScalableMatrixWithTieredPricingPrice + ): T + + /** + * Maps an unknown variant of [Price] to a value of type [T]. + * + * An instance of [Price] can contain an unknown variant if it was deserialized from + * data that doesn't match any known variant. For example, if the SDK is on an older + * version than the API, then the API may respond with new variants that the SDK is + * unaware of. + * + * @throws OrbInvalidDataException in the default implementation. + */ fun unknown(json: JsonValue?): T { throw OrbInvalidDataException("Unknown Price: $json") } } - class Deserializer : BaseDeserializer(Price::class) { + internal class Deserializer : BaseDeserializer(Price::class) { override fun ObjectCodec.deserialize(node: JsonNode): Price { val json = JsonValue.fromJsonNode(node) @@ -3674,13 +4048,43 @@ constructor( return Price(newFloatingGroupedTieredPackage = it, _json = json) } } + "scalable_matrix_with_unit_pricing" -> { + tryDeserialize( + node, + jacksonTypeRef() + ) { + it.validate() + } + ?.let { + return Price( + newFloatingScalableMatrixWithUnitPricing = it, + _json = json + ) + } + } + "scalable_matrix_with_tiered_pricing" -> { + tryDeserialize( + node, + jacksonTypeRef< + NewFloatingScalableMatrixWithTieredPricingPrice + >() + ) { + it.validate() + } + ?.let { + return Price( + newFloatingScalableMatrixWithTieredPricing = it, + _json = json + ) + } + } } return Price(_json = json) } } - class Serializer : BaseSerializer(Price::class) { + internal class Serializer : BaseSerializer(Price::class) { override fun serialize( value: Price, @@ -3737,6 +4141,10 @@ constructor( generator.writeObject(value.newFloatingBulkWithProration) value.newFloatingGroupedTieredPackage != null -> generator.writeObject(value.newFloatingGroupedTieredPackage) + value.newFloatingScalableMatrixWithUnitPricing != null -> + generator.writeObject(value.newFloatingScalableMatrixWithUnitPricing) + value.newFloatingScalableMatrixWithTieredPricing != null -> + generator.writeObject(value.newFloatingScalableMatrixWithTieredPricing) value._json != null -> generator.writeObject(value._json) else -> throw IllegalStateException("Invalid Price") } @@ -3999,7 +4407,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewFloatingUnitPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var currency: JsonField? = null @@ -4335,6 +4744,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -4355,6 +4772,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -4364,6 +4782,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -4371,9 +4798,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -4385,6 +4823,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -4417,6 +4864,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -4427,21 +4882,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { UNIT, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { UNIT, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { UNIT -> Value.UNIT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { UNIT -> Known.UNIT @@ -4504,7 +4990,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [UnitConfig]. */ + class Builder internal constructor() { private var unitAmount: JsonField? = null private var additionalProperties: MutableMap = @@ -4628,7 +5115,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -4696,6 +5184,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -4708,17 +5204,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -4726,6 +5245,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -4824,7 +5352,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -4893,6 +5422,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -4905,17 +5442,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -4923,6 +5483,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -4998,7 +5567,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -5324,7 +5894,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewFloatingPackagePrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var currency: JsonField? = null @@ -5662,6 +6233,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -5682,6 +6261,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -5691,6 +6271,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -5698,9 +6287,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -5712,6 +6312,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -5744,6 +6353,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -5754,21 +6371,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { PACKAGE, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PACKAGE, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { PACKAGE -> Value.PACKAGE else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { PACKAGE -> Known.PACKAGE @@ -5849,7 +6497,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [PackageConfig]. */ + class Builder internal constructor() { private var packageAmount: JsonField? = null private var packageSize: JsonField? = null @@ -5991,7 +6640,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -6059,6 +6709,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -6071,17 +6729,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -6089,6 +6770,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -6187,7 +6877,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -6256,6 +6947,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -6268,17 +6967,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -6286,6 +7008,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -6361,7 +7092,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -6687,7 +7419,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewFloatingMatrixPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var currency: JsonField? = null @@ -7024,6 +7757,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -7044,6 +7785,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -7053,6 +7795,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -7060,9 +7811,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -7074,6 +7836,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -7173,7 +7944,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MatrixConfig]. */ + class Builder internal constructor() { private var defaultUnitAmount: JsonField? = null private var dimensions: JsonField>? = null @@ -7346,7 +8118,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MatrixValue]. */ + class Builder internal constructor() { private var dimensionValues: JsonField>? = null private var unitAmount: JsonField? = null @@ -7480,6 +8253,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -7490,21 +8271,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { MATRIX, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { MATRIX, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { MATRIX -> Value.MATRIX else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { MATRIX -> Known.MATRIX @@ -7583,7 +8395,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -7651,6 +8464,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -7663,17 +8484,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -7681,6 +8525,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -7779,7 +8632,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -7848,6 +8702,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -7860,17 +8722,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -7878,6 +8763,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -7953,7 +8847,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -8282,7 +9177,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewFloatingMatrixWithAllocationPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var currency: JsonField? = null @@ -8625,6 +9521,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -8645,6 +9549,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -8654,6 +9559,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -8661,9 +9575,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -8675,6 +9600,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -8786,7 +9720,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MatrixWithAllocationConfig]. */ + class Builder internal constructor() { private var allocation: JsonField? = null private var defaultUnitAmount: JsonField? = null @@ -8976,7 +9911,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MatrixValue]. */ + class Builder internal constructor() { private var dimensionValues: JsonField>? = null private var unitAmount: JsonField? = null @@ -9110,6 +10046,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -9120,21 +10064,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { MATRIX_WITH_ALLOCATION, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { MATRIX_WITH_ALLOCATION, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { MATRIX_WITH_ALLOCATION -> Value.MATRIX_WITH_ALLOCATION else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { MATRIX_WITH_ALLOCATION -> Known.MATRIX_WITH_ALLOCATION @@ -9213,7 +10188,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -9281,6 +10257,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -9293,17 +10277,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -9311,6 +10318,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -9409,7 +10425,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -9478,6 +10495,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -9490,17 +10515,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -9508,6 +10556,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -9583,7 +10640,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -9909,7 +10967,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewFloatingTieredPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var currency: JsonField? = null @@ -10246,6 +11305,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -10266,6 +11333,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -10275,6 +11343,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -10282,9 +11359,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -10296,6 +11384,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -10328,6 +11425,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -10338,21 +11443,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { TIERED, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { TIERED, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { TIERED -> Value.TIERED else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { TIERED -> Known.TIERED @@ -10415,7 +11551,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TieredConfig]. */ + class Builder internal constructor() { private var tiers: JsonField>? = null private var additionalProperties: MutableMap = @@ -10555,7 +11692,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Tier]. */ + class Builder internal constructor() { private var firstUnit: JsonField? = null private var unitAmount: JsonField? = null @@ -10743,7 +11881,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -10811,6 +11950,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -10823,17 +11970,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -10841,6 +12011,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -10939,7 +12118,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -11008,6 +12188,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -11020,17 +12208,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -11038,6 +12249,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -11113,7 +12333,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -11440,7 +12661,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewFloatingTieredBpsPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var currency: JsonField? = null @@ -11779,6 +13001,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -11799,6 +13029,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -11808,6 +13039,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -11815,9 +13055,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -11829,6 +13080,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -11861,6 +13121,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -11871,21 +13139,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { TIERED_BPS, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { TIERED_BPS, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { TIERED_BPS -> Value.TIERED_BPS else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { TIERED_BPS -> Known.TIERED_BPS @@ -11954,7 +13253,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TieredBpsConfig]. */ + class Builder internal constructor() { private var tiers: JsonField>? = null private var additionalProperties: MutableMap = @@ -12105,7 +13405,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Tier]. */ + class Builder internal constructor() { private var bps: JsonField? = null private var minimumAmount: JsonField? = null @@ -12289,7 +13590,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -12357,6 +13659,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -12369,17 +13679,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -12387,6 +13720,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -12485,7 +13827,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -12554,6 +13897,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -12566,17 +13917,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -12584,6 +13958,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -12659,7 +14042,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -12985,7 +14369,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewFloatingBpsPrice]. */ + class Builder internal constructor() { private var bpsConfig: JsonField? = null private var cadence: JsonField? = null @@ -13366,7 +14751,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BpsConfig]. */ + class Builder internal constructor() { private var bps: JsonField? = null private var perUnitMaximum: JsonField = JsonMissing.of() @@ -13454,6 +14840,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -13474,6 +14868,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -13483,6 +14878,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -13490,9 +14894,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -13504,6 +14919,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -13536,6 +14960,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -13546,21 +14978,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { BPS, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { BPS, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { BPS -> Value.BPS else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { BPS -> Known.BPS @@ -13639,7 +15102,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -13707,6 +15171,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -13719,17 +15191,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -13737,6 +15232,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -13835,7 +15339,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -13904,6 +15409,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -13916,17 +15429,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -13934,6 +15470,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -14009,7 +15554,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -14335,7 +15881,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewFloatingBulkBpsPrice]. */ + class Builder internal constructor() { private var bulkBpsConfig: JsonField? = null private var cadence: JsonField? = null @@ -14713,7 +16260,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BulkBpsConfig]. */ + class Builder internal constructor() { private var tiers: JsonField>? = null private var additionalProperties: MutableMap = @@ -14851,7 +16399,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Tier]. */ + class Builder internal constructor() { private var bps: JsonField? = null private var maximumAmount: JsonField = JsonMissing.of() @@ -14973,6 +16522,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -14993,6 +16550,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -15002,6 +16560,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -15009,9 +16576,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -15023,6 +16601,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -15055,6 +16642,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -15065,21 +16660,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { BULK_BPS, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { BULK_BPS, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { BULK_BPS -> Value.BULK_BPS else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { BULK_BPS -> Known.BULK_BPS @@ -15158,7 +16784,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -15226,6 +16853,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -15238,17 +16873,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -15256,6 +16914,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -15354,7 +17021,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -15423,6 +17091,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -15435,17 +17111,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -15453,6 +17152,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -15528,7 +17236,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -15854,7 +17563,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewFloatingBulkPrice]. */ + class Builder internal constructor() { private var bulkConfig: JsonField? = null private var cadence: JsonField? = null @@ -16224,7 +17934,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BulkConfig]. */ + class Builder internal constructor() { private var tiers: JsonField>? = null private var additionalProperties: MutableMap = @@ -16342,7 +18053,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Tier]. */ + class Builder internal constructor() { private var unitAmount: JsonField? = null private var maximumUnits: JsonField = JsonMissing.of() @@ -16458,6 +18170,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -16478,6 +18198,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -16487,6 +18208,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -16494,9 +18224,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -16508,6 +18249,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -16540,6 +18290,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -16550,21 +18308,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { BULK, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { BULK, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { BULK -> Value.BULK else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { BULK -> Known.BULK @@ -16643,7 +18432,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -16711,6 +18501,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -16723,17 +18521,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -16741,6 +18562,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -16839,7 +18669,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -16908,6 +18739,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -16920,17 +18759,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -16938,6 +18800,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -17013,7 +18884,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -17342,7 +19214,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewFloatingThresholdTotalAmountPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var currency: JsonField? = null @@ -17685,6 +19558,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -17705,6 +19586,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -17714,6 +19596,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -17721,9 +19612,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -17735,6 +19637,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -17767,6 +19678,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -17777,21 +19696,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { THRESHOLD_TOTAL_AMOUNT, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { THRESHOLD_TOTAL_AMOUNT, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { THRESHOLD_TOTAL_AMOUNT -> Value.THRESHOLD_TOTAL_AMOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { THRESHOLD_TOTAL_AMOUNT -> Known.THRESHOLD_TOTAL_AMOUNT @@ -17842,7 +19792,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [ThresholdTotalAmountConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -17955,7 +19906,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -18023,6 +19975,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -18035,17 +19995,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -18053,6 +20036,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -18151,7 +20143,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -18220,6 +20213,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -18232,17 +20233,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -18250,6 +20274,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -18325,7 +20358,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -18652,7 +20686,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewFloatingTieredPackagePrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var currency: JsonField? = null @@ -18993,6 +21028,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -19013,6 +21056,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -19022,6 +21066,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -19029,9 +21082,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -19043,6 +21107,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -19075,6 +21148,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -19085,21 +21166,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { TIERED_PACKAGE, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { TIERED_PACKAGE, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { TIERED_PACKAGE -> Value.TIERED_PACKAGE else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { TIERED_PACKAGE -> Known.TIERED_PACKAGE @@ -19150,7 +21262,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TieredPackageConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -19262,7 +21375,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -19330,6 +21444,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -19342,17 +21464,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -19360,6 +21505,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -19458,7 +21612,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -19527,6 +21682,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -19539,17 +21702,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -19557,6 +21743,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -19632,7 +21827,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -19959,7 +22155,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewFloatingGroupedTieredPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var currency: JsonField? = null @@ -20300,6 +22497,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -20320,6 +22525,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -20329,6 +22535,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -20336,9 +22551,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -20350,6 +22576,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -20405,7 +22640,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [GroupedTieredConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -20466,6 +22702,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -20476,21 +22720,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { GROUPED_TIERED, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { GROUPED_TIERED, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { GROUPED_TIERED -> Value.GROUPED_TIERED else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { GROUPED_TIERED -> Known.GROUPED_TIERED @@ -20569,7 +22844,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -20637,6 +22913,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -20649,17 +22933,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -20667,6 +22974,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -20765,7 +23081,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -20834,6 +23151,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -20846,17 +23171,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -20864,6 +23212,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -20939,7 +23296,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -21268,7 +23626,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewFloatingMaxGroupTieredPackagePrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var currency: JsonField? = null @@ -21618,6 +23977,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -21638,6 +24005,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -21647,6 +24015,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -21654,9 +24031,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -21668,6 +24056,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -21723,7 +24120,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MaxGroupTieredPackageConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -21786,6 +24184,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -21796,21 +24202,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { MAX_GROUP_TIERED_PACKAGE, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { MAX_GROUP_TIERED_PACKAGE, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { MAX_GROUP_TIERED_PACKAGE -> Value.MAX_GROUP_TIERED_PACKAGE else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { MAX_GROUP_TIERED_PACKAGE -> Known.MAX_GROUP_TIERED_PACKAGE @@ -21889,7 +24326,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -21957,6 +24395,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -21969,17 +24415,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -21987,6 +24456,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -22085,7 +24563,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -22154,6 +24633,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -22166,17 +24653,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -22184,6 +24694,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -22259,7 +24778,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -22588,7 +25108,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewFloatingTieredWithMinimumPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var currency: JsonField? = null @@ -22929,6 +25450,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -22949,6 +25478,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -22958,6 +25488,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -22965,9 +25504,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -22979,6 +25529,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -23011,6 +25570,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -23021,21 +25588,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { TIERED_WITH_MINIMUM, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { TIERED_WITH_MINIMUM, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { TIERED_WITH_MINIMUM -> Value.TIERED_WITH_MINIMUM else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { TIERED_WITH_MINIMUM -> Known.TIERED_WITH_MINIMUM @@ -23086,7 +25684,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TieredWithMinimumConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -23199,7 +25798,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -23267,6 +25867,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -23279,17 +25887,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -23297,6 +25928,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -23395,7 +26035,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -23464,6 +26105,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -23476,17 +26125,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -23494,6 +26166,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -23569,7 +26250,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -23898,7 +26580,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewFloatingPackageWithAllocationPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var currency: JsonField? = null @@ -24248,6 +26931,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -24268,6 +26959,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -24277,6 +26969,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -24284,9 +26985,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -24298,6 +27010,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -24330,6 +27051,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -24340,21 +27069,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { PACKAGE_WITH_ALLOCATION, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PACKAGE_WITH_ALLOCATION, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { PACKAGE_WITH_ALLOCATION -> Value.PACKAGE_WITH_ALLOCATION else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { PACKAGE_WITH_ALLOCATION -> Known.PACKAGE_WITH_ALLOCATION @@ -24405,7 +27165,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [PackageWithAllocationConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -24519,7 +27280,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -24587,6 +27349,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -24599,17 +27369,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -24617,6 +27410,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -24715,7 +27517,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -24784,6 +27587,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -24796,17 +27607,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -24814,6 +27648,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -24889,7 +27732,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -25219,7 +28063,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewFloatingTieredPackageWithMinimumPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var currency: JsonField? = null @@ -25572,6 +28417,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -25592,6 +28445,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -25601,6 +28455,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -25608,9 +28471,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -25622,6 +28496,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -25654,6 +28537,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -25665,21 +28556,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { TIERED_PACKAGE_WITH_MINIMUM, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { TIERED_PACKAGE_WITH_MINIMUM, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { TIERED_PACKAGE_WITH_MINIMUM -> Value.TIERED_PACKAGE_WITH_MINIMUM else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { TIERED_PACKAGE_WITH_MINIMUM -> Known.TIERED_PACKAGE_WITH_MINIMUM @@ -25730,7 +28652,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TieredPackageWithMinimumConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -25844,7 +28767,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -25912,6 +28836,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -25924,17 +28856,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -25942,6 +28897,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -26040,7 +29004,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -26109,6 +29074,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -26121,17 +29094,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -26139,6 +29135,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -26214,7 +29219,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -26543,7 +29549,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewFloatingUnitWithPercentPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var currency: JsonField? = null @@ -26884,6 +29891,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -26904,6 +29919,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -26913,6 +29929,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -26920,9 +29945,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -26934,6 +29970,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -26966,6 +30011,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -26976,21 +30029,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { UNIT_WITH_PERCENT, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { UNIT_WITH_PERCENT, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { UNIT_WITH_PERCENT -> Value.UNIT_WITH_PERCENT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { UNIT_WITH_PERCENT -> Known.UNIT_WITH_PERCENT @@ -27041,7 +30125,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [UnitWithPercentConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -27153,7 +30238,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -27221,6 +30307,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -27233,17 +30327,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -27251,6 +30368,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -27349,7 +30475,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -27418,6 +30545,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -27430,17 +30565,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -27448,6 +30606,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -27523,7 +30690,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -27852,7 +31020,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewFloatingTieredWithProrationPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var currency: JsonField? = null @@ -28195,6 +31364,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -28215,6 +31392,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -28224,6 +31402,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -28231,9 +31418,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -28245,6 +31443,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -28277,6 +31484,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -28287,21 +31502,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { TIERED_WITH_PRORATION, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { TIERED_WITH_PRORATION, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { TIERED_WITH_PRORATION -> Value.TIERED_WITH_PRORATION else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { TIERED_WITH_PRORATION -> Known.TIERED_WITH_PRORATION @@ -28352,7 +31598,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TieredWithProrationConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -28465,7 +31712,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -28533,6 +31781,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -28545,17 +31801,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -28563,6 +31842,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -28661,7 +31949,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -28730,6 +32019,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -28742,17 +32039,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -28760,6 +32080,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -28835,7 +32164,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -29164,7 +32494,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewFloatingUnitWithProrationPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var currency: JsonField? = null @@ -29505,6 +32836,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -29525,6 +32864,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -29534,6 +32874,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -29541,9 +32890,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -29555,6 +32915,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -29587,6 +32956,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -29597,21 +32974,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { UNIT_WITH_PRORATION, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { UNIT_WITH_PRORATION, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { UNIT_WITH_PRORATION -> Value.UNIT_WITH_PRORATION else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { UNIT_WITH_PRORATION -> Known.UNIT_WITH_PRORATION @@ -29662,7 +33070,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [UnitWithProrationConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -29775,7 +33184,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -29843,6 +33253,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -29855,17 +33273,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -29873,6 +33314,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -29971,7 +33421,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -30040,6 +33491,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -30052,17 +33511,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -30070,6 +33552,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -30145,7 +33636,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -30474,7 +33966,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewFloatingGroupedAllocationPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var currency: JsonField? = null @@ -30815,6 +34308,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -30835,6 +34336,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -30844,6 +34346,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -30851,9 +34362,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -30865,6 +34387,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -30920,7 +34451,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [GroupedAllocationConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -30982,6 +34514,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -30992,21 +34532,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { GROUPED_ALLOCATION, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { GROUPED_ALLOCATION, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { GROUPED_ALLOCATION -> Value.GROUPED_ALLOCATION else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { GROUPED_ALLOCATION -> Known.GROUPED_ALLOCATION @@ -31085,7 +34656,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -31153,6 +34725,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -31165,17 +34745,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -31183,6 +34786,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -31281,7 +34893,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -31350,6 +34963,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -31362,17 +34983,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -31380,6 +35024,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -31455,7 +35108,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -31787,7 +35441,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewFloatingGroupedWithProratedMinimumPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var currency: JsonField? = null @@ -32146,6 +35801,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -32166,6 +35829,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -32175,6 +35839,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -32182,9 +35855,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -32196,6 +35880,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -32251,7 +35944,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [GroupedWithProratedMinimumConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -32286,8 +35980,2985 @@ constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): GroupedWithProratedMinimumConfig = - GroupedWithProratedMinimumConfig(additionalProperties.toImmutable()) + fun build(): GroupedWithProratedMinimumConfig = + GroupedWithProratedMinimumConfig(additionalProperties.toImmutable()) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is GroupedWithProratedMinimumConfig && 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() = + "GroupedWithProratedMinimumConfig{additionalProperties=$additionalProperties}" + } + + class ModelType + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue + fun _value(): JsonField = value + + companion object { + + @JvmField + val GROUPED_WITH_PRORATED_MINIMUM = of("grouped_with_prorated_minimum") + + @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) + } + + /** An enum containing [ModelType]'s known values. */ + enum class Known { + GROUPED_WITH_PRORATED_MINIMUM, + } + + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + GROUPED_WITH_PRORATED_MINIMUM, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + GROUPED_WITH_PRORATED_MINIMUM -> Value.GROUPED_WITH_PRORATED_MINIMUM + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ + fun known(): Known = + when (this) { + GROUPED_WITH_PRORATED_MINIMUM -> Known.GROUPED_WITH_PRORATED_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() + } + + /** + * 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() + } + + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { + + 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(), + ) + } + + /** The unit of billing period duration. */ + class DurationUnit + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ + @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)) + } + + /** An enum containing [DurationUnit]'s known values. */ + enum class Known { + DAY, + MONTH, + } + + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + DAY, + MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + DAY -> Value.DAY + MONTH -> Value.MONTH + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ + 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() + } + + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { + + 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(), + ) + } + + /** The unit of billing period duration. */ + class DurationUnit + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ + @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)) + } + + /** An enum containing [DurationUnit]'s known values. */ + enum class Known { + DAY, + MONTH, + } + + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + DAY, + MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + DAY -> Value.DAY + MONTH -> Value.MONTH + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ + 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() + } + + /** A builder for [Metadata]. */ + class Builder internal constructor() { + + 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 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, groupedWithProratedMinimumConfig, 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}" + } + + @NoAutoDetect + class NewFloatingGroupedWithMeteredMinimumPrice + @JsonCreator + private constructor( + @JsonProperty("cadence") + @ExcludeMissing + private val cadence: JsonField = JsonMissing.of(), + @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("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 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 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_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("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(): NewFloatingGroupedWithMeteredMinimumPrice = apply { + if (validated) { + return@apply + } + + cadence() + currency() + groupedWithMeteredMinimumConfig().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() + } + + /** A builder for [NewFloatingGroupedWithMeteredMinimumPrice]. */ + class Builder internal constructor() { + + private var cadence: JsonField? = null + private var currency: JsonField? = null + private var groupedWithMeteredMinimumConfig: + 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( + newFloatingGroupedWithMeteredMinimumPrice: + NewFloatingGroupedWithMeteredMinimumPrice + ) = 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 + billingCycleConfiguration = + newFloatingGroupedWithMeteredMinimumPrice.billingCycleConfiguration + conversionRate = newFloatingGroupedWithMeteredMinimumPrice.conversionRate + externalPriceId = newFloatingGroupedWithMeteredMinimumPrice.externalPriceId + fixedPriceQuantity = + newFloatingGroupedWithMeteredMinimumPrice.fixedPriceQuantity + invoiceGroupingKey = + newFloatingGroupedWithMeteredMinimumPrice.invoiceGroupingKey + invoicingCycleConfiguration = + newFloatingGroupedWithMeteredMinimumPrice.invoicingCycleConfiguration + metadata = newFloatingGroupedWithMeteredMinimumPrice.metadata + additionalProperties = + newFloatingGroupedWithMeteredMinimumPrice.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 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 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(): NewFloatingGroupedWithMeteredMinimumPrice = + NewFloatingGroupedWithMeteredMinimumPrice( + checkRequired("cadence", cadence), + checkRequired("currency", currency), + checkRequired( + "groupedWithMeteredMinimumConfig", + groupedWithMeteredMinimumConfig + ), + checkRequired("itemId", itemId), + checkRequired("modelType", modelType), + checkRequired("name", name), + billableMetricId, + billedInAdvance, + billingCycleConfiguration, + conversionRate, + externalPriceId, + fixedPriceQuantity, + invoiceGroupingKey, + invoicingCycleConfiguration, + metadata, + additionalProperties.toImmutable(), + ) + } + + /** The cadence to bill for this price on. */ + class Cadence + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ + @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)) + } + + /** An enum containing [Cadence]'s known values. */ + enum class Known { + ANNUAL, + SEMI_ANNUAL, + MONTHLY, + QUARTERLY, + ONE_TIME, + CUSTOM, + } + + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + ANNUAL, + SEMI_ANNUAL, + MONTHLY, + QUARTERLY, + ONE_TIME, + CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ + 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 + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ + 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 GroupedWithMeteredMinimumConfig + @JsonCreator + private constructor( + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): GroupedWithMeteredMinimumConfig = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + /** A builder for [GroupedWithMeteredMinimumConfig]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from( + groupedWithMeteredMinimumConfig: GroupedWithMeteredMinimumConfig + ) = apply { + additionalProperties = + groupedWithMeteredMinimumConfig.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(): GroupedWithMeteredMinimumConfig = + GroupedWithMeteredMinimumConfig(additionalProperties.toImmutable()) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is GroupedWithMeteredMinimumConfig && 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() = + "GroupedWithMeteredMinimumConfig{additionalProperties=$additionalProperties}" + } + + class ModelType + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue + fun _value(): JsonField = value + + companion object { + + @JvmField + val GROUPED_WITH_METERED_MINIMUM = of("grouped_with_metered_minimum") + + @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) + } + + /** An enum containing [ModelType]'s known values. */ + enum class Known { + GROUPED_WITH_METERED_MINIMUM, + } + + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + GROUPED_WITH_METERED_MINIMUM, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + GROUPED_WITH_METERED_MINIMUM -> Value.GROUPED_WITH_METERED_MINIMUM + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ + fun known(): Known = + when (this) { + GROUPED_WITH_METERED_MINIMUM -> Known.GROUPED_WITH_METERED_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() + } + + /** + * 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() + } + + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { + + 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(), + ) + } + + /** The unit of billing period duration. */ + class DurationUnit + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ + @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)) + } + + /** An enum containing [DurationUnit]'s known values. */ + enum class Known { + DAY, + MONTH, + } + + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + DAY, + MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + DAY -> Value.DAY + MONTH -> Value.MONTH + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ + 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() + } + + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { + + 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(), + ) + } + + /** The unit of billing period duration. */ + class DurationUnit + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ + @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)) + } + + /** An enum containing [DurationUnit]'s known values. */ + enum class Known { + DAY, + MONTH, + } + + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + DAY, + MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + DAY -> Value.DAY + MONTH -> Value.MONTH + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ + 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() + } + + /** A builder for [Metadata]. */ + class Builder internal constructor() { + + 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 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, groupedWithMeteredMinimumConfig, itemId, 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}" + } + + @NoAutoDetect + class NewFloatingMatrixWithDisplayNamePrice + @JsonCreator + private constructor( + @JsonProperty("cadence") + @ExcludeMissing + private val cadence: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + private val currency: 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(), + @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") + + /** 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. */ + 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 + + /** 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 + + /** 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(): NewFloatingMatrixWithDisplayNamePrice = apply { + if (validated) { + return@apply + } + + cadence() + currency() + itemId() + matrixWithDisplayNameConfig().validate() + 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() + } + + /** A builder for [NewFloatingMatrixWithDisplayNamePrice]. */ + class Builder internal constructor() { + + 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() + 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( + newFloatingMatrixWithDisplayNamePrice: NewFloatingMatrixWithDisplayNamePrice + ) = 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 + billingCycleConfiguration = + newFloatingMatrixWithDisplayNamePrice.billingCycleConfiguration + conversionRate = newFloatingMatrixWithDisplayNamePrice.conversionRate + externalPriceId = newFloatingMatrixWithDisplayNamePrice.externalPriceId + fixedPriceQuantity = + newFloatingMatrixWithDisplayNamePrice.fixedPriceQuantity + invoiceGroupingKey = + newFloatingMatrixWithDisplayNamePrice.invoiceGroupingKey + invoicingCycleConfiguration = + newFloatingMatrixWithDisplayNamePrice.invoicingCycleConfiguration + metadata = newFloatingMatrixWithDisplayNamePrice.metadata + additionalProperties = + newFloatingMatrixWithDisplayNamePrice.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 } + + /** 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 + } + + /** 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(): NewFloatingMatrixWithDisplayNamePrice = + NewFloatingMatrixWithDisplayNamePrice( + checkRequired("cadence", cadence), + checkRequired("currency", currency), + checkRequired("itemId", itemId), + checkRequired( + "matrixWithDisplayNameConfig", + matrixWithDisplayNameConfig + ), + checkRequired("modelType", modelType), + checkRequired("name", name), + billableMetricId, + billedInAdvance, + billingCycleConfiguration, + conversionRate, + externalPriceId, + fixedPriceQuantity, + invoiceGroupingKey, + invoicingCycleConfiguration, + metadata, + additionalProperties.toImmutable(), + ) + } + + /** The cadence to bill for this price on. */ + class Cadence + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ + @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)) + } + + /** An enum containing [Cadence]'s known values. */ + enum class Known { + ANNUAL, + SEMI_ANNUAL, + MONTHLY, + QUARTERLY, + ONE_TIME, + CUSTOM, + } + + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + ANNUAL, + SEMI_ANNUAL, + MONTHLY, + QUARTERLY, + ONE_TIME, + CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ + 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 + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ + 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 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() + } + + /** A builder for [MatrixWithDisplayNameConfig]. */ + class Builder internal constructor() { + + 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 { @@ -32295,7 +38966,7 @@ constructor( return true } - return /* spotless:off */ other is GroupedWithProratedMinimumConfig && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is MatrixWithDisplayNameConfig && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ @@ -32305,7 +38976,7 @@ constructor( override fun hashCode(): Int = hashCode override fun toString() = - "GroupedWithProratedMinimumConfig{additionalProperties=$additionalProperties}" + "MatrixWithDisplayNameConfig{additionalProperties=$additionalProperties}" } class ModelType @@ -32314,35 +38985,73 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { - @JvmField - val GROUPED_WITH_PRORATED_MINIMUM = of("grouped_with_prorated_minimum") + @JvmField val MATRIX_WITH_DISPLAY_NAME = of("matrix_with_display_name") @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { - GROUPED_WITH_PRORATED_MINIMUM, + MATRIX_WITH_DISPLAY_NAME, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { - GROUPED_WITH_PRORATED_MINIMUM, + MATRIX_WITH_DISPLAY_NAME, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { - GROUPED_WITH_PRORATED_MINIMUM -> Value.GROUPED_WITH_PRORATED_MINIMUM + MATRIX_WITH_DISPLAY_NAME -> Value.MATRIX_WITH_DISPLAY_NAME else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { - GROUPED_WITH_PRORATED_MINIMUM -> Known.GROUPED_WITH_PRORATED_MINIMUM + MATRIX_WITH_DISPLAY_NAME -> Known.MATRIX_WITH_DISPLAY_NAME else -> throw OrbInvalidDataException("Unknown ModelType: $value") } @@ -32418,7 +39127,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -32486,6 +39196,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -32498,17 +39216,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -32516,6 +39257,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -32614,7 +39364,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -32683,6 +39434,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -32695,17 +39454,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -32713,6 +39495,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -32788,7 +39579,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -32845,34 +39637,33 @@ 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 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, groupedWithProratedMinimumConfig, 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() = - "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}" + "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 NewFloatingGroupedWithMeteredMinimumPrice + 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(), @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(), @@ -32915,17 +39706,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 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") @@ -32993,6 +39782,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 @@ -33003,11 +39797,6 @@ 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 @@ -33090,14 +39879,14 @@ constructor( private var validated: Boolean = false - fun validate(): NewFloatingGroupedWithMeteredMinimumPrice = apply { + fun validate(): NewFloatingBulkWithProrationPrice = apply { if (validated) { return@apply } + bulkWithProrationConfig().validate() cadence() currency() - groupedWithMeteredMinimumConfig().validate() itemId() modelType() name() @@ -33120,13 +39909,12 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewFloatingBulkWithProrationPrice]. */ + class Builder internal constructor() { + private var bulkWithProrationConfig: JsonField? = null private var cadence: JsonField? = null private var currency: JsonField? = null - private var groupedWithMeteredMinimumConfig: - JsonField? = - null private var itemId: JsonField? = null private var modelType: JsonField? = null private var name: JsonField? = null @@ -33146,36 +39934,37 @@ constructor( @JvmSynthetic internal fun from( - newFloatingGroupedWithMeteredMinimumPrice: - NewFloatingGroupedWithMeteredMinimumPrice + newFloatingBulkWithProrationPrice: NewFloatingBulkWithProrationPrice ) = 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 + 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 = - newFloatingGroupedWithMeteredMinimumPrice.billingCycleConfiguration - conversionRate = newFloatingGroupedWithMeteredMinimumPrice.conversionRate - externalPriceId = newFloatingGroupedWithMeteredMinimumPrice.externalPriceId - fixedPriceQuantity = - newFloatingGroupedWithMeteredMinimumPrice.fixedPriceQuantity - invoiceGroupingKey = - newFloatingGroupedWithMeteredMinimumPrice.invoiceGroupingKey + newFloatingBulkWithProrationPrice.billingCycleConfiguration + conversionRate = newFloatingBulkWithProrationPrice.conversionRate + externalPriceId = newFloatingBulkWithProrationPrice.externalPriceId + fixedPriceQuantity = newFloatingBulkWithProrationPrice.fixedPriceQuantity + invoiceGroupingKey = newFloatingBulkWithProrationPrice.invoiceGroupingKey invoicingCycleConfiguration = - newFloatingGroupedWithMeteredMinimumPrice.invoicingCycleConfiguration - metadata = newFloatingGroupedWithMeteredMinimumPrice.metadata + newFloatingBulkWithProrationPrice.invoicingCycleConfiguration + metadata = newFloatingBulkWithProrationPrice.metadata additionalProperties = - newFloatingGroupedWithMeteredMinimumPrice.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)) @@ -33188,19 +39977,6 @@ 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)) @@ -33447,14 +40223,11 @@ constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): NewFloatingGroupedWithMeteredMinimumPrice = - NewFloatingGroupedWithMeteredMinimumPrice( + fun build(): NewFloatingBulkWithProrationPrice = + NewFloatingBulkWithProrationPrice( + checkRequired("bulkWithProrationConfig", bulkWithProrationConfig), checkRequired("cadence", cadence), checkRequired("currency", currency), - checkRequired( - "groupedWithMeteredMinimumConfig", - groupedWithMeteredMinimumConfig - ), checkRequired("itemId", itemId), checkRequired("modelType", modelType), checkRequired("name", name), @@ -33471,6 +40244,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() + } + + /** A builder for [BulkWithProrationConfig]. */ + class Builder internal constructor() { + + 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 @@ -33478,6 +40337,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -33498,6 +40365,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -33507,6 +40375,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -33514,9 +40391,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -33528,6 +40416,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -33554,127 +40451,79 @@ constructor( override fun toString() = value.toString() } - @NoAutoDetect - class GroupedWithMeteredMinimumConfig - @JsonCreator - private constructor( - @JsonAnySetter - private val additionalProperties: Map = immutableEmptyMap(), - ) { - - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = additionalProperties - - private var validated: Boolean = false - - fun validate(): GroupedWithMeteredMinimumConfig = 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( - groupedWithMeteredMinimumConfig: GroupedWithMeteredMinimumConfig - ) = apply { - additionalProperties = - groupedWithMeteredMinimumConfig.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(): GroupedWithMeteredMinimumConfig = - GroupedWithMeteredMinimumConfig(additionalProperties.toImmutable()) - } - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is GroupedWithMeteredMinimumConfig && 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() = - "GroupedWithMeteredMinimumConfig{additionalProperties=$additionalProperties}" - } - class ModelType @JsonCreator private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { - @JvmField - val GROUPED_WITH_METERED_MINIMUM = of("grouped_with_metered_minimum") + @JvmField val BULK_WITH_PRORATION = of("bulk_with_proration") @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { - GROUPED_WITH_METERED_MINIMUM, + BULK_WITH_PRORATION, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { - GROUPED_WITH_METERED_MINIMUM, + BULK_WITH_PRORATION, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { - GROUPED_WITH_METERED_MINIMUM -> Value.GROUPED_WITH_METERED_MINIMUM + BULK_WITH_PRORATION -> Value.BULK_WITH_PRORATION else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { - GROUPED_WITH_METERED_MINIMUM -> Known.GROUPED_WITH_METERED_MINIMUM + BULK_WITH_PRORATION -> Known.BULK_WITH_PRORATION else -> throw OrbInvalidDataException("Unknown ModelType: $value") } @@ -33750,7 +40599,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -33818,6 +40668,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -33830,17 +40688,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -33848,6 +40729,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -33946,7 +40836,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -34015,6 +40906,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -34027,17 +40926,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -34045,6 +40967,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -34120,7 +41051,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -34177,21 +41109,21 @@ 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 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, groupedWithMeteredMinimumConfig, itemId, 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() = - "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}" + "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 NewFloatingMatrixWithDisplayNamePrice + class NewFloatingGroupedTieredPackagePrice @JsonCreator private constructor( @JsonProperty("cadence") @@ -34200,13 +41132,13 @@ constructor( @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("matrix_with_display_name_config") - @ExcludeMissing - private val matrixWithDisplayNameConfig: JsonField = - JsonMissing.of(), @JsonProperty("model_type") @ExcludeMissing private val modelType: JsonField = JsonMissing.of(), @@ -34252,12 +41184,12 @@ constructor( /** 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 matrixWithDisplayNameConfig(): MatrixWithDisplayNameConfig = - matrixWithDisplayNameConfig.getRequired("matrix_with_display_name_config") - fun modelType(): ModelType = modelType.getRequired("model_type") /** The name of the price. */ @@ -34332,14 +41264,14 @@ 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 - @JsonProperty("matrix_with_display_name_config") - @ExcludeMissing - fun _matrixWithDisplayNameConfig(): JsonField = - matrixWithDisplayNameConfig - @JsonProperty("model_type") @ExcludeMissing fun _modelType(): JsonField = modelType @@ -34419,15 +41351,15 @@ constructor( private var validated: Boolean = false - fun validate(): NewFloatingMatrixWithDisplayNamePrice = apply { + fun validate(): NewFloatingGroupedTieredPackagePrice = apply { if (validated) { return@apply } cadence() currency() + groupedTieredPackageConfig().validate() itemId() - matrixWithDisplayNameConfig().validate() modelType() name() billableMetricId() @@ -34449,14 +41381,14 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewFloatingGroupedTieredPackagePrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var currency: JsonField? = null - private var itemId: JsonField? = null - private var matrixWithDisplayNameConfig: - JsonField? = + 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() @@ -34475,31 +41407,28 @@ constructor( @JvmSynthetic internal fun from( - newFloatingMatrixWithDisplayNamePrice: NewFloatingMatrixWithDisplayNamePrice + newFloatingGroupedTieredPackagePrice: NewFloatingGroupedTieredPackagePrice ) = 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 + 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 = - newFloatingMatrixWithDisplayNamePrice.billingCycleConfiguration - conversionRate = newFloatingMatrixWithDisplayNamePrice.conversionRate - externalPriceId = newFloatingMatrixWithDisplayNamePrice.externalPriceId - fixedPriceQuantity = - newFloatingMatrixWithDisplayNamePrice.fixedPriceQuantity - invoiceGroupingKey = - newFloatingMatrixWithDisplayNamePrice.invoiceGroupingKey + newFloatingGroupedTieredPackagePrice.billingCycleConfiguration + conversionRate = newFloatingGroupedTieredPackagePrice.conversionRate + externalPriceId = newFloatingGroupedTieredPackagePrice.externalPriceId + fixedPriceQuantity = newFloatingGroupedTieredPackagePrice.fixedPriceQuantity + invoiceGroupingKey = newFloatingGroupedTieredPackagePrice.invoiceGroupingKey invoicingCycleConfiguration = - newFloatingMatrixWithDisplayNamePrice.invoicingCycleConfiguration - metadata = newFloatingMatrixWithDisplayNamePrice.metadata + newFloatingGroupedTieredPackagePrice.invoicingCycleConfiguration + metadata = newFloatingGroupedTieredPackagePrice.metadata additionalProperties = - newFloatingMatrixWithDisplayNamePrice.additionalProperties - .toMutableMap() + newFloatingGroupedTieredPackagePrice.additionalProperties.toMutableMap() } /** The cadence to bill for this price on. */ @@ -34514,20 +41443,20 @@ 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)) /** 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 { @@ -34768,15 +41697,12 @@ constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): NewFloatingMatrixWithDisplayNamePrice = - NewFloatingMatrixWithDisplayNamePrice( + fun build(): NewFloatingGroupedTieredPackagePrice = + NewFloatingGroupedTieredPackagePrice( checkRequired("cadence", cadence), checkRequired("currency", currency), + checkRequired("groupedTieredPackageConfig", groupedTieredPackageConfig), checkRequired("itemId", itemId), - checkRequired( - "matrixWithDisplayNameConfig", - matrixWithDisplayNameConfig - ), checkRequired("modelType", modelType), checkRequired("name", name), billableMetricId, @@ -34799,6 +41725,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -34819,6 +41753,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -34828,6 +41763,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -34835,9 +41779,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -34849,6 +41804,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -34876,7 +41840,7 @@ constructor( } @NoAutoDetect - class MatrixWithDisplayNameConfig + class GroupedTieredPackageConfig @JsonCreator private constructor( @JsonAnySetter @@ -34889,7 +41853,7 @@ constructor( private var validated: Boolean = false - fun validate(): MatrixWithDisplayNameConfig = apply { + fun validate(): GroupedTieredPackageConfig = apply { if (validated) { return@apply } @@ -34904,18 +41868,18 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [GroupedTieredPackageConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from( - matrixWithDisplayNameConfig: MatrixWithDisplayNameConfig - ) = apply { - additionalProperties = - matrixWithDisplayNameConfig.additionalProperties.toMutableMap() - } + internal fun from(groupedTieredPackageConfig: GroupedTieredPackageConfig) = + apply { + additionalProperties = + groupedTieredPackageConfig.additionalProperties.toMutableMap() + } fun additionalProperties(additionalProperties: Map) = apply { @@ -34939,8 +41903,8 @@ constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): MatrixWithDisplayNameConfig = - MatrixWithDisplayNameConfig(additionalProperties.toImmutable()) + fun build(): GroupedTieredPackageConfig = + GroupedTieredPackageConfig(additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { @@ -34948,7 +41912,7 @@ constructor( return true } - return /* spotless:off */ other is MatrixWithDisplayNameConfig && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is GroupedTieredPackageConfig && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ @@ -34958,7 +41922,7 @@ constructor( override fun hashCode(): Int = hashCode override fun toString() = - "MatrixWithDisplayNameConfig{additionalProperties=$additionalProperties}" + "GroupedTieredPackageConfig{additionalProperties=$additionalProperties}" } class ModelType @@ -34967,34 +41931,73 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { - @JvmField val MATRIX_WITH_DISPLAY_NAME = of("matrix_with_display_name") + @JvmField val GROUPED_TIERED_PACKAGE = of("grouped_tiered_package") @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { - MATRIX_WITH_DISPLAY_NAME, + GROUPED_TIERED_PACKAGE, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { - MATRIX_WITH_DISPLAY_NAME, + GROUPED_TIERED_PACKAGE, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { - MATRIX_WITH_DISPLAY_NAME -> Value.MATRIX_WITH_DISPLAY_NAME + GROUPED_TIERED_PACKAGE -> Value.GROUPED_TIERED_PACKAGE else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { - MATRIX_WITH_DISPLAY_NAME -> Known.MATRIX_WITH_DISPLAY_NAME + GROUPED_TIERED_PACKAGE -> Known.GROUPED_TIERED_PACKAGE else -> throw OrbInvalidDataException("Unknown ModelType: $value") } @@ -35070,7 +42073,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -35138,6 +42142,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -35150,17 +42162,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -35168,6 +42203,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -35266,7 +42310,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -35335,6 +42380,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -35347,17 +42400,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -35365,6 +42441,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -35440,7 +42525,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -35497,27 +42583,23 @@ 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 NewFloatingGroupedTieredPackagePrice && cadence == other.cadence && currency == other.currency && groupedTieredPackageConfig == other.groupedTieredPackageConfig && 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(cadence, currency, groupedTieredPackageConfig, 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}" + "NewFloatingGroupedTieredPackagePrice{cadence=$cadence, currency=$currency, groupedTieredPackageConfig=$groupedTieredPackageConfig, 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 NewFloatingScalableMatrixWithUnitPricingPrice @JsonCreator private constructor( - @JsonProperty("bulk_with_proration_config") - @ExcludeMissing - private val bulkWithProrationConfig: JsonField = - JsonMissing.of(), @JsonProperty("cadence") @ExcludeMissing private val cadence: JsonField = JsonMissing.of(), @@ -35533,6 +42615,11 @@ constructor( @JsonProperty("name") @ExcludeMissing private val name: JsonField = JsonMissing.of(), + @JsonProperty("scalable_matrix_with_unit_pricing_config") + @ExcludeMissing + private val scalableMatrixWithUnitPricingConfig: + JsonField = + JsonMissing.of(), @JsonProperty("billable_metric_id") @ExcludeMissing private val billableMetricId: JsonField = JsonMissing.of(), @@ -35566,9 +42653,6 @@ 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") @@ -35583,6 +42667,11 @@ constructor( /** The name of the price. */ fun name(): String = name.getRequired("name") + fun scalableMatrixWithUnitPricingConfig(): ScalableMatrixWithUnitPricingConfig = + scalableMatrixWithUnitPricingConfig.getRequired( + "scalable_matrix_with_unit_pricing_config" + ) + /** * The id of the billable metric for the price. Only needed if the price is * usage-based. @@ -35642,11 +42731,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 @@ -35667,6 +42751,12 @@ constructor( /** The name of the price. */ @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + @JsonProperty("scalable_matrix_with_unit_pricing_config") + @ExcludeMissing + fun _scalableMatrixWithUnitPricingConfig(): + JsonField = + scalableMatrixWithUnitPricingConfig + /** * The id of the billable metric for the price. Only needed if the price is * usage-based. @@ -35739,17 +42829,17 @@ constructor( private var validated: Boolean = false - fun validate(): NewFloatingBulkWithProrationPrice = apply { + fun validate(): NewFloatingScalableMatrixWithUnitPricingPrice = apply { if (validated) { return@apply } - bulkWithProrationConfig().validate() cadence() currency() itemId() modelType() name() + scalableMatrixWithUnitPricingConfig().validate() billableMetricId() billedInAdvance() billingCycleConfiguration().ifPresent { it.validate() } @@ -35769,14 +42859,17 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewFloatingScalableMatrixWithUnitPricingPrice]. */ + class Builder internal constructor() { - private var bulkWithProrationConfig: JsonField? = null private var cadence: JsonField? = null private var currency: JsonField? = null private var itemId: JsonField? = null private var modelType: JsonField? = null private var name: JsonField? = null + private var scalableMatrixWithUnitPricingConfig: + JsonField? = + null private var billableMetricId: JsonField = JsonMissing.of() private var billedInAdvance: JsonField = JsonMissing.of() private var billingCycleConfiguration: JsonField = @@ -35793,37 +42886,40 @@ constructor( @JvmSynthetic internal fun from( - newFloatingBulkWithProrationPrice: NewFloatingBulkWithProrationPrice + newFloatingScalableMatrixWithUnitPricingPrice: + NewFloatingScalableMatrixWithUnitPricingPrice ) = 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 = newFloatingScalableMatrixWithUnitPricingPrice.cadence + currency = newFloatingScalableMatrixWithUnitPricingPrice.currency + itemId = newFloatingScalableMatrixWithUnitPricingPrice.itemId + modelType = newFloatingScalableMatrixWithUnitPricingPrice.modelType + name = newFloatingScalableMatrixWithUnitPricingPrice.name + scalableMatrixWithUnitPricingConfig = + newFloatingScalableMatrixWithUnitPricingPrice + .scalableMatrixWithUnitPricingConfig + billableMetricId = + newFloatingScalableMatrixWithUnitPricingPrice.billableMetricId + billedInAdvance = + newFloatingScalableMatrixWithUnitPricingPrice.billedInAdvance billingCycleConfiguration = - newFloatingBulkWithProrationPrice.billingCycleConfiguration - conversionRate = newFloatingBulkWithProrationPrice.conversionRate - externalPriceId = newFloatingBulkWithProrationPrice.externalPriceId - fixedPriceQuantity = newFloatingBulkWithProrationPrice.fixedPriceQuantity - invoiceGroupingKey = newFloatingBulkWithProrationPrice.invoiceGroupingKey + newFloatingScalableMatrixWithUnitPricingPrice.billingCycleConfiguration + conversionRate = + newFloatingScalableMatrixWithUnitPricingPrice.conversionRate + externalPriceId = + newFloatingScalableMatrixWithUnitPricingPrice.externalPriceId + fixedPriceQuantity = + newFloatingScalableMatrixWithUnitPricingPrice.fixedPriceQuantity + invoiceGroupingKey = + newFloatingScalableMatrixWithUnitPricingPrice.invoiceGroupingKey invoicingCycleConfiguration = - newFloatingBulkWithProrationPrice.invoicingCycleConfiguration - metadata = newFloatingBulkWithProrationPrice.metadata + newFloatingScalableMatrixWithUnitPricingPrice + .invoicingCycleConfiguration + metadata = newFloatingScalableMatrixWithUnitPricingPrice.metadata additionalProperties = - newFloatingBulkWithProrationPrice.additionalProperties.toMutableMap() + newFloatingScalableMatrixWithUnitPricingPrice.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)) @@ -35854,6 +42950,21 @@ constructor( /** The name of the price. */ fun name(name: JsonField) = apply { this.name = name } + fun scalableMatrixWithUnitPricingConfig( + scalableMatrixWithUnitPricingConfig: ScalableMatrixWithUnitPricingConfig + ) = + scalableMatrixWithUnitPricingConfig( + JsonField.of(scalableMatrixWithUnitPricingConfig) + ) + + fun scalableMatrixWithUnitPricingConfig( + scalableMatrixWithUnitPricingConfig: + JsonField + ) = apply { + this.scalableMatrixWithUnitPricingConfig = + scalableMatrixWithUnitPricingConfig + } + /** * The id of the billable metric for the price. Only needed if the price is * usage-based. @@ -36082,14 +43193,17 @@ constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): NewFloatingBulkWithProrationPrice = - NewFloatingBulkWithProrationPrice( - checkRequired("bulkWithProrationConfig", bulkWithProrationConfig), + fun build(): NewFloatingScalableMatrixWithUnitPricingPrice = + NewFloatingScalableMatrixWithUnitPricingPrice( checkRequired("cadence", cadence), checkRequired("currency", currency), checkRequired("itemId", itemId), checkRequired("modelType", modelType), checkRequired("name", name), + checkRequired( + "scalableMatrixWithUnitPricingConfig", + scalableMatrixWithUnitPricingConfig + ), billableMetricId, billedInAdvance, billingCycleConfiguration, @@ -36103,91 +43217,6 @@ 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 @@ -36195,6 +43224,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -36215,6 +43252,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -36224,6 +43262,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -36231,9 +43278,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -36245,6 +43303,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -36277,34 +43344,77 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { - @JvmField val BULK_WITH_PRORATION = of("bulk_with_proration") + @JvmField + val SCALABLE_MATRIX_WITH_UNIT_PRICING = + of("scalable_matrix_with_unit_pricing") @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { - BULK_WITH_PRORATION, + SCALABLE_MATRIX_WITH_UNIT_PRICING, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { - BULK_WITH_PRORATION, + SCALABLE_MATRIX_WITH_UNIT_PRICING, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { - BULK_WITH_PRORATION -> Value.BULK_WITH_PRORATION + SCALABLE_MATRIX_WITH_UNIT_PRICING -> + Value.SCALABLE_MATRIX_WITH_UNIT_PRICING else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { - BULK_WITH_PRORATION -> Known.BULK_WITH_PRORATION + SCALABLE_MATRIX_WITH_UNIT_PRICING -> + Known.SCALABLE_MATRIX_WITH_UNIT_PRICING else -> throw OrbInvalidDataException("Unknown ModelType: $value") } @@ -36323,6 +43433,94 @@ constructor( override fun toString() = value.toString() } + @NoAutoDetect + class ScalableMatrixWithUnitPricingConfig + @JsonCreator + private constructor( + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): ScalableMatrixWithUnitPricingConfig = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + /** A builder for [ScalableMatrixWithUnitPricingConfig]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from( + scalableMatrixWithUnitPricingConfig: ScalableMatrixWithUnitPricingConfig + ) = apply { + additionalProperties = + scalableMatrixWithUnitPricingConfig.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(): ScalableMatrixWithUnitPricingConfig = + ScalableMatrixWithUnitPricingConfig(additionalProperties.toImmutable()) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is ScalableMatrixWithUnitPricingConfig && 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() = + "ScalableMatrixWithUnitPricingConfig{additionalProperties=$additionalProperties}" + } + /** * For custom cadence: specifies the duration of the billing period in days or * months. @@ -36380,7 +43578,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -36448,6 +43647,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -36460,17 +43667,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -36478,6 +43708,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -36576,7 +43815,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -36645,6 +43885,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -36657,17 +43905,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -36675,6 +43946,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -36750,7 +44030,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -36807,21 +44088,21 @@ constructor( 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 */ + return /* spotless:off */ other is NewFloatingScalableMatrixWithUnitPricingPrice && cadence == other.cadence && currency == other.currency && itemId == other.itemId && modelType == other.modelType && name == other.name && scalableMatrixWithUnitPricingConfig == other.scalableMatrixWithUnitPricingConfig && 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) } + private val hashCode: Int by lazy { Objects.hash(cadence, currency, itemId, modelType, name, scalableMatrixWithUnitPricingConfig, 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}" + "NewFloatingScalableMatrixWithUnitPricingPrice{cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, scalableMatrixWithUnitPricingConfig=$scalableMatrixWithUnitPricingConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" } @NoAutoDetect - class NewFloatingGroupedTieredPackagePrice + class NewFloatingScalableMatrixWithTieredPricingPrice @JsonCreator private constructor( @JsonProperty("cadence") @@ -36830,10 +44111,6 @@ constructor( @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(), @@ -36843,6 +44120,11 @@ constructor( @JsonProperty("name") @ExcludeMissing private val name: JsonField = JsonMissing.of(), + @JsonProperty("scalable_matrix_with_tiered_pricing_config") + @ExcludeMissing + private val scalableMatrixWithTieredPricingConfig: + JsonField = + JsonMissing.of(), @JsonProperty("billable_metric_id") @ExcludeMissing private val billableMetricId: JsonField = JsonMissing.of(), @@ -36882,9 +44164,6 @@ constructor( /** 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") @@ -36893,6 +44172,11 @@ constructor( /** The name of the price. */ fun name(): String = name.getRequired("name") + fun scalableMatrixWithTieredPricingConfig(): ScalableMatrixWithTieredPricingConfig = + scalableMatrixWithTieredPricingConfig.getRequired( + "scalable_matrix_with_tiered_pricing_config" + ) + /** * The id of the billable metric for the price. Only needed if the price is * usage-based. @@ -36962,11 +44246,6 @@ 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 @@ -36977,6 +44256,12 @@ constructor( /** The name of the price. */ @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + @JsonProperty("scalable_matrix_with_tiered_pricing_config") + @ExcludeMissing + fun _scalableMatrixWithTieredPricingConfig(): + JsonField = + scalableMatrixWithTieredPricingConfig + /** * The id of the billable metric for the price. Only needed if the price is * usage-based. @@ -37049,17 +44334,17 @@ constructor( private var validated: Boolean = false - fun validate(): NewFloatingGroupedTieredPackagePrice = apply { + fun validate(): NewFloatingScalableMatrixWithTieredPricingPrice = apply { if (validated) { return@apply } cadence() currency() - groupedTieredPackageConfig().validate() itemId() modelType() name() + scalableMatrixWithTieredPricingConfig().validate() billableMetricId() billedInAdvance() billingCycleConfiguration().ifPresent { it.validate() } @@ -37079,15 +44364,17 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewFloatingScalableMatrixWithTieredPricingPrice]. */ + class Builder internal constructor() { 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 scalableMatrixWithTieredPricingConfig: + JsonField? = + null private var billableMetricId: JsonField = JsonMissing.of() private var billedInAdvance: JsonField = JsonMissing.of() private var billingCycleConfiguration: JsonField = @@ -37104,28 +44391,39 @@ constructor( @JvmSynthetic internal fun from( - newFloatingGroupedTieredPackagePrice: NewFloatingGroupedTieredPackagePrice + newFloatingScalableMatrixWithTieredPricingPrice: + NewFloatingScalableMatrixWithTieredPricingPrice ) = 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 + cadence = newFloatingScalableMatrixWithTieredPricingPrice.cadence + currency = newFloatingScalableMatrixWithTieredPricingPrice.currency + itemId = newFloatingScalableMatrixWithTieredPricingPrice.itemId + modelType = newFloatingScalableMatrixWithTieredPricingPrice.modelType + name = newFloatingScalableMatrixWithTieredPricingPrice.name + scalableMatrixWithTieredPricingConfig = + newFloatingScalableMatrixWithTieredPricingPrice + .scalableMatrixWithTieredPricingConfig + billableMetricId = + newFloatingScalableMatrixWithTieredPricingPrice.billableMetricId + billedInAdvance = + newFloatingScalableMatrixWithTieredPricingPrice.billedInAdvance billingCycleConfiguration = - newFloatingGroupedTieredPackagePrice.billingCycleConfiguration - conversionRate = newFloatingGroupedTieredPackagePrice.conversionRate - externalPriceId = newFloatingGroupedTieredPackagePrice.externalPriceId - fixedPriceQuantity = newFloatingGroupedTieredPackagePrice.fixedPriceQuantity - invoiceGroupingKey = newFloatingGroupedTieredPackagePrice.invoiceGroupingKey + newFloatingScalableMatrixWithTieredPricingPrice + .billingCycleConfiguration + conversionRate = + newFloatingScalableMatrixWithTieredPricingPrice.conversionRate + externalPriceId = + newFloatingScalableMatrixWithTieredPricingPrice.externalPriceId + fixedPriceQuantity = + newFloatingScalableMatrixWithTieredPricingPrice.fixedPriceQuantity + invoiceGroupingKey = + newFloatingScalableMatrixWithTieredPricingPrice.invoiceGroupingKey invoicingCycleConfiguration = - newFloatingGroupedTieredPackagePrice.invoicingCycleConfiguration - metadata = newFloatingGroupedTieredPackagePrice.metadata + newFloatingScalableMatrixWithTieredPricingPrice + .invoicingCycleConfiguration + metadata = newFloatingScalableMatrixWithTieredPricingPrice.metadata additionalProperties = - newFloatingGroupedTieredPackagePrice.additionalProperties.toMutableMap() + newFloatingScalableMatrixWithTieredPricingPrice.additionalProperties + .toMutableMap() } /** The cadence to bill for this price on. */ @@ -37140,14 +44438,6 @@ 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)) @@ -37166,6 +44456,21 @@ constructor( /** The name of the price. */ fun name(name: JsonField) = apply { this.name = name } + fun scalableMatrixWithTieredPricingConfig( + scalableMatrixWithTieredPricingConfig: ScalableMatrixWithTieredPricingConfig + ) = + scalableMatrixWithTieredPricingConfig( + JsonField.of(scalableMatrixWithTieredPricingConfig) + ) + + fun scalableMatrixWithTieredPricingConfig( + scalableMatrixWithTieredPricingConfig: + JsonField + ) = apply { + this.scalableMatrixWithTieredPricingConfig = + scalableMatrixWithTieredPricingConfig + } + /** * The id of the billable metric for the price. Only needed if the price is * usage-based. @@ -37394,14 +44699,17 @@ constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): NewFloatingGroupedTieredPackagePrice = - NewFloatingGroupedTieredPackagePrice( + fun build(): NewFloatingScalableMatrixWithTieredPricingPrice = + NewFloatingScalableMatrixWithTieredPricingPrice( checkRequired("cadence", cadence), checkRequired("currency", currency), - checkRequired("groupedTieredPackageConfig", groupedTieredPackageConfig), checkRequired("itemId", itemId), checkRequired("modelType", modelType), checkRequired("name", name), + checkRequired( + "scalableMatrixWithTieredPricingConfig", + scalableMatrixWithTieredPricingConfig + ), billableMetricId, billedInAdvance, billingCycleConfiguration, @@ -37422,6 +44730,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -37442,6 +44758,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -37451,6 +44768,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -37458,9 +44784,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -37472,6 +44809,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -37498,8 +44844,103 @@ constructor( override fun toString() = value.toString() } + class ModelType + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue + fun _value(): JsonField = value + + companion object { + + @JvmField + val SCALABLE_MATRIX_WITH_TIERED_PRICING = + of("scalable_matrix_with_tiered_pricing") + + @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) + } + + /** An enum containing [ModelType]'s known values. */ + enum class Known { + SCALABLE_MATRIX_WITH_TIERED_PRICING, + } + + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + SCALABLE_MATRIX_WITH_TIERED_PRICING, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + SCALABLE_MATRIX_WITH_TIERED_PRICING -> + Value.SCALABLE_MATRIX_WITH_TIERED_PRICING + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ + fun known(): Known = + when (this) { + SCALABLE_MATRIX_WITH_TIERED_PRICING -> + Known.SCALABLE_MATRIX_WITH_TIERED_PRICING + 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 GroupedTieredPackageConfig + class ScalableMatrixWithTieredPricingConfig @JsonCreator private constructor( @JsonAnySetter @@ -37512,7 +44953,7 @@ constructor( private var validated: Boolean = false - fun validate(): GroupedTieredPackageConfig = apply { + fun validate(): ScalableMatrixWithTieredPricingConfig = apply { if (validated) { return@apply } @@ -37527,17 +44968,21 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [ScalableMatrixWithTieredPricingConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(groupedTieredPackageConfig: GroupedTieredPackageConfig) = - apply { - additionalProperties = - groupedTieredPackageConfig.additionalProperties.toMutableMap() - } + internal fun from( + scalableMatrixWithTieredPricingConfig: + ScalableMatrixWithTieredPricingConfig + ) = apply { + additionalProperties = + scalableMatrixWithTieredPricingConfig.additionalProperties + .toMutableMap() + } fun additionalProperties(additionalProperties: Map) = apply { @@ -37561,8 +45006,10 @@ constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): GroupedTieredPackageConfig = - GroupedTieredPackageConfig(additionalProperties.toImmutable()) + fun build(): ScalableMatrixWithTieredPricingConfig = + ScalableMatrixWithTieredPricingConfig( + additionalProperties.toImmutable() + ) } override fun equals(other: Any?): Boolean { @@ -37570,7 +45017,7 @@ constructor( return true } - return /* spotless:off */ other is GroupedTieredPackageConfig && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is ScalableMatrixWithTieredPricingConfig && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ @@ -37580,59 +45027,7 @@ constructor( 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() + "ScalableMatrixWithTieredPricingConfig{additionalProperties=$additionalProperties}" } /** @@ -37692,7 +45087,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -37760,6 +45156,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -37772,17 +45176,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -37790,6 +45217,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -37888,7 +45324,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -37957,6 +45394,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -37969,17 +45414,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -37987,6 +45455,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -38062,7 +45539,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -38119,17 +45597,17 @@ constructor( return true } - return /* spotless:off */ other is NewFloatingGroupedTieredPackagePrice && cadence == other.cadence && currency == other.currency && groupedTieredPackageConfig == other.groupedTieredPackageConfig && 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 NewFloatingScalableMatrixWithTieredPricingPrice && cadence == other.cadence && currency == other.currency && itemId == other.itemId && modelType == other.modelType && name == other.name && scalableMatrixWithTieredPricingConfig == other.scalableMatrixWithTieredPricingConfig && 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, groupedTieredPackageConfig, itemId, 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, scalableMatrixWithTieredPricingConfig, billableMetricId, billedInAdvance, billingCycleConfiguration, conversionRate, externalPriceId, fixedPriceQuantity, invoiceGroupingKey, invoicingCycleConfiguration, metadata, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "NewFloatingGroupedTieredPackagePrice{cadence=$cadence, currency=$currency, groupedTieredPackageConfig=$groupedTieredPackageConfig, 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}" + "NewFloatingScalableMatrixWithTieredPricingPrice{cadence=$cadence, currency=$currency, itemId=$itemId, modelType=$modelType, name=$name, scalableMatrixWithTieredPricingConfig=$scalableMatrixWithTieredPricingConfig, billableMetricId=$billableMetricId, billedInAdvance=$billedInAdvance, billingCycleConfiguration=$billingCycleConfiguration, conversionRate=$conversionRate, externalPriceId=$externalPriceId, fixedPriceQuantity=$fixedPriceQuantity, invoiceGroupingKey=$invoiceGroupingKey, invoicingCycleConfiguration=$invoicingCycleConfiguration, metadata=$metadata, additionalProperties=$additionalProperties}" } } @@ -38226,7 +45704,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AddAdjustment]. */ + class Builder internal constructor() { private var adjustment: JsonField? = null private var startDate: JsonField? = null @@ -38494,6 +45973,10 @@ constructor( fun ofNewMaximum(newMaximum: NewMaximum) = Adjustment(newMaximum = newMaximum) } + /** + * An interface that defines how to map each variant of [Adjustment] to a value of type + * [T]. + */ interface Visitor { fun visitNewPercentageDiscount(newPercentageDiscount: NewPercentageDiscount): T @@ -38506,12 +45989,22 @@ constructor( fun visitNewMaximum(newMaximum: NewMaximum): T + /** + * Maps an unknown variant of [Adjustment] to a value of type [T]. + * + * An instance of [Adjustment] can contain an unknown variant if it was deserialized + * from data that doesn't match any known variant. For example, if the SDK is on an + * older version than the API, then the API may respond with new variants that the + * SDK is unaware of. + * + * @throws OrbInvalidDataException in the default implementation. + */ fun unknown(json: JsonValue?): T { throw OrbInvalidDataException("Unknown Adjustment: $json") } } - class Deserializer : BaseDeserializer(Adjustment::class) { + internal class Deserializer : BaseDeserializer(Adjustment::class) { override fun ObjectCodec.deserialize(node: JsonNode): Adjustment { val json = JsonValue.fromJsonNode(node) @@ -38561,7 +46054,7 @@ constructor( } } - class Serializer : BaseSerializer(Adjustment::class) { + internal class Serializer : BaseSerializer(Adjustment::class) { override fun serialize( value: Adjustment, @@ -38665,7 +46158,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewPercentageDiscount]. */ + class Builder internal constructor() { private var adjustmentType: JsonField? = null private var appliesToPriceIds: JsonField>? = null @@ -38776,6 +46270,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -38786,21 +46288,53 @@ constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { PERCENTAGE_DISCOUNT, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PERCENTAGE_DISCOUNT, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { PERCENTAGE_DISCOUNT -> Value.PERCENTAGE_DISCOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { PERCENTAGE_DISCOUNT -> Known.PERCENTAGE_DISCOUNT @@ -38921,7 +46455,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewUsageDiscount]. */ + class Builder internal constructor() { private var adjustmentType: JsonField? = null private var appliesToPriceIds: JsonField>? = null @@ -39031,6 +46566,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -39041,21 +46584,53 @@ constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { USAGE_DISCOUNT, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { USAGE_DISCOUNT, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { USAGE_DISCOUNT -> Value.USAGE_DISCOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { USAGE_DISCOUNT -> Known.USAGE_DISCOUNT @@ -39176,7 +46751,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewAmountDiscount]. */ + class Builder internal constructor() { private var adjustmentType: JsonField? = null private var amountDiscount: JsonField? = null @@ -39286,6 +46862,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -39296,21 +46880,53 @@ constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { AMOUNT_DISCOUNT, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { AMOUNT_DISCOUNT, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { AMOUNT_DISCOUNT -> Value.AMOUNT_DISCOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { AMOUNT_DISCOUNT -> Known.AMOUNT_DISCOUNT @@ -39441,7 +47057,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewMinimum]. */ + class Builder internal constructor() { private var adjustmentType: JsonField? = null private var appliesToPriceIds: JsonField>? = null @@ -39559,6 +47176,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -39569,21 +47194,53 @@ constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { MINIMUM, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { MINIMUM, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { MINIMUM -> Value.MINIMUM else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { MINIMUM -> Known.MINIMUM @@ -39704,7 +47361,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewMaximum]. */ + class Builder internal constructor() { private var adjustmentType: JsonField? = null private var appliesToPriceIds: JsonField>? = null @@ -39813,6 +47471,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -39823,21 +47489,53 @@ constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { MAXIMUM, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { MAXIMUM, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { MAXIMUM -> Value.MAXIMUM else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { MAXIMUM -> Known.MAXIMUM @@ -39963,18 +47661,32 @@ constructor( StartDate(billingCycleRelative = billingCycleRelative) } + /** + * An interface that defines how to map each variant of [StartDate] to a value of type + * [T]. + */ interface Visitor { fun visitDateTime(dateTime: OffsetDateTime): T fun visitBillingCycleRelative(billingCycleRelative: BillingCycleRelativeDate): T + /** + * Maps an unknown variant of [StartDate] to a value of type [T]. + * + * An instance of [StartDate] can contain an unknown variant if it was deserialized + * from data that doesn't match any known variant. For example, if the SDK is on an + * older version than the API, then the API may respond with new variants that the + * SDK is unaware of. + * + * @throws OrbInvalidDataException in the default implementation. + */ fun unknown(json: JsonValue?): T { throw OrbInvalidDataException("Unknown StartDate: $json") } } - class Deserializer : BaseDeserializer(StartDate::class) { + internal class Deserializer : BaseDeserializer(StartDate::class) { override fun ObjectCodec.deserialize(node: JsonNode): StartDate { val json = JsonValue.fromJsonNode(node) @@ -39990,7 +47702,7 @@ constructor( } } - class Serializer : BaseSerializer(StartDate::class) { + internal class Serializer : BaseSerializer(StartDate::class) { override fun serialize( value: StartDate, @@ -40093,18 +47805,32 @@ constructor( EndDate(billingCycleRelative = billingCycleRelative) } + /** + * An interface that defines how to map each variant of [EndDate] to a value of type + * [T]. + */ interface Visitor { fun visitDateTime(dateTime: OffsetDateTime): T fun visitBillingCycleRelative(billingCycleRelative: BillingCycleRelativeDate): T + /** + * Maps an unknown variant of [EndDate] to a value of type [T]. + * + * An instance of [EndDate] can contain an unknown variant if it was deserialized + * from data that doesn't match any known variant. For example, if the SDK is on an + * older version than the API, then the API may respond with new variants that the + * SDK is unaware of. + * + * @throws OrbInvalidDataException in the default implementation. + */ fun unknown(json: JsonValue?): T { throw OrbInvalidDataException("Unknown EndDate: $json") } } - class Deserializer : BaseDeserializer(EndDate::class) { + internal class Deserializer : BaseDeserializer(EndDate::class) { override fun ObjectCodec.deserialize(node: JsonNode): EndDate { val json = JsonValue.fromJsonNode(node) @@ -40120,7 +47846,7 @@ constructor( } } - class Serializer : BaseSerializer(EndDate::class) { + internal class Serializer : BaseSerializer(EndDate::class) { override fun serialize( value: EndDate, @@ -40276,7 +48002,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Edit]. */ + class Builder internal constructor() { private var priceIntervalId: JsonField? = null private var billingCycleDay: JsonField = JsonMissing.of() @@ -40561,18 +48288,32 @@ constructor( EndDate(billingCycleRelative = billingCycleRelative) } + /** + * An interface that defines how to map each variant of [EndDate] to a value of type + * [T]. + */ interface Visitor { fun visitDateTime(dateTime: OffsetDateTime): T fun visitBillingCycleRelative(billingCycleRelative: BillingCycleRelativeDate): T + /** + * Maps an unknown variant of [EndDate] to a value of type [T]. + * + * An instance of [EndDate] can contain an unknown variant if it was deserialized + * from data that doesn't match any known variant. For example, if the SDK is on an + * older version than the API, then the API may respond with new variants that the + * SDK is unaware of. + * + * @throws OrbInvalidDataException in the default implementation. + */ fun unknown(json: JsonValue?): T { throw OrbInvalidDataException("Unknown EndDate: $json") } } - class Deserializer : BaseDeserializer(EndDate::class) { + internal class Deserializer : BaseDeserializer(EndDate::class) { override fun ObjectCodec.deserialize(node: JsonNode): EndDate { val json = JsonValue.fromJsonNode(node) @@ -40588,7 +48329,7 @@ constructor( } } - class Serializer : BaseSerializer(EndDate::class) { + internal class Serializer : BaseSerializer(EndDate::class) { override fun serialize( value: EndDate, @@ -40657,7 +48398,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [FixedFeeQuantityTransition]. */ + class Builder internal constructor() { private var effectiveDate: JsonField? = null private var quantity: JsonField? = null @@ -40819,18 +48561,32 @@ constructor( StartDate(billingCycleRelative = billingCycleRelative) } + /** + * An interface that defines how to map each variant of [StartDate] to a value of type + * [T]. + */ interface Visitor { fun visitDateTime(dateTime: OffsetDateTime): T fun visitBillingCycleRelative(billingCycleRelative: BillingCycleRelativeDate): T + /** + * Maps an unknown variant of [StartDate] to a value of type [T]. + * + * An instance of [StartDate] can contain an unknown variant if it was deserialized + * from data that doesn't match any known variant. For example, if the SDK is on an + * older version than the API, then the API may respond with new variants that the + * SDK is unaware of. + * + * @throws OrbInvalidDataException in the default implementation. + */ fun unknown(json: JsonValue?): T { throw OrbInvalidDataException("Unknown StartDate: $json") } } - class Deserializer : BaseDeserializer(StartDate::class) { + internal class Deserializer : BaseDeserializer(StartDate::class) { override fun ObjectCodec.deserialize(node: JsonNode): StartDate { val json = JsonValue.fromJsonNode(node) @@ -40846,7 +48602,7 @@ constructor( } } - class Serializer : BaseSerializer(StartDate::class) { + internal class Serializer : BaseSerializer(StartDate::class) { override fun serialize( value: StartDate, @@ -40959,7 +48715,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [EditAdjustment]. */ + class Builder internal constructor() { private var adjustmentIntervalId: JsonField? = null private var endDate: JsonField = JsonMissing.of() @@ -41152,18 +48909,32 @@ constructor( EndDate(billingCycleRelative = billingCycleRelative) } + /** + * An interface that defines how to map each variant of [EndDate] to a value of type + * [T]. + */ interface Visitor { fun visitDateTime(dateTime: OffsetDateTime): T fun visitBillingCycleRelative(billingCycleRelative: BillingCycleRelativeDate): T + /** + * Maps an unknown variant of [EndDate] to a value of type [T]. + * + * An instance of [EndDate] can contain an unknown variant if it was deserialized + * from data that doesn't match any known variant. For example, if the SDK is on an + * older version than the API, then the API may respond with new variants that the + * SDK is unaware of. + * + * @throws OrbInvalidDataException in the default implementation. + */ fun unknown(json: JsonValue?): T { throw OrbInvalidDataException("Unknown EndDate: $json") } } - class Deserializer : BaseDeserializer(EndDate::class) { + internal class Deserializer : BaseDeserializer(EndDate::class) { override fun ObjectCodec.deserialize(node: JsonNode): EndDate { val json = JsonValue.fromJsonNode(node) @@ -41179,7 +48950,7 @@ constructor( } } - class Serializer : BaseSerializer(EndDate::class) { + internal class Serializer : BaseSerializer(EndDate::class) { override fun serialize( value: EndDate, @@ -41282,18 +49053,32 @@ constructor( StartDate(billingCycleRelative = billingCycleRelative) } + /** + * An interface that defines how to map each variant of [StartDate] to a value of type + * [T]. + */ interface Visitor { fun visitDateTime(dateTime: OffsetDateTime): T fun visitBillingCycleRelative(billingCycleRelative: BillingCycleRelativeDate): T + /** + * Maps an unknown variant of [StartDate] to a value of type [T]. + * + * An instance of [StartDate] can contain an unknown variant if it was deserialized + * from data that doesn't match any known variant. For example, if the SDK is on an + * older version than the API, then the API may respond with new variants that the + * SDK is unaware of. + * + * @throws OrbInvalidDataException in the default implementation. + */ fun unknown(json: JsonValue?): T { throw OrbInvalidDataException("Unknown StartDate: $json") } } - class Deserializer : BaseDeserializer(StartDate::class) { + internal class Deserializer : BaseDeserializer(StartDate::class) { override fun ObjectCodec.deserialize(node: JsonNode): StartDate { val json = JsonValue.fromJsonNode(node) @@ -41309,7 +49094,7 @@ constructor( } } - class Serializer : BaseSerializer(StartDate::class) { + internal class Serializer : BaseSerializer(StartDate::class) { override fun serialize( value: StartDate, 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 c63bad47..54ce438c 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 @@ -440,7 +440,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [SubscriptionPriceIntervalsResponse]. */ + class Builder internal constructor() { private var id: JsonField? = null private var activePlanPhaseOrder: JsonField? = null @@ -1084,7 +1085,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AdjustmentInterval]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustment: JsonField? = null @@ -1341,6 +1343,10 @@ private constructor( @JvmStatic fun ofMaximum(maximum: MaximumAdjustment) = Adjustment(maximum = maximum) } + /** + * An interface that defines how to map each variant of [Adjustment] to a value of type + * [T]. + */ interface Visitor { fun visitAmountDiscount(amountDiscount: AmountDiscountAdjustment): T @@ -1353,12 +1359,22 @@ private constructor( fun visitMaximum(maximum: MaximumAdjustment): T + /** + * Maps an unknown variant of [Adjustment] to a value of type [T]. + * + * An instance of [Adjustment] can contain an unknown variant if it was deserialized + * from data that doesn't match any known variant. For example, if the SDK is on an + * older version than the API, then the API may respond with new variants that the + * SDK is unaware of. + * + * @throws OrbInvalidDataException in the default implementation. + */ fun unknown(json: JsonValue?): T { throw OrbInvalidDataException("Unknown Adjustment: $json") } } - class Deserializer : BaseDeserializer(Adjustment::class) { + internal class Deserializer : BaseDeserializer(Adjustment::class) { override fun ObjectCodec.deserialize(node: JsonNode): Adjustment { val json = JsonValue.fromJsonNode(node) @@ -1412,7 +1428,7 @@ private constructor( } } - class Serializer : BaseSerializer(Adjustment::class) { + internal class Serializer : BaseSerializer(Adjustment::class) { override fun serialize( value: Adjustment, @@ -1551,7 +1567,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AmountDiscountAdjustment]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustmentType: JsonField? = null @@ -1710,6 +1727,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -1720,21 +1745,53 @@ private constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { AMOUNT_DISCOUNT, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { AMOUNT_DISCOUNT, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { AMOUNT_DISCOUNT -> Value.AMOUNT_DISCOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { AMOUNT_DISCOUNT -> Known.AMOUNT_DISCOUNT @@ -1894,7 +1951,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [PercentageDiscountAdjustment]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustmentType: JsonField? = null @@ -2056,6 +2114,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -2066,21 +2132,53 @@ private constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { PERCENTAGE_DISCOUNT, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PERCENTAGE_DISCOUNT, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { PERCENTAGE_DISCOUNT -> Value.PERCENTAGE_DISCOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { PERCENTAGE_DISCOUNT -> Known.PERCENTAGE_DISCOUNT @@ -2239,7 +2337,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [UsageDiscountAdjustment]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustmentType: JsonField? = null @@ -2398,6 +2497,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -2408,21 +2515,53 @@ private constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { USAGE_DISCOUNT, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { USAGE_DISCOUNT, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { USAGE_DISCOUNT -> Value.USAGE_DISCOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { USAGE_DISCOUNT -> Known.USAGE_DISCOUNT @@ -2591,7 +2730,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MinimumAdjustment]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustmentType: JsonField? = null @@ -2758,6 +2898,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -2768,21 +2916,53 @@ private constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { MINIMUM, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { MINIMUM, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { MINIMUM -> Value.MINIMUM else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { MINIMUM -> Known.MINIMUM @@ -2941,7 +3121,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MaximumAdjustment]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustmentType: JsonField? = null @@ -3099,6 +3280,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -3109,21 +3298,53 @@ private constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { MAXIMUM, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { MAXIMUM, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { MAXIMUM -> Value.MAXIMUM else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { MAXIMUM -> Known.MAXIMUM @@ -3259,7 +3480,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleAnchorConfiguration]. */ + class Builder internal constructor() { private var day: JsonField? = null private var month: JsonField = JsonMissing.of() @@ -3483,6 +3705,10 @@ private constructor( @JvmStatic fun ofUsage(usage: UsageDiscountInterval) = DiscountInterval(usage = usage) } + /** + * An interface that defines how to map each variant of [DiscountInterval] to a value of + * type [T]. + */ interface Visitor { fun visitAmount(amount: AmountDiscountInterval): T @@ -3491,12 +3717,22 @@ private constructor( fun visitUsage(usage: UsageDiscountInterval): T + /** + * Maps an unknown variant of [DiscountInterval] to a value of type [T]. + * + * An instance of [DiscountInterval] can contain an unknown variant if it was + * deserialized from data that doesn't match any known variant. For example, if the SDK + * is on an older version than the API, then the API may respond with new variants that + * the SDK is unaware of. + * + * @throws OrbInvalidDataException in the default implementation. + */ fun unknown(json: JsonValue?): T { throw OrbInvalidDataException("Unknown DiscountInterval: $json") } } - class Deserializer : BaseDeserializer(DiscountInterval::class) { + internal class Deserializer : BaseDeserializer(DiscountInterval::class) { override fun ObjectCodec.deserialize(node: JsonNode): DiscountInterval { val json = JsonValue.fromJsonNode(node) @@ -3534,7 +3770,7 @@ private constructor( } } - class Serializer : BaseSerializer(DiscountInterval::class) { + internal class Serializer : BaseSerializer(DiscountInterval::class) { override fun serialize( value: DiscountInterval, @@ -3653,7 +3889,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AmountDiscountInterval]. */ + class Builder internal constructor() { private var amountDiscount: JsonField? = null private var appliesToPriceIds: JsonField>? = null @@ -3802,6 +4039,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -3811,21 +4056,52 @@ private constructor( @JvmStatic fun of(value: String) = DiscountType(JsonField.of(value)) } + /** An enum containing [DiscountType]'s known values. */ enum class Known { AMOUNT, } + /** + * An enum containing [DiscountType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DiscountType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { AMOUNT, + /** + * An enum member indicating that [DiscountType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { AMOUNT -> Value.AMOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { AMOUNT -> Known.AMOUNT @@ -3967,7 +4243,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [PercentageDiscountInterval]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var appliesToPriceIntervalIds: JsonField>? = null @@ -4122,6 +4399,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -4131,21 +4416,52 @@ private constructor( @JvmStatic fun of(value: String) = DiscountType(JsonField.of(value)) } + /** An enum containing [DiscountType]'s known values. */ enum class Known { PERCENTAGE, } + /** + * An enum containing [DiscountType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DiscountType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PERCENTAGE, + /** + * An enum member indicating that [DiscountType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { PERCENTAGE -> Value.PERCENTAGE else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { PERCENTAGE -> Known.PERCENTAGE @@ -4293,7 +4609,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [UsageDiscountInterval]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var appliesToPriceIntervalIds: JsonField>? = null @@ -4447,6 +4764,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -4456,21 +4781,52 @@ private constructor( @JvmStatic fun of(value: String) = DiscountType(JsonField.of(value)) } + /** An enum containing [DiscountType]'s known values. */ enum class Known { USAGE, } + /** + * An enum containing [DiscountType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DiscountType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { USAGE, + /** + * An enum member indicating that [DiscountType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { USAGE -> Value.USAGE else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { USAGE -> Known.USAGE @@ -4577,7 +4933,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [FixedFeeQuantitySchedule]. */ + class Builder internal constructor() { private var endDate: JsonField? = null private var priceId: JsonField? = null @@ -4759,7 +5116,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MaximumInterval]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var appliesToPriceIntervalIds: JsonField>? = null @@ -4942,7 +5300,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -5088,7 +5447,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MinimumInterval]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var appliesToPriceIntervalIds: JsonField>? = null @@ -5427,7 +5787,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [PriceInterval]. */ + class Builder internal constructor() { private var id: JsonField? = null private var billingCycleDay: JsonField? = null @@ -5978,6 +6339,36 @@ private constructor( fun price(maxGroupTieredPackage: Price.MaxGroupTieredPackagePrice) = price(Price.ofMaxGroupTieredPackage(maxGroupTieredPackage)) + /** + * The Price resource represents a price that can be billed on a subscription, resulting + * in a charge on an invoice in the form of an invoice line item. Prices take a quantity + * and determine an amount to bill. + * + * Orb supports a few different pricing models out of the box. Each of these models is + * serialized differently in a given Price object. The model_type field determines the + * key for the configuration object that is present. + * + * For more on the types of prices, see + * [the core concepts documentation](/core-concepts#plan-and-price) + */ + fun price(scalableMatrixWithUnitPricing: Price.ScalableMatrixWithUnitPricingPrice) = + price(Price.ofScalableMatrixWithUnitPricing(scalableMatrixWithUnitPricing)) + + /** + * The Price resource represents a price that can be billed on a subscription, resulting + * in a charge on an invoice in the form of an invoice line item. Prices take a quantity + * and determine an amount to bill. + * + * Orb supports a few different pricing models out of the box. Each of these models is + * serialized differently in a given Price object. The model_type field determines the + * key for the configuration object that is present. + * + * For more on the types of prices, see + * [the core concepts documentation](/core-concepts#plan-and-price) + */ + fun price(scalableMatrixWithTieredPricing: Price.ScalableMatrixWithTieredPricingPrice) = + price(Price.ofScalableMatrixWithTieredPricing(scalableMatrixWithTieredPricing)) + /** * The start date of the price interval. This is the date that Orb starts billing for * this price. @@ -6082,7 +6473,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [FixedFeeQuantityTransition]. */ + class Builder internal constructor() { private var effectiveDate: JsonField? = null private var priceId: JsonField? = null @@ -6238,7 +6630,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [RedeemedCoupon]. */ + class Builder internal constructor() { private var couponId: JsonField? = null private var endDate: JsonField? = null @@ -6321,6 +6714,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -6334,19 +6735,37 @@ private constructor( @JvmStatic fun of(value: String) = Status(JsonField.of(value)) } + /** An enum containing [Status]'s known values. */ enum class Known { ACTIVE, ENDED, UPCOMING, } + /** + * An enum containing [Status]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Status] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ACTIVE, ENDED, UPCOMING, + /** An enum member indicating that [Status] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { ACTIVE -> Value.ACTIVE @@ -6355,6 +6774,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { ACTIVE -> Known.ACTIVE @@ -6418,7 +6845,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TrialInfo]. */ + class Builder internal constructor() { private var endDate: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() 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 22045d45..fd2eeefb 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 @@ -21,6 +21,7 @@ import com.withorb.api.core.JsonField import com.withorb.api.core.JsonMissing import com.withorb.api.core.JsonValue import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.getOrThrow import com.withorb.api.core.http.Headers @@ -194,12 +195,12 @@ import kotlin.jvm.optionals.getOrNull * [Modifying subscriptions](/product-catalog/modifying-subscriptions#prorations-for-in-advance-fees). */ class SubscriptionSchedulePlanChangeParams -constructor( +private constructor( private val subscriptionId: String, private val body: SubscriptionSchedulePlanChangeBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun subscriptionId(): String = subscriptionId @@ -483,11 +484,11 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getBody(): SubscriptionSchedulePlanChangeBody = body + @JvmSynthetic internal fun _body(): SubscriptionSchedulePlanChangeBody = body - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun getPathParam(index: Int): String { return when (index) { @@ -972,7 +973,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [SubscriptionSchedulePlanChangeBody]. */ + class Builder internal constructor() { private var changeOption: JsonField? = null private var addAdjustments: JsonField>? = null @@ -1796,8 +1798,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [SubscriptionSchedulePlanChangeParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var subscriptionId: String? = null private var body: SubscriptionSchedulePlanChangeBody.Builder = @@ -2564,6 +2567,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -2577,19 +2588,39 @@ constructor( @JvmStatic fun of(value: String) = ChangeOption(JsonField.of(value)) } + /** An enum containing [ChangeOption]'s known values. */ enum class Known { REQUESTED_DATE, END_OF_SUBSCRIPTION_TERM, IMMEDIATE, } + /** + * An enum containing [ChangeOption]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ChangeOption] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { REQUESTED_DATE, END_OF_SUBSCRIPTION_TERM, IMMEDIATE, + /** + * An enum member indicating that [ChangeOption] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { REQUESTED_DATE -> Value.REQUESTED_DATE @@ -2598,6 +2629,14 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { REQUESTED_DATE -> Known.REQUESTED_DATE @@ -2717,7 +2756,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AddAdjustment]. */ + class Builder internal constructor() { private var adjustment: JsonField? = null private var endDate: JsonField = JsonMissing.of() @@ -2993,6 +3033,10 @@ constructor( fun ofNewMaximum(newMaximum: NewMaximum) = Adjustment(newMaximum = newMaximum) } + /** + * An interface that defines how to map each variant of [Adjustment] to a value of type + * [T]. + */ interface Visitor { fun visitNewPercentageDiscount(newPercentageDiscount: NewPercentageDiscount): T @@ -3005,12 +3049,22 @@ constructor( fun visitNewMaximum(newMaximum: NewMaximum): T + /** + * Maps an unknown variant of [Adjustment] to a value of type [T]. + * + * An instance of [Adjustment] can contain an unknown variant if it was deserialized + * from data that doesn't match any known variant. For example, if the SDK is on an + * older version than the API, then the API may respond with new variants that the + * SDK is unaware of. + * + * @throws OrbInvalidDataException in the default implementation. + */ fun unknown(json: JsonValue?): T { throw OrbInvalidDataException("Unknown Adjustment: $json") } } - class Deserializer : BaseDeserializer(Adjustment::class) { + internal class Deserializer : BaseDeserializer(Adjustment::class) { override fun ObjectCodec.deserialize(node: JsonNode): Adjustment { val json = JsonValue.fromJsonNode(node) @@ -3060,7 +3114,7 @@ constructor( } } - class Serializer : BaseSerializer(Adjustment::class) { + internal class Serializer : BaseSerializer(Adjustment::class) { override fun serialize( value: Adjustment, @@ -3164,7 +3218,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewPercentageDiscount]. */ + class Builder internal constructor() { private var adjustmentType: JsonField? = null private var appliesToPriceIds: JsonField>? = null @@ -3275,6 +3330,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -3285,21 +3348,53 @@ constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { PERCENTAGE_DISCOUNT, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PERCENTAGE_DISCOUNT, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { PERCENTAGE_DISCOUNT -> Value.PERCENTAGE_DISCOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { PERCENTAGE_DISCOUNT -> Known.PERCENTAGE_DISCOUNT @@ -3420,7 +3515,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewUsageDiscount]. */ + class Builder internal constructor() { private var adjustmentType: JsonField? = null private var appliesToPriceIds: JsonField>? = null @@ -3530,6 +3626,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -3540,21 +3644,53 @@ constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { USAGE_DISCOUNT, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { USAGE_DISCOUNT, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { USAGE_DISCOUNT -> Value.USAGE_DISCOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { USAGE_DISCOUNT -> Known.USAGE_DISCOUNT @@ -3675,7 +3811,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewAmountDiscount]. */ + class Builder internal constructor() { private var adjustmentType: JsonField? = null private var amountDiscount: JsonField? = null @@ -3785,6 +3922,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -3795,21 +3940,53 @@ constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { AMOUNT_DISCOUNT, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { AMOUNT_DISCOUNT, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { AMOUNT_DISCOUNT -> Value.AMOUNT_DISCOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { AMOUNT_DISCOUNT -> Known.AMOUNT_DISCOUNT @@ -3940,7 +4117,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewMinimum]. */ + class Builder internal constructor() { private var adjustmentType: JsonField? = null private var appliesToPriceIds: JsonField>? = null @@ -4058,6 +4236,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -4068,21 +4254,53 @@ constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { MINIMUM, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { MINIMUM, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { MINIMUM -> Value.MINIMUM else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { MINIMUM -> Known.MINIMUM @@ -4203,7 +4421,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewMaximum]. */ + class Builder internal constructor() { private var adjustmentType: JsonField? = null private var appliesToPriceIds: JsonField>? = null @@ -4312,6 +4531,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -4322,21 +4549,53 @@ constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { MAXIMUM, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { MAXIMUM, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { MAXIMUM -> Value.MAXIMUM else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { MAXIMUM -> Known.MAXIMUM @@ -4569,7 +4828,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AddPrice]. */ + class Builder internal constructor() { private var discounts: JsonField>? = null private var endDate: JsonField = JsonMissing.of() @@ -4993,7 +5253,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Discount]. */ + class Builder internal constructor() { private var discountType: JsonField? = null private var amountDiscount: JsonField = JsonMissing.of() @@ -5127,6 +5388,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -5140,19 +5409,41 @@ constructor( @JvmStatic fun of(value: String) = DiscountType(JsonField.of(value)) } + /** An enum containing [DiscountType]'s known values. */ enum class Known { PERCENTAGE, USAGE, AMOUNT, } + /** + * An enum containing [DiscountType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DiscountType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PERCENTAGE, USAGE, AMOUNT, + /** + * An enum member indicating that [DiscountType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { PERCENTAGE -> Value.PERCENTAGE @@ -5161,6 +5452,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { PERCENTAGE -> Known.PERCENTAGE @@ -5734,6 +6034,9 @@ constructor( ) = Price(newSubscriptionBulkWithProration = newSubscriptionBulkWithProration) } + /** + * An interface that defines how to map each variant of [Price] to a value of type [T]. + */ interface Visitor { fun visitNewSubscriptionUnit(newSubscriptionUnit: NewSubscriptionUnitPrice): T @@ -5799,12 +6102,22 @@ constructor( newSubscriptionBulkWithProration: NewSubscriptionBulkWithProrationPrice ): T + /** + * Maps an unknown variant of [Price] to a value of type [T]. + * + * An instance of [Price] can contain an unknown variant if it was deserialized from + * data that doesn't match any known variant. For example, if the SDK is on an older + * version than the API, then the API may respond with new variants that the SDK is + * unaware of. + * + * @throws OrbInvalidDataException in the default implementation. + */ fun unknown(json: JsonValue?): T { throw OrbInvalidDataException("Unknown Price: $json") } } - class Deserializer : BaseDeserializer(Price::class) { + internal class Deserializer : BaseDeserializer(Price::class) { override fun ObjectCodec.deserialize(node: JsonNode): Price { val json = JsonValue.fromJsonNode(node) @@ -6016,7 +6329,7 @@ constructor( } } - class Serializer : BaseSerializer(Price::class) { + internal class Serializer : BaseSerializer(Price::class) { override fun serialize( value: Price, @@ -6348,7 +6661,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionUnitPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var itemId: JsonField? = null @@ -6722,6 +7036,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -6742,6 +7064,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -6751,6 +7074,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -6758,9 +7090,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -6772,6 +7115,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -6804,6 +7156,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -6814,21 +7174,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { UNIT, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { UNIT, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { UNIT -> Value.UNIT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { UNIT -> Known.UNIT @@ -6891,7 +7282,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [UnitConfig]. */ + class Builder internal constructor() { private var unitAmount: JsonField? = null private var additionalProperties: MutableMap = @@ -7015,7 +7407,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -7083,6 +7476,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -7095,17 +7496,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -7113,6 +7537,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -7211,7 +7644,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -7280,6 +7714,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -7292,17 +7734,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -7310,6 +7775,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -7385,7 +7859,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -7737,7 +8212,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionPackagePrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var itemId: JsonField? = null @@ -8113,6 +8589,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -8133,6 +8617,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -8142,6 +8627,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -8149,9 +8643,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -8163,6 +8668,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -8195,6 +8709,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -8205,21 +8727,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { PACKAGE, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PACKAGE, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { PACKAGE -> Value.PACKAGE else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { PACKAGE -> Known.PACKAGE @@ -8300,7 +8853,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [PackageConfig]. */ + class Builder internal constructor() { private var packageAmount: JsonField? = null private var packageSize: JsonField? = null @@ -8442,7 +8996,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -8510,6 +9065,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -8522,17 +9085,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -8540,6 +9126,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -8638,7 +9233,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -8707,6 +9303,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -8719,17 +9323,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -8737,6 +9364,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -8812,7 +9448,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -9164,7 +9801,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionMatrixPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var itemId: JsonField? = null @@ -9540,6 +10178,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -9560,6 +10206,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -9569,6 +10216,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -9576,9 +10232,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -9590,6 +10257,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -9689,7 +10365,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MatrixConfig]. */ + class Builder internal constructor() { private var defaultUnitAmount: JsonField? = null private var dimensions: JsonField>? = null @@ -9862,7 +10539,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MatrixValue]. */ + class Builder internal constructor() { private var dimensionValues: JsonField>? = null private var unitAmount: JsonField? = null @@ -9996,6 +10674,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -10006,21 +10692,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { MATRIX, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { MATRIX, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { MATRIX -> Value.MATRIX else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { MATRIX -> Known.MATRIX @@ -10099,7 +10816,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -10167,6 +10885,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -10179,17 +10905,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -10197,6 +10946,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -10295,7 +11053,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -10364,6 +11123,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -10376,17 +11143,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -10394,6 +11184,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -10469,7 +11268,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -10821,7 +11621,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionTieredPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var itemId: JsonField? = null @@ -11197,6 +11998,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -11217,6 +12026,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -11226,6 +12036,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -11233,9 +12052,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -11247,6 +12077,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -11279,6 +12118,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -11289,21 +12136,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { TIERED, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { TIERED, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { TIERED -> Value.TIERED else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { TIERED -> Known.TIERED @@ -11366,7 +12244,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TieredConfig]. */ + class Builder internal constructor() { private var tiers: JsonField>? = null private var additionalProperties: MutableMap = @@ -11506,7 +12385,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Tier]. */ + class Builder internal constructor() { private var firstUnit: JsonField? = null private var unitAmount: JsonField? = null @@ -11694,7 +12574,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -11762,6 +12643,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -11774,17 +12663,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -11792,6 +12704,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -11890,7 +12811,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -11959,6 +12881,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -11971,17 +12901,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -11989,6 +12942,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -12064,7 +13026,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -12417,7 +13380,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionTieredBpsPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var itemId: JsonField? = null @@ -12794,6 +13758,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -12814,6 +13786,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -12823,6 +13796,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -12830,9 +13812,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -12844,6 +13837,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -12876,6 +13878,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -12886,21 +13896,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { TIERED_BPS, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { TIERED_BPS, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { TIERED_BPS -> Value.TIERED_BPS else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { TIERED_BPS -> Known.TIERED_BPS @@ -12969,7 +14010,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TieredBpsConfig]. */ + class Builder internal constructor() { private var tiers: JsonField>? = null private var additionalProperties: MutableMap = @@ -13120,7 +14162,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Tier]. */ + class Builder internal constructor() { private var bps: JsonField? = null private var minimumAmount: JsonField? = null @@ -13304,7 +14347,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -13372,6 +14416,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -13384,17 +14436,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -13402,6 +14477,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -13500,7 +14584,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -13569,6 +14654,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -13581,17 +14674,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -13599,6 +14715,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -13674,7 +14799,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -14026,7 +15152,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionBpsPrice]. */ + class Builder internal constructor() { private var bpsConfig: JsonField? = null private var cadence: JsonField? = null @@ -14445,7 +15572,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BpsConfig]. */ + class Builder internal constructor() { private var bps: JsonField? = null private var perUnitMaximum: JsonField = JsonMissing.of() @@ -14533,6 +15661,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -14553,6 +15689,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -14562,6 +15699,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -14569,9 +15715,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -14583,6 +15740,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -14615,6 +15781,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -14625,21 +15799,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { BPS, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { BPS, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { BPS -> Value.BPS else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { BPS -> Known.BPS @@ -14718,7 +15923,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -14786,6 +15992,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -14798,17 +16012,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -14816,6 +16053,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -14914,7 +16160,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -14983,6 +16230,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -14995,17 +16250,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -15013,6 +16291,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -15088,7 +16375,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -15440,7 +16728,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionBulkBpsPrice]. */ + class Builder internal constructor() { private var bulkBpsConfig: JsonField? = null private var cadence: JsonField? = null @@ -15856,7 +17145,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BulkBpsConfig]. */ + class Builder internal constructor() { private var tiers: JsonField>? = null private var additionalProperties: MutableMap = @@ -15994,7 +17284,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Tier]. */ + class Builder internal constructor() { private var bps: JsonField? = null private var maximumAmount: JsonField = JsonMissing.of() @@ -16116,6 +17407,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -16136,6 +17435,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -16145,6 +17445,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -16152,9 +17461,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -16166,6 +17486,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -16198,6 +17527,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -16208,21 +17545,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { BULK_BPS, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { BULK_BPS, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { BULK_BPS -> Value.BULK_BPS else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { BULK_BPS -> Known.BULK_BPS @@ -16301,7 +17669,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -16369,6 +17738,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -16381,17 +17758,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -16399,6 +17799,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -16497,7 +17906,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -16566,6 +17976,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -16578,17 +17996,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -16596,6 +18037,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -16671,7 +18121,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -17023,7 +18474,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionBulkPrice]. */ + class Builder internal constructor() { private var bulkConfig: JsonField? = null private var cadence: JsonField? = null @@ -17431,7 +18883,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BulkConfig]. */ + class Builder internal constructor() { private var tiers: JsonField>? = null private var additionalProperties: MutableMap = @@ -17549,7 +19002,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Tier]. */ + class Builder internal constructor() { private var unitAmount: JsonField? = null private var maximumUnits: JsonField = JsonMissing.of() @@ -17665,6 +19119,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -17685,6 +19147,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -17694,6 +19157,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -17701,9 +19173,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -17715,6 +19198,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -17747,6 +19239,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -17757,21 +19257,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { BULK, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { BULK, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { BULK -> Value.BULK else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { BULK -> Known.BULK @@ -17850,7 +19381,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -17918,6 +19450,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -17930,17 +19470,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -17948,6 +19511,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -18046,7 +19618,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -18115,6 +19688,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -18127,17 +19708,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -18145,6 +19749,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -18220,7 +19833,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -18575,7 +20189,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionThresholdTotalAmountPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var itemId: JsonField? = null @@ -18959,6 +20574,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -18979,6 +20602,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -18988,6 +20612,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -18995,9 +20628,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -19009,6 +20653,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -19041,6 +20694,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -19051,21 +20712,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { THRESHOLD_TOTAL_AMOUNT, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { THRESHOLD_TOTAL_AMOUNT, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { THRESHOLD_TOTAL_AMOUNT -> Value.THRESHOLD_TOTAL_AMOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { THRESHOLD_TOTAL_AMOUNT -> Known.THRESHOLD_TOTAL_AMOUNT @@ -19116,7 +20808,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [ThresholdTotalAmountConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -19229,7 +20922,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -19297,6 +20991,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -19309,17 +21011,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -19327,6 +21052,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -19425,7 +21159,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -19494,6 +21229,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -19506,17 +21249,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -19524,6 +21290,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -19599,7 +21374,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -19952,7 +21728,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionTieredPackagePrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var itemId: JsonField? = null @@ -20330,6 +22107,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -20350,6 +22135,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -20359,6 +22145,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -20366,9 +22161,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -20380,6 +22186,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -20412,6 +22227,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -20422,21 +22245,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { TIERED_PACKAGE, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { TIERED_PACKAGE, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { TIERED_PACKAGE -> Value.TIERED_PACKAGE else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { TIERED_PACKAGE -> Known.TIERED_PACKAGE @@ -20487,7 +22341,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TieredPackageConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -20599,7 +22454,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -20667,6 +22523,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -20679,17 +22543,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -20697,6 +22584,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -20795,7 +22691,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -20864,6 +22761,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -20876,17 +22781,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -20894,6 +22822,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -20969,7 +22906,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -21324,7 +23262,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionTieredWithMinimumPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var itemId: JsonField? = null @@ -21705,6 +23644,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -21725,6 +23672,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -21734,6 +23682,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -21741,9 +23698,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -21755,6 +23723,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -21787,6 +23764,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -21797,21 +23782,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { TIERED_WITH_MINIMUM, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { TIERED_WITH_MINIMUM, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { TIERED_WITH_MINIMUM -> Value.TIERED_WITH_MINIMUM else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { TIERED_WITH_MINIMUM -> Known.TIERED_WITH_MINIMUM @@ -21862,7 +23878,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TieredWithMinimumConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -21975,7 +23992,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -22043,6 +24061,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -22055,17 +24081,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -22073,6 +24122,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -22171,7 +24229,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -22240,6 +24299,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -22252,17 +24319,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -22270,6 +24360,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -22345,7 +24444,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -22700,7 +24800,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionUnitWithPercentPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var itemId: JsonField? = null @@ -23078,6 +25179,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -23098,6 +25207,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -23107,6 +25217,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -23114,9 +25233,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -23128,6 +25258,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -23160,6 +25299,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -23170,21 +25317,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { UNIT_WITH_PERCENT, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { UNIT_WITH_PERCENT, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { UNIT_WITH_PERCENT -> Value.UNIT_WITH_PERCENT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { UNIT_WITH_PERCENT -> Known.UNIT_WITH_PERCENT @@ -23235,7 +25413,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [UnitWithPercentConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -23347,7 +25526,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -23415,6 +25595,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -23427,17 +25615,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -23445,6 +25656,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -23543,7 +25763,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -23612,6 +25833,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -23624,17 +25853,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -23642,6 +25894,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -23717,7 +25978,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -24072,7 +26334,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionPackageWithAllocationPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var itemId: JsonField? = null @@ -24461,6 +26724,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -24481,6 +26752,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -24490,6 +26762,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -24497,9 +26778,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -24511,6 +26803,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -24543,6 +26844,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -24553,21 +26862,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { PACKAGE_WITH_ALLOCATION, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PACKAGE_WITH_ALLOCATION, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { PACKAGE_WITH_ALLOCATION -> Value.PACKAGE_WITH_ALLOCATION else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { PACKAGE_WITH_ALLOCATION -> Known.PACKAGE_WITH_ALLOCATION @@ -24618,7 +26958,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [PackageWithAllocationConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -24732,7 +27073,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -24800,6 +27142,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -24812,17 +27162,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -24830,6 +27203,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -24928,7 +27310,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -24997,6 +27380,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -25009,17 +27400,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -25027,6 +27441,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -25102,7 +27525,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -25457,7 +27881,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionTierWithProrationPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var itemId: JsonField? = null @@ -25840,6 +28265,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -25860,6 +28293,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -25869,6 +28303,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -25876,9 +28319,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -25890,6 +28344,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -25922,6 +28385,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -25932,21 +28403,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { TIERED_WITH_PRORATION, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { TIERED_WITH_PRORATION, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { TIERED_WITH_PRORATION -> Value.TIERED_WITH_PRORATION else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { TIERED_WITH_PRORATION -> Known.TIERED_WITH_PRORATION @@ -25997,7 +28499,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TieredWithProrationConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -26110,7 +28613,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -26178,6 +28682,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -26190,17 +28702,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -26208,6 +28743,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -26306,7 +28850,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -26375,6 +28920,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -26387,17 +28940,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -26405,6 +28981,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -26480,7 +29065,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -26835,7 +29421,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionUnitWithProrationPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var itemId: JsonField? = null @@ -27216,6 +29803,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -27236,6 +29831,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -27245,6 +29841,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -27252,9 +29857,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -27266,6 +29882,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -27298,6 +29923,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -27308,21 +29941,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { UNIT_WITH_PRORATION, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { UNIT_WITH_PRORATION, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { UNIT_WITH_PRORATION -> Value.UNIT_WITH_PRORATION else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { UNIT_WITH_PRORATION -> Known.UNIT_WITH_PRORATION @@ -27373,7 +30037,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [UnitWithProrationConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -27486,7 +30151,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -27554,6 +30220,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -27566,17 +30240,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -27584,6 +30281,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -27682,7 +30388,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -27751,6 +30458,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -27763,17 +30478,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -27781,6 +30519,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -27856,7 +30603,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -28211,7 +30959,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionGroupedAllocationPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var groupedAllocationConfig: JsonField? = null @@ -28592,6 +31341,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -28612,6 +31369,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -28621,6 +31379,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -28628,9 +31395,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -28642,6 +31420,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -28697,7 +31484,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [GroupedAllocationConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -28759,6 +31547,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -28769,21 +31565,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { GROUPED_ALLOCATION, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { GROUPED_ALLOCATION, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { GROUPED_ALLOCATION -> Value.GROUPED_ALLOCATION else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { GROUPED_ALLOCATION -> Known.GROUPED_ALLOCATION @@ -28862,7 +31689,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -28930,6 +31758,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -28942,17 +31778,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -28960,6 +31819,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -29058,7 +31926,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -29127,6 +31996,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -29139,17 +32016,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -29157,6 +32057,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -29232,7 +32141,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -29590,7 +32500,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionGroupedWithProratedMinimumPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var groupedWithProratedMinimumConfig: @@ -29990,6 +32901,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -30010,6 +32929,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -30019,6 +32939,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -30026,9 +32955,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -30040,6 +32980,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -30095,7 +33044,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [GroupedWithProratedMinimumConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -30158,6 +33108,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -30169,21 +33127,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { GROUPED_WITH_PRORATED_MINIMUM, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { GROUPED_WITH_PRORATED_MINIMUM, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { GROUPED_WITH_PRORATED_MINIMUM -> Value.GROUPED_WITH_PRORATED_MINIMUM else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { GROUPED_WITH_PRORATED_MINIMUM -> Known.GROUPED_WITH_PRORATED_MINIMUM @@ -30262,7 +33251,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -30330,6 +33320,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -30342,17 +33340,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -30360,6 +33381,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -30458,7 +33488,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -30527,6 +33558,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -30539,17 +33578,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -30557,6 +33619,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -30632,7 +33703,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -30987,7 +34059,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionBulkWithProrationPrice]. */ + class Builder internal constructor() { private var bulkWithProrationConfig: JsonField? = null private var cadence: JsonField? = null @@ -31390,7 +34463,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BulkWithProrationConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -31453,6 +34527,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -31473,6 +34555,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -31482,6 +34565,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -31489,9 +34581,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -31503,6 +34606,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -31535,6 +34647,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -31545,21 +34665,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { BULK_WITH_PRORATION, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { BULK_WITH_PRORATION, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { BULK_WITH_PRORATION -> Value.BULK_WITH_PRORATION else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { BULK_WITH_PRORATION -> Known.BULK_WITH_PRORATION @@ -31638,7 +34789,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -31706,6 +34858,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -31718,17 +34878,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -31736,6 +34919,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -31834,7 +35026,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -31903,6 +35096,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -31915,17 +35116,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -31933,6 +35157,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -32008,7 +35241,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -32107,6 +35341,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -32120,19 +35362,41 @@ constructor( @JvmStatic fun of(value: String) = BillingCycleAlignment(JsonField.of(value)) } + /** An enum containing [BillingCycleAlignment]'s known values. */ enum class Known { UNCHANGED, PLAN_CHANGE_DATE, START_OF_MONTH, } + /** + * An enum containing [BillingCycleAlignment]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [BillingCycleAlignment] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { UNCHANGED, PLAN_CHANGE_DATE, START_OF_MONTH, + /** + * An enum member indicating that [BillingCycleAlignment] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { UNCHANGED -> Value.UNCHANGED @@ -32141,6 +35405,14 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { UNCHANGED -> Known.UNCHANGED @@ -32241,7 +35513,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleAnchorConfiguration]. */ + class Builder internal constructor() { private var day: JsonField? = null private var month: JsonField = JsonMissing.of() @@ -32411,7 +35684,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [RemoveAdjustment]. */ + class Builder internal constructor() { private var adjustmentId: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -32526,7 +35800,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [RemovePrice]. */ + class Builder internal constructor() { private var externalPriceId: JsonField = JsonMissing.of() private var priceId: JsonField = JsonMissing.of() @@ -32660,7 +35935,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [ReplaceAdjustment]. */ + class Builder internal constructor() { private var adjustment: JsonField? = null private var replacesAdjustmentId: JsonField? = null @@ -32878,6 +36154,10 @@ constructor( fun ofNewMaximum(newMaximum: NewMaximum) = Adjustment(newMaximum = newMaximum) } + /** + * An interface that defines how to map each variant of [Adjustment] to a value of type + * [T]. + */ interface Visitor { fun visitNewPercentageDiscount(newPercentageDiscount: NewPercentageDiscount): T @@ -32890,12 +36170,22 @@ constructor( fun visitNewMaximum(newMaximum: NewMaximum): T + /** + * Maps an unknown variant of [Adjustment] to a value of type [T]. + * + * An instance of [Adjustment] can contain an unknown variant if it was deserialized + * from data that doesn't match any known variant. For example, if the SDK is on an + * older version than the API, then the API may respond with new variants that the + * SDK is unaware of. + * + * @throws OrbInvalidDataException in the default implementation. + */ fun unknown(json: JsonValue?): T { throw OrbInvalidDataException("Unknown Adjustment: $json") } } - class Deserializer : BaseDeserializer(Adjustment::class) { + internal class Deserializer : BaseDeserializer(Adjustment::class) { override fun ObjectCodec.deserialize(node: JsonNode): Adjustment { val json = JsonValue.fromJsonNode(node) @@ -32945,7 +36235,7 @@ constructor( } } - class Serializer : BaseSerializer(Adjustment::class) { + internal class Serializer : BaseSerializer(Adjustment::class) { override fun serialize( value: Adjustment, @@ -33049,7 +36339,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewPercentageDiscount]. */ + class Builder internal constructor() { private var adjustmentType: JsonField? = null private var appliesToPriceIds: JsonField>? = null @@ -33160,6 +36451,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -33170,21 +36469,53 @@ constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { PERCENTAGE_DISCOUNT, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PERCENTAGE_DISCOUNT, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { PERCENTAGE_DISCOUNT -> Value.PERCENTAGE_DISCOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { PERCENTAGE_DISCOUNT -> Known.PERCENTAGE_DISCOUNT @@ -33305,7 +36636,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewUsageDiscount]. */ + class Builder internal constructor() { private var adjustmentType: JsonField? = null private var appliesToPriceIds: JsonField>? = null @@ -33415,6 +36747,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -33425,21 +36765,53 @@ constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { USAGE_DISCOUNT, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { USAGE_DISCOUNT, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { USAGE_DISCOUNT -> Value.USAGE_DISCOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { USAGE_DISCOUNT -> Known.USAGE_DISCOUNT @@ -33560,7 +36932,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewAmountDiscount]. */ + class Builder internal constructor() { private var adjustmentType: JsonField? = null private var amountDiscount: JsonField? = null @@ -33670,6 +37043,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -33680,21 +37061,53 @@ constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { AMOUNT_DISCOUNT, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { AMOUNT_DISCOUNT, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { AMOUNT_DISCOUNT -> Value.AMOUNT_DISCOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { AMOUNT_DISCOUNT -> Known.AMOUNT_DISCOUNT @@ -33825,7 +37238,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewMinimum]. */ + class Builder internal constructor() { private var adjustmentType: JsonField? = null private var appliesToPriceIds: JsonField>? = null @@ -33943,6 +37357,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -33953,21 +37375,53 @@ constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { MINIMUM, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { MINIMUM, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { MINIMUM -> Value.MINIMUM else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { MINIMUM -> Known.MINIMUM @@ -34088,7 +37542,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewMaximum]. */ + class Builder internal constructor() { private var adjustmentType: JsonField? = null private var appliesToPriceIds: JsonField>? = null @@ -34197,6 +37652,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -34207,21 +37670,53 @@ constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { MAXIMUM, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { MAXIMUM, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { MAXIMUM -> Value.MAXIMUM else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { MAXIMUM -> Known.MAXIMUM @@ -34430,7 +37925,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [ReplacePrice]. */ + class Builder internal constructor() { private var replacesPriceId: JsonField? = null private var discounts: JsonField>? = null @@ -34820,7 +38316,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Discount]. */ + class Builder internal constructor() { private var discountType: JsonField? = null private var amountDiscount: JsonField = JsonMissing.of() @@ -34954,6 +38451,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -34967,19 +38472,41 @@ constructor( @JvmStatic fun of(value: String) = DiscountType(JsonField.of(value)) } + /** An enum containing [DiscountType]'s known values. */ enum class Known { PERCENTAGE, USAGE, AMOUNT, } + /** + * An enum containing [DiscountType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DiscountType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PERCENTAGE, USAGE, AMOUNT, + /** + * An enum member indicating that [DiscountType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { PERCENTAGE -> Value.PERCENTAGE @@ -34988,6 +38515,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { PERCENTAGE -> Known.PERCENTAGE @@ -35561,6 +39097,9 @@ constructor( ) = Price(newSubscriptionBulkWithProration = newSubscriptionBulkWithProration) } + /** + * An interface that defines how to map each variant of [Price] to a value of type [T]. + */ interface Visitor { fun visitNewSubscriptionUnit(newSubscriptionUnit: NewSubscriptionUnitPrice): T @@ -35626,12 +39165,22 @@ constructor( newSubscriptionBulkWithProration: NewSubscriptionBulkWithProrationPrice ): T + /** + * Maps an unknown variant of [Price] to a value of type [T]. + * + * An instance of [Price] can contain an unknown variant if it was deserialized from + * data that doesn't match any known variant. For example, if the SDK is on an older + * version than the API, then the API may respond with new variants that the SDK is + * unaware of. + * + * @throws OrbInvalidDataException in the default implementation. + */ fun unknown(json: JsonValue?): T { throw OrbInvalidDataException("Unknown Price: $json") } } - class Deserializer : BaseDeserializer(Price::class) { + internal class Deserializer : BaseDeserializer(Price::class) { override fun ObjectCodec.deserialize(node: JsonNode): Price { val json = JsonValue.fromJsonNode(node) @@ -35843,7 +39392,7 @@ constructor( } } - class Serializer : BaseSerializer(Price::class) { + internal class Serializer : BaseSerializer(Price::class) { override fun serialize( value: Price, @@ -36175,7 +39724,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionUnitPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var itemId: JsonField? = null @@ -36549,6 +40099,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -36569,6 +40127,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -36578,6 +40137,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -36585,9 +40153,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -36599,6 +40178,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -36631,6 +40219,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -36641,21 +40237,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { UNIT, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { UNIT, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { UNIT -> Value.UNIT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { UNIT -> Known.UNIT @@ -36718,7 +40345,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [UnitConfig]. */ + class Builder internal constructor() { private var unitAmount: JsonField? = null private var additionalProperties: MutableMap = @@ -36842,7 +40470,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -36910,6 +40539,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -36922,17 +40559,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -36940,6 +40600,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -37038,7 +40707,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -37107,6 +40777,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -37119,17 +40797,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -37137,6 +40838,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -37212,7 +40922,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -37564,7 +41275,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionPackagePrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var itemId: JsonField? = null @@ -37940,6 +41652,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -37960,6 +41680,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -37969,6 +41690,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -37976,9 +41706,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -37990,6 +41731,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -38022,6 +41772,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -38032,21 +41790,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { PACKAGE, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PACKAGE, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { PACKAGE -> Value.PACKAGE else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { PACKAGE -> Known.PACKAGE @@ -38127,7 +41916,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [PackageConfig]. */ + class Builder internal constructor() { private var packageAmount: JsonField? = null private var packageSize: JsonField? = null @@ -38269,7 +42059,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -38337,6 +42128,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -38349,17 +42148,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -38367,6 +42189,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -38465,7 +42296,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -38534,6 +42366,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -38546,17 +42386,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -38564,6 +42427,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -38639,7 +42511,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -38991,7 +42864,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionMatrixPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var itemId: JsonField? = null @@ -39367,6 +43241,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -39387,6 +43269,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -39396,6 +43279,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -39403,9 +43295,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -39417,6 +43320,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -39516,7 +43428,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MatrixConfig]. */ + class Builder internal constructor() { private var defaultUnitAmount: JsonField? = null private var dimensions: JsonField>? = null @@ -39689,7 +43602,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MatrixValue]. */ + class Builder internal constructor() { private var dimensionValues: JsonField>? = null private var unitAmount: JsonField? = null @@ -39823,6 +43737,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -39833,21 +43755,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { MATRIX, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { MATRIX, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { MATRIX -> Value.MATRIX else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { MATRIX -> Known.MATRIX @@ -39926,7 +43879,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -39994,6 +43948,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -40006,17 +43968,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -40024,6 +44009,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -40122,7 +44116,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -40191,6 +44186,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -40203,17 +44206,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -40221,6 +44247,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -40296,7 +44331,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -40648,7 +44684,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionTieredPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var itemId: JsonField? = null @@ -41024,6 +45061,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -41044,6 +45089,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -41053,6 +45099,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -41060,9 +45115,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -41074,6 +45140,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -41106,6 +45181,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -41116,21 +45199,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { TIERED, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { TIERED, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { TIERED -> Value.TIERED else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { TIERED -> Known.TIERED @@ -41193,7 +45307,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TieredConfig]. */ + class Builder internal constructor() { private var tiers: JsonField>? = null private var additionalProperties: MutableMap = @@ -41333,7 +45448,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Tier]. */ + class Builder internal constructor() { private var firstUnit: JsonField? = null private var unitAmount: JsonField? = null @@ -41521,7 +45637,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -41589,6 +45706,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -41601,17 +45726,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -41619,6 +45767,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -41717,7 +45874,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -41786,6 +45944,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -41798,17 +45964,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -41816,6 +46005,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -41891,7 +46089,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -42244,7 +46443,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionTieredBpsPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var itemId: JsonField? = null @@ -42621,6 +46821,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -42641,6 +46849,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -42650,6 +46859,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -42657,9 +46875,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -42671,6 +46900,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -42703,6 +46941,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -42713,21 +46959,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { TIERED_BPS, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { TIERED_BPS, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { TIERED_BPS -> Value.TIERED_BPS else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { TIERED_BPS -> Known.TIERED_BPS @@ -42796,7 +47073,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TieredBpsConfig]. */ + class Builder internal constructor() { private var tiers: JsonField>? = null private var additionalProperties: MutableMap = @@ -42947,7 +47225,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Tier]. */ + class Builder internal constructor() { private var bps: JsonField? = null private var minimumAmount: JsonField? = null @@ -43131,7 +47410,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -43199,6 +47479,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -43211,17 +47499,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -43229,6 +47540,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -43327,7 +47647,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -43396,6 +47717,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -43408,17 +47737,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -43426,6 +47778,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -43501,7 +47862,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -43853,7 +48215,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionBpsPrice]. */ + class Builder internal constructor() { private var bpsConfig: JsonField? = null private var cadence: JsonField? = null @@ -44272,7 +48635,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BpsConfig]. */ + class Builder internal constructor() { private var bps: JsonField? = null private var perUnitMaximum: JsonField = JsonMissing.of() @@ -44360,6 +48724,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -44380,6 +48752,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -44389,6 +48762,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -44396,9 +48778,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -44410,6 +48803,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -44442,6 +48844,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -44452,21 +48862,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { BPS, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { BPS, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { BPS -> Value.BPS else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { BPS -> Known.BPS @@ -44545,7 +48986,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -44613,6 +49055,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -44625,17 +49075,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -44643,6 +49116,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -44741,7 +49223,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -44810,6 +49293,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -44822,17 +49313,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -44840,6 +49354,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -44915,7 +49438,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -45267,7 +49791,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionBulkBpsPrice]. */ + class Builder internal constructor() { private var bulkBpsConfig: JsonField? = null private var cadence: JsonField? = null @@ -45683,7 +50208,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BulkBpsConfig]. */ + class Builder internal constructor() { private var tiers: JsonField>? = null private var additionalProperties: MutableMap = @@ -45821,7 +50347,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Tier]. */ + class Builder internal constructor() { private var bps: JsonField? = null private var maximumAmount: JsonField = JsonMissing.of() @@ -45943,6 +50470,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -45963,6 +50498,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -45972,6 +50508,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -45979,9 +50524,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -45993,6 +50549,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -46025,6 +50590,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -46035,21 +50608,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { BULK_BPS, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { BULK_BPS, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { BULK_BPS -> Value.BULK_BPS else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { BULK_BPS -> Known.BULK_BPS @@ -46128,7 +50732,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -46196,6 +50801,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -46208,17 +50821,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -46226,6 +50862,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -46324,7 +50969,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -46393,6 +51039,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -46405,17 +51059,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -46423,6 +51100,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -46498,7 +51184,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -46850,7 +51537,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionBulkPrice]. */ + class Builder internal constructor() { private var bulkConfig: JsonField? = null private var cadence: JsonField? = null @@ -47258,7 +51946,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BulkConfig]. */ + class Builder internal constructor() { private var tiers: JsonField>? = null private var additionalProperties: MutableMap = @@ -47376,7 +52065,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Tier]. */ + class Builder internal constructor() { private var unitAmount: JsonField? = null private var maximumUnits: JsonField = JsonMissing.of() @@ -47492,6 +52182,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -47512,6 +52210,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -47521,6 +52220,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -47528,9 +52236,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -47542,6 +52261,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -47574,6 +52302,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -47584,21 +52320,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { BULK, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { BULK, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { BULK -> Value.BULK else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { BULK -> Known.BULK @@ -47677,7 +52444,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -47745,6 +52513,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -47757,17 +52533,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -47775,6 +52574,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -47873,7 +52681,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -47942,6 +52751,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -47954,17 +52771,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -47972,6 +52812,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -48047,7 +52896,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -48402,7 +53252,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionThresholdTotalAmountPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var itemId: JsonField? = null @@ -48786,6 +53637,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -48806,6 +53665,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -48815,6 +53675,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -48822,9 +53691,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -48836,6 +53716,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -48868,6 +53757,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -48878,21 +53775,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { THRESHOLD_TOTAL_AMOUNT, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { THRESHOLD_TOTAL_AMOUNT, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { THRESHOLD_TOTAL_AMOUNT -> Value.THRESHOLD_TOTAL_AMOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { THRESHOLD_TOTAL_AMOUNT -> Known.THRESHOLD_TOTAL_AMOUNT @@ -48943,7 +53871,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [ThresholdTotalAmountConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -49056,7 +53985,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -49124,6 +54054,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -49136,17 +54074,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -49154,6 +54115,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -49252,7 +54222,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -49321,6 +54292,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -49333,17 +54312,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -49351,6 +54353,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -49426,7 +54437,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -49779,7 +54791,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionTieredPackagePrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var itemId: JsonField? = null @@ -50157,6 +55170,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -50177,6 +55198,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -50186,6 +55208,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -50193,9 +55224,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -50207,6 +55249,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -50239,6 +55290,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -50249,21 +55308,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { TIERED_PACKAGE, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { TIERED_PACKAGE, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { TIERED_PACKAGE -> Value.TIERED_PACKAGE else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { TIERED_PACKAGE -> Known.TIERED_PACKAGE @@ -50314,7 +55404,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TieredPackageConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -50426,7 +55517,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -50494,6 +55586,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -50506,17 +55606,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -50524,6 +55647,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -50622,7 +55754,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -50691,6 +55824,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -50703,17 +55844,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -50721,6 +55885,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -50796,7 +55969,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -51151,7 +56325,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionTieredWithMinimumPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var itemId: JsonField? = null @@ -51532,6 +56707,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -51552,6 +56735,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -51561,6 +56745,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -51568,9 +56761,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -51582,6 +56786,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -51614,6 +56827,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -51624,21 +56845,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { TIERED_WITH_MINIMUM, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { TIERED_WITH_MINIMUM, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { TIERED_WITH_MINIMUM -> Value.TIERED_WITH_MINIMUM else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { TIERED_WITH_MINIMUM -> Known.TIERED_WITH_MINIMUM @@ -51689,7 +56941,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TieredWithMinimumConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -51802,7 +57055,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -51870,6 +57124,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -51882,17 +57144,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -51900,6 +57185,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -51998,7 +57292,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -52067,6 +57362,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -52079,17 +57382,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -52097,6 +57423,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -52172,7 +57507,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -52527,7 +57863,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionUnitWithPercentPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var itemId: JsonField? = null @@ -52905,6 +58242,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -52925,6 +58270,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -52934,6 +58280,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -52941,9 +58296,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -52955,6 +58321,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -52987,6 +58362,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -52997,21 +58380,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { UNIT_WITH_PERCENT, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { UNIT_WITH_PERCENT, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { UNIT_WITH_PERCENT -> Value.UNIT_WITH_PERCENT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { UNIT_WITH_PERCENT -> Known.UNIT_WITH_PERCENT @@ -53062,7 +58476,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [UnitWithPercentConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -53174,7 +58589,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -53242,6 +58658,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -53254,17 +58678,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -53272,6 +58719,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -53370,7 +58826,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -53439,6 +58896,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -53451,17 +58916,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -53469,6 +58957,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -53544,7 +59041,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -53899,7 +59397,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionPackageWithAllocationPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var itemId: JsonField? = null @@ -54288,6 +59787,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -54308,6 +59815,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -54317,6 +59825,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -54324,9 +59841,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -54338,6 +59866,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -54370,6 +59907,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -54380,21 +59925,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { PACKAGE_WITH_ALLOCATION, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PACKAGE_WITH_ALLOCATION, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { PACKAGE_WITH_ALLOCATION -> Value.PACKAGE_WITH_ALLOCATION else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { PACKAGE_WITH_ALLOCATION -> Known.PACKAGE_WITH_ALLOCATION @@ -54445,7 +60021,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [PackageWithAllocationConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -54559,7 +60136,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -54627,6 +60205,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -54639,17 +60225,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -54657,6 +60266,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -54755,7 +60373,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -54824,6 +60443,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -54836,17 +60463,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -54854,6 +60504,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -54929,7 +60588,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -55284,7 +60944,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionTierWithProrationPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var itemId: JsonField? = null @@ -55667,6 +61328,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -55687,6 +61356,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -55696,6 +61366,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -55703,9 +61382,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -55717,6 +61407,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -55749,6 +61448,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -55759,21 +61466,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { TIERED_WITH_PRORATION, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { TIERED_WITH_PRORATION, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { TIERED_WITH_PRORATION -> Value.TIERED_WITH_PRORATION else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { TIERED_WITH_PRORATION -> Known.TIERED_WITH_PRORATION @@ -55824,7 +61562,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TieredWithProrationConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -55937,7 +61676,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -56005,6 +61745,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -56017,17 +61765,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -56035,6 +61806,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -56133,7 +61913,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -56202,6 +61983,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -56214,17 +62003,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -56232,6 +62044,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -56307,7 +62128,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -56662,7 +62484,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionUnitWithProrationPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var itemId: JsonField? = null @@ -57043,6 +62866,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -57063,6 +62894,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -57072,6 +62904,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -57079,9 +62920,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -57093,6 +62945,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -57125,6 +62986,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -57135,21 +63004,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { UNIT_WITH_PRORATION, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { UNIT_WITH_PRORATION, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { UNIT_WITH_PRORATION -> Value.UNIT_WITH_PRORATION else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { UNIT_WITH_PRORATION -> Known.UNIT_WITH_PRORATION @@ -57200,7 +63100,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [UnitWithProrationConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -57313,7 +63214,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -57381,6 +63283,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -57393,17 +63303,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -57411,6 +63344,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -57509,7 +63451,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -57578,6 +63521,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -57590,17 +63541,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -57608,6 +63582,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -57683,7 +63666,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -58038,7 +64022,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionGroupedAllocationPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var groupedAllocationConfig: JsonField? = null @@ -58419,6 +64404,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -58439,6 +64432,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -58448,6 +64442,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -58455,9 +64458,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -58469,6 +64483,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -58524,7 +64547,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [GroupedAllocationConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -58586,6 +64610,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -58596,21 +64628,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { GROUPED_ALLOCATION, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { GROUPED_ALLOCATION, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { GROUPED_ALLOCATION -> Value.GROUPED_ALLOCATION else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { GROUPED_ALLOCATION -> Known.GROUPED_ALLOCATION @@ -58689,7 +64752,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -58757,6 +64821,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -58769,17 +64841,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -58787,6 +64882,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -58885,7 +64989,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -58954,6 +65059,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -58966,17 +65079,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -58984,6 +65120,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -59059,7 +65204,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -59417,7 +65563,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionGroupedWithProratedMinimumPrice]. */ + class Builder internal constructor() { private var cadence: JsonField? = null private var groupedWithProratedMinimumConfig: @@ -59817,6 +65964,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -59837,6 +65992,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -59846,6 +66002,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -59853,9 +66018,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -59867,6 +66043,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -59922,7 +66107,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [GroupedWithProratedMinimumConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -59985,6 +66171,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -59996,21 +66190,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { GROUPED_WITH_PRORATED_MINIMUM, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { GROUPED_WITH_PRORATED_MINIMUM, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { GROUPED_WITH_PRORATED_MINIMUM -> Value.GROUPED_WITH_PRORATED_MINIMUM else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { GROUPED_WITH_PRORATED_MINIMUM -> Known.GROUPED_WITH_PRORATED_MINIMUM @@ -60089,7 +66314,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -60157,6 +66383,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -60169,17 +66403,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -60187,6 +66444,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -60285,7 +66551,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -60354,6 +66621,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -60366,17 +66641,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -60384,6 +66682,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -60459,7 +66766,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -60814,7 +67122,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [NewSubscriptionBulkWithProrationPrice]. */ + class Builder internal constructor() { private var bulkWithProrationConfig: JsonField? = null private var cadence: JsonField? = null @@ -61217,7 +67526,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BulkWithProrationConfig]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -61280,6 +67590,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -61300,6 +67618,7 @@ constructor( @JvmStatic fun of(value: String) = Cadence(JsonField.of(value)) } + /** An enum containing [Cadence]'s known values. */ enum class Known { ANNUAL, SEMI_ANNUAL, @@ -61309,6 +67628,15 @@ constructor( CUSTOM, } + /** + * An enum containing [Cadence]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Cadence] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ANNUAL, SEMI_ANNUAL, @@ -61316,9 +67644,20 @@ constructor( QUARTERLY, ONE_TIME, CUSTOM, + /** + * An enum member indicating that [Cadence] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { ANNUAL -> Value.ANNUAL @@ -61330,6 +67669,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { ANNUAL -> Known.ANNUAL @@ -61362,6 +67710,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -61372,21 +67728,52 @@ constructor( @JvmStatic fun of(value: String) = ModelType(JsonField.of(value)) } + /** An enum containing [ModelType]'s known values. */ enum class Known { BULK_WITH_PRORATION, } + /** + * An enum containing [ModelType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ModelType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { BULK_WITH_PRORATION, + /** + * An enum member indicating that [ModelType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { BULK_WITH_PRORATION -> Value.BULK_WITH_PRORATION else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { BULK_WITH_PRORATION -> Known.BULK_WITH_PRORATION @@ -61465,7 +67852,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -61533,6 +67921,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -61545,17 +67941,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -61563,6 +67982,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -61661,7 +68089,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [InvoicingCycleConfiguration]. */ + class Builder internal constructor() { private var duration: JsonField? = null private var durationUnit: JsonField? = null @@ -61730,6 +68159,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -61742,17 +68179,40 @@ constructor( @JvmStatic fun of(value: String) = DurationUnit(JsonField.of(value)) } + /** An enum containing [DurationUnit]'s known values. */ enum class Known { DAY, MONTH, } + /** + * An enum containing [DurationUnit]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [DurationUnit] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { DAY, MONTH, + /** + * An enum member indicating that [DurationUnit] was instantiated with + * an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ fun value(): Value = when (this) { DAY -> Value.DAY @@ -61760,6 +68220,15 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { DAY -> Known.DAY @@ -61835,7 +68304,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() 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 6be5815a..2b6a51bc 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 @@ -440,7 +440,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [SubscriptionSchedulePlanChangeResponse]. */ + class Builder internal constructor() { private var id: JsonField? = null private var activePlanPhaseOrder: JsonField? = null @@ -1085,7 +1086,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AdjustmentInterval]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustment: JsonField? = null @@ -1342,6 +1344,10 @@ private constructor( @JvmStatic fun ofMaximum(maximum: MaximumAdjustment) = Adjustment(maximum = maximum) } + /** + * An interface that defines how to map each variant of [Adjustment] to a value of type + * [T]. + */ interface Visitor { fun visitAmountDiscount(amountDiscount: AmountDiscountAdjustment): T @@ -1354,12 +1360,22 @@ private constructor( fun visitMaximum(maximum: MaximumAdjustment): T + /** + * Maps an unknown variant of [Adjustment] to a value of type [T]. + * + * An instance of [Adjustment] can contain an unknown variant if it was deserialized + * from data that doesn't match any known variant. For example, if the SDK is on an + * older version than the API, then the API may respond with new variants that the + * SDK is unaware of. + * + * @throws OrbInvalidDataException in the default implementation. + */ fun unknown(json: JsonValue?): T { throw OrbInvalidDataException("Unknown Adjustment: $json") } } - class Deserializer : BaseDeserializer(Adjustment::class) { + internal class Deserializer : BaseDeserializer(Adjustment::class) { override fun ObjectCodec.deserialize(node: JsonNode): Adjustment { val json = JsonValue.fromJsonNode(node) @@ -1413,7 +1429,7 @@ private constructor( } } - class Serializer : BaseSerializer(Adjustment::class) { + internal class Serializer : BaseSerializer(Adjustment::class) { override fun serialize( value: Adjustment, @@ -1552,7 +1568,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AmountDiscountAdjustment]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustmentType: JsonField? = null @@ -1711,6 +1728,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -1721,21 +1746,53 @@ private constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { AMOUNT_DISCOUNT, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { AMOUNT_DISCOUNT, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { AMOUNT_DISCOUNT -> Value.AMOUNT_DISCOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { AMOUNT_DISCOUNT -> Known.AMOUNT_DISCOUNT @@ -1895,7 +1952,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [PercentageDiscountAdjustment]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustmentType: JsonField? = null @@ -2057,6 +2115,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -2067,21 +2133,53 @@ private constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { PERCENTAGE_DISCOUNT, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PERCENTAGE_DISCOUNT, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { PERCENTAGE_DISCOUNT -> Value.PERCENTAGE_DISCOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { PERCENTAGE_DISCOUNT -> Known.PERCENTAGE_DISCOUNT @@ -2240,7 +2338,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [UsageDiscountAdjustment]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustmentType: JsonField? = null @@ -2399,6 +2498,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -2409,21 +2516,53 @@ private constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { USAGE_DISCOUNT, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { USAGE_DISCOUNT, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { USAGE_DISCOUNT -> Value.USAGE_DISCOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { USAGE_DISCOUNT -> Known.USAGE_DISCOUNT @@ -2592,7 +2731,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MinimumAdjustment]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustmentType: JsonField? = null @@ -2759,6 +2899,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -2769,21 +2917,53 @@ private constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { MINIMUM, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { MINIMUM, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { MINIMUM -> Value.MINIMUM else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { MINIMUM -> Known.MINIMUM @@ -2942,7 +3122,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MaximumAdjustment]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustmentType: JsonField? = null @@ -3100,6 +3281,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -3110,21 +3299,53 @@ private constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { MAXIMUM, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { MAXIMUM, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { MAXIMUM -> Value.MAXIMUM else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { MAXIMUM -> Known.MAXIMUM @@ -3260,7 +3481,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleAnchorConfiguration]. */ + class Builder internal constructor() { private var day: JsonField? = null private var month: JsonField = JsonMissing.of() @@ -3484,6 +3706,10 @@ private constructor( @JvmStatic fun ofUsage(usage: UsageDiscountInterval) = DiscountInterval(usage = usage) } + /** + * An interface that defines how to map each variant of [DiscountInterval] to a value of + * type [T]. + */ interface Visitor { fun visitAmount(amount: AmountDiscountInterval): T @@ -3492,12 +3718,22 @@ private constructor( fun visitUsage(usage: UsageDiscountInterval): T + /** + * Maps an unknown variant of [DiscountInterval] to a value of type [T]. + * + * An instance of [DiscountInterval] can contain an unknown variant if it was + * deserialized from data that doesn't match any known variant. For example, if the SDK + * is on an older version than the API, then the API may respond with new variants that + * the SDK is unaware of. + * + * @throws OrbInvalidDataException in the default implementation. + */ fun unknown(json: JsonValue?): T { throw OrbInvalidDataException("Unknown DiscountInterval: $json") } } - class Deserializer : BaseDeserializer(DiscountInterval::class) { + internal class Deserializer : BaseDeserializer(DiscountInterval::class) { override fun ObjectCodec.deserialize(node: JsonNode): DiscountInterval { val json = JsonValue.fromJsonNode(node) @@ -3535,7 +3771,7 @@ private constructor( } } - class Serializer : BaseSerializer(DiscountInterval::class) { + internal class Serializer : BaseSerializer(DiscountInterval::class) { override fun serialize( value: DiscountInterval, @@ -3654,7 +3890,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AmountDiscountInterval]. */ + class Builder internal constructor() { private var amountDiscount: JsonField? = null private var appliesToPriceIds: JsonField>? = null @@ -3803,6 +4040,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -3812,21 +4057,52 @@ private constructor( @JvmStatic fun of(value: String) = DiscountType(JsonField.of(value)) } + /** An enum containing [DiscountType]'s known values. */ enum class Known { AMOUNT, } + /** + * An enum containing [DiscountType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DiscountType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { AMOUNT, + /** + * An enum member indicating that [DiscountType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { AMOUNT -> Value.AMOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { AMOUNT -> Known.AMOUNT @@ -3968,7 +4244,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [PercentageDiscountInterval]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var appliesToPriceIntervalIds: JsonField>? = null @@ -4123,6 +4400,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -4132,21 +4417,52 @@ private constructor( @JvmStatic fun of(value: String) = DiscountType(JsonField.of(value)) } + /** An enum containing [DiscountType]'s known values. */ enum class Known { PERCENTAGE, } + /** + * An enum containing [DiscountType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DiscountType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PERCENTAGE, + /** + * An enum member indicating that [DiscountType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { PERCENTAGE -> Value.PERCENTAGE else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { PERCENTAGE -> Known.PERCENTAGE @@ -4294,7 +4610,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [UsageDiscountInterval]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var appliesToPriceIntervalIds: JsonField>? = null @@ -4448,6 +4765,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -4457,21 +4782,52 @@ private constructor( @JvmStatic fun of(value: String) = DiscountType(JsonField.of(value)) } + /** An enum containing [DiscountType]'s known values. */ enum class Known { USAGE, } + /** + * An enum containing [DiscountType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DiscountType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { USAGE, + /** + * An enum member indicating that [DiscountType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { USAGE -> Value.USAGE else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { USAGE -> Known.USAGE @@ -4578,7 +4934,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [FixedFeeQuantitySchedule]. */ + class Builder internal constructor() { private var endDate: JsonField? = null private var priceId: JsonField? = null @@ -4760,7 +5117,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MaximumInterval]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var appliesToPriceIntervalIds: JsonField>? = null @@ -4943,7 +5301,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -5089,7 +5448,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MinimumInterval]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var appliesToPriceIntervalIds: JsonField>? = null @@ -5428,7 +5788,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [PriceInterval]. */ + class Builder internal constructor() { private var id: JsonField? = null private var billingCycleDay: JsonField? = null @@ -5979,6 +6340,36 @@ private constructor( fun price(maxGroupTieredPackage: Price.MaxGroupTieredPackagePrice) = price(Price.ofMaxGroupTieredPackage(maxGroupTieredPackage)) + /** + * The Price resource represents a price that can be billed on a subscription, resulting + * in a charge on an invoice in the form of an invoice line item. Prices take a quantity + * and determine an amount to bill. + * + * Orb supports a few different pricing models out of the box. Each of these models is + * serialized differently in a given Price object. The model_type field determines the + * key for the configuration object that is present. + * + * For more on the types of prices, see + * [the core concepts documentation](/core-concepts#plan-and-price) + */ + fun price(scalableMatrixWithUnitPricing: Price.ScalableMatrixWithUnitPricingPrice) = + price(Price.ofScalableMatrixWithUnitPricing(scalableMatrixWithUnitPricing)) + + /** + * The Price resource represents a price that can be billed on a subscription, resulting + * in a charge on an invoice in the form of an invoice line item. Prices take a quantity + * and determine an amount to bill. + * + * Orb supports a few different pricing models out of the box. Each of these models is + * serialized differently in a given Price object. The model_type field determines the + * key for the configuration object that is present. + * + * For more on the types of prices, see + * [the core concepts documentation](/core-concepts#plan-and-price) + */ + fun price(scalableMatrixWithTieredPricing: Price.ScalableMatrixWithTieredPricingPrice) = + price(Price.ofScalableMatrixWithTieredPricing(scalableMatrixWithTieredPricing)) + /** * The start date of the price interval. This is the date that Orb starts billing for * this price. @@ -6083,7 +6474,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [FixedFeeQuantityTransition]. */ + class Builder internal constructor() { private var effectiveDate: JsonField? = null private var priceId: JsonField? = null @@ -6239,7 +6631,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [RedeemedCoupon]. */ + class Builder internal constructor() { private var couponId: JsonField? = null private var endDate: JsonField? = null @@ -6322,6 +6715,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -6335,19 +6736,37 @@ private constructor( @JvmStatic fun of(value: String) = Status(JsonField.of(value)) } + /** An enum containing [Status]'s known values. */ enum class Known { ACTIVE, ENDED, UPCOMING, } + /** + * An enum containing [Status]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Status] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ACTIVE, ENDED, UPCOMING, + /** An enum member indicating that [Status] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { ACTIVE -> Value.ACTIVE @@ -6356,6 +6775,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { ACTIVE -> Known.ACTIVE @@ -6419,7 +6846,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TrialInfo]. */ + class Builder internal constructor() { private var endDate: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionTriggerPhaseParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionTriggerPhaseParams.kt index 7a91e24c..974baabc 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionTriggerPhaseParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionTriggerPhaseParams.kt @@ -11,6 +11,7 @@ import com.withorb.api.core.JsonField import com.withorb.api.core.JsonMissing import com.withorb.api.core.JsonValue import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -22,12 +23,12 @@ import java.util.Optional /** Manually trigger a phase, effective the given date (or the current time, if not specified). */ class SubscriptionTriggerPhaseParams -constructor( +private constructor( private val subscriptionId: String, private val body: SubscriptionTriggerPhaseBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun subscriptionId(): String = subscriptionId @@ -49,11 +50,11 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getBody(): SubscriptionTriggerPhaseBody = body + @JvmSynthetic internal fun _body(): SubscriptionTriggerPhaseBody = body - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun getPathParam(index: Int): String { return when (index) { @@ -110,7 +111,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [SubscriptionTriggerPhaseBody]. */ + class Builder internal constructor() { private var effectiveDate: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -192,8 +194,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [SubscriptionTriggerPhaseParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var subscriptionId: String? = null private var body: SubscriptionTriggerPhaseBody.Builder = 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 4410fe0d..0a93edd2 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 @@ -440,7 +440,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [SubscriptionTriggerPhaseResponse]. */ + class Builder internal constructor() { private var id: JsonField? = null private var activePlanPhaseOrder: JsonField? = null @@ -1082,7 +1083,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AdjustmentInterval]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustment: JsonField? = null @@ -1339,6 +1341,10 @@ private constructor( @JvmStatic fun ofMaximum(maximum: MaximumAdjustment) = Adjustment(maximum = maximum) } + /** + * An interface that defines how to map each variant of [Adjustment] to a value of type + * [T]. + */ interface Visitor { fun visitAmountDiscount(amountDiscount: AmountDiscountAdjustment): T @@ -1351,12 +1357,22 @@ private constructor( fun visitMaximum(maximum: MaximumAdjustment): T + /** + * Maps an unknown variant of [Adjustment] to a value of type [T]. + * + * An instance of [Adjustment] can contain an unknown variant if it was deserialized + * from data that doesn't match any known variant. For example, if the SDK is on an + * older version than the API, then the API may respond with new variants that the + * SDK is unaware of. + * + * @throws OrbInvalidDataException in the default implementation. + */ fun unknown(json: JsonValue?): T { throw OrbInvalidDataException("Unknown Adjustment: $json") } } - class Deserializer : BaseDeserializer(Adjustment::class) { + internal class Deserializer : BaseDeserializer(Adjustment::class) { override fun ObjectCodec.deserialize(node: JsonNode): Adjustment { val json = JsonValue.fromJsonNode(node) @@ -1410,7 +1426,7 @@ private constructor( } } - class Serializer : BaseSerializer(Adjustment::class) { + internal class Serializer : BaseSerializer(Adjustment::class) { override fun serialize( value: Adjustment, @@ -1549,7 +1565,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AmountDiscountAdjustment]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustmentType: JsonField? = null @@ -1708,6 +1725,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -1718,21 +1743,53 @@ private constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { AMOUNT_DISCOUNT, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { AMOUNT_DISCOUNT, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { AMOUNT_DISCOUNT -> Value.AMOUNT_DISCOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { AMOUNT_DISCOUNT -> Known.AMOUNT_DISCOUNT @@ -1892,7 +1949,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [PercentageDiscountAdjustment]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustmentType: JsonField? = null @@ -2054,6 +2112,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -2064,21 +2130,53 @@ private constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { PERCENTAGE_DISCOUNT, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PERCENTAGE_DISCOUNT, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { PERCENTAGE_DISCOUNT -> Value.PERCENTAGE_DISCOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { PERCENTAGE_DISCOUNT -> Known.PERCENTAGE_DISCOUNT @@ -2237,7 +2335,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [UsageDiscountAdjustment]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustmentType: JsonField? = null @@ -2396,6 +2495,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -2406,21 +2513,53 @@ private constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { USAGE_DISCOUNT, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { USAGE_DISCOUNT, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { USAGE_DISCOUNT -> Value.USAGE_DISCOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { USAGE_DISCOUNT -> Known.USAGE_DISCOUNT @@ -2589,7 +2728,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MinimumAdjustment]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustmentType: JsonField? = null @@ -2756,6 +2896,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -2766,21 +2914,53 @@ private constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { MINIMUM, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { MINIMUM, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { MINIMUM -> Value.MINIMUM else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { MINIMUM -> Known.MINIMUM @@ -2939,7 +3119,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MaximumAdjustment]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustmentType: JsonField? = null @@ -3097,6 +3278,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -3107,21 +3296,53 @@ private constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { MAXIMUM, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { MAXIMUM, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { MAXIMUM -> Value.MAXIMUM else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { MAXIMUM -> Known.MAXIMUM @@ -3257,7 +3478,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleAnchorConfiguration]. */ + class Builder internal constructor() { private var day: JsonField? = null private var month: JsonField = JsonMissing.of() @@ -3481,6 +3703,10 @@ private constructor( @JvmStatic fun ofUsage(usage: UsageDiscountInterval) = DiscountInterval(usage = usage) } + /** + * An interface that defines how to map each variant of [DiscountInterval] to a value of + * type [T]. + */ interface Visitor { fun visitAmount(amount: AmountDiscountInterval): T @@ -3489,12 +3715,22 @@ private constructor( fun visitUsage(usage: UsageDiscountInterval): T + /** + * Maps an unknown variant of [DiscountInterval] to a value of type [T]. + * + * An instance of [DiscountInterval] can contain an unknown variant if it was + * deserialized from data that doesn't match any known variant. For example, if the SDK + * is on an older version than the API, then the API may respond with new variants that + * the SDK is unaware of. + * + * @throws OrbInvalidDataException in the default implementation. + */ fun unknown(json: JsonValue?): T { throw OrbInvalidDataException("Unknown DiscountInterval: $json") } } - class Deserializer : BaseDeserializer(DiscountInterval::class) { + internal class Deserializer : BaseDeserializer(DiscountInterval::class) { override fun ObjectCodec.deserialize(node: JsonNode): DiscountInterval { val json = JsonValue.fromJsonNode(node) @@ -3532,7 +3768,7 @@ private constructor( } } - class Serializer : BaseSerializer(DiscountInterval::class) { + internal class Serializer : BaseSerializer(DiscountInterval::class) { override fun serialize( value: DiscountInterval, @@ -3651,7 +3887,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AmountDiscountInterval]. */ + class Builder internal constructor() { private var amountDiscount: JsonField? = null private var appliesToPriceIds: JsonField>? = null @@ -3800,6 +4037,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -3809,21 +4054,52 @@ private constructor( @JvmStatic fun of(value: String) = DiscountType(JsonField.of(value)) } + /** An enum containing [DiscountType]'s known values. */ enum class Known { AMOUNT, } + /** + * An enum containing [DiscountType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DiscountType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { AMOUNT, + /** + * An enum member indicating that [DiscountType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { AMOUNT -> Value.AMOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { AMOUNT -> Known.AMOUNT @@ -3965,7 +4241,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [PercentageDiscountInterval]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var appliesToPriceIntervalIds: JsonField>? = null @@ -4120,6 +4397,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -4129,21 +4414,52 @@ private constructor( @JvmStatic fun of(value: String) = DiscountType(JsonField.of(value)) } + /** An enum containing [DiscountType]'s known values. */ enum class Known { PERCENTAGE, } + /** + * An enum containing [DiscountType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DiscountType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PERCENTAGE, + /** + * An enum member indicating that [DiscountType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { PERCENTAGE -> Value.PERCENTAGE else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { PERCENTAGE -> Known.PERCENTAGE @@ -4291,7 +4607,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [UsageDiscountInterval]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var appliesToPriceIntervalIds: JsonField>? = null @@ -4445,6 +4762,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -4454,21 +4779,52 @@ private constructor( @JvmStatic fun of(value: String) = DiscountType(JsonField.of(value)) } + /** An enum containing [DiscountType]'s known values. */ enum class Known { USAGE, } + /** + * An enum containing [DiscountType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DiscountType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { USAGE, + /** + * An enum member indicating that [DiscountType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { USAGE -> Value.USAGE else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { USAGE -> Known.USAGE @@ -4575,7 +4931,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [FixedFeeQuantitySchedule]. */ + class Builder internal constructor() { private var endDate: JsonField? = null private var priceId: JsonField? = null @@ -4757,7 +5114,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MaximumInterval]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var appliesToPriceIntervalIds: JsonField>? = null @@ -4940,7 +5298,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -5086,7 +5445,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MinimumInterval]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var appliesToPriceIntervalIds: JsonField>? = null @@ -5425,7 +5785,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [PriceInterval]. */ + class Builder internal constructor() { private var id: JsonField? = null private var billingCycleDay: JsonField? = null @@ -5976,6 +6337,36 @@ private constructor( fun price(maxGroupTieredPackage: Price.MaxGroupTieredPackagePrice) = price(Price.ofMaxGroupTieredPackage(maxGroupTieredPackage)) + /** + * The Price resource represents a price that can be billed on a subscription, resulting + * in a charge on an invoice in the form of an invoice line item. Prices take a quantity + * and determine an amount to bill. + * + * Orb supports a few different pricing models out of the box. Each of these models is + * serialized differently in a given Price object. The model_type field determines the + * key for the configuration object that is present. + * + * For more on the types of prices, see + * [the core concepts documentation](/core-concepts#plan-and-price) + */ + fun price(scalableMatrixWithUnitPricing: Price.ScalableMatrixWithUnitPricingPrice) = + price(Price.ofScalableMatrixWithUnitPricing(scalableMatrixWithUnitPricing)) + + /** + * The Price resource represents a price that can be billed on a subscription, resulting + * in a charge on an invoice in the form of an invoice line item. Prices take a quantity + * and determine an amount to bill. + * + * Orb supports a few different pricing models out of the box. Each of these models is + * serialized differently in a given Price object. The model_type field determines the + * key for the configuration object that is present. + * + * For more on the types of prices, see + * [the core concepts documentation](/core-concepts#plan-and-price) + */ + fun price(scalableMatrixWithTieredPricing: Price.ScalableMatrixWithTieredPricingPrice) = + price(Price.ofScalableMatrixWithTieredPricing(scalableMatrixWithTieredPricing)) + /** * The start date of the price interval. This is the date that Orb starts billing for * this price. @@ -6080,7 +6471,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [FixedFeeQuantityTransition]. */ + class Builder internal constructor() { private var effectiveDate: JsonField? = null private var priceId: JsonField? = null @@ -6236,7 +6628,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [RedeemedCoupon]. */ + class Builder internal constructor() { private var couponId: JsonField? = null private var endDate: JsonField? = null @@ -6319,6 +6712,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -6332,19 +6733,37 @@ private constructor( @JvmStatic fun of(value: String) = Status(JsonField.of(value)) } + /** An enum containing [Status]'s known values. */ enum class Known { ACTIVE, ENDED, UPCOMING, } + /** + * An enum containing [Status]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Status] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ACTIVE, ENDED, UPCOMING, + /** An enum member indicating that [Status] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { ACTIVE -> Value.ACTIVE @@ -6353,6 +6772,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { ACTIVE -> Known.ACTIVE @@ -6416,7 +6843,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TrialInfo]. */ + class Builder internal constructor() { private var endDate: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUnscheduleCancellationParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUnscheduleCancellationParams.kt index bc4499a6..829f3a5c 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUnscheduleCancellationParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUnscheduleCancellationParams.kt @@ -4,6 +4,7 @@ package com.withorb.api.models import com.withorb.api.core.JsonValue import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -19,12 +20,12 @@ import java.util.Optional * scheduled cancellation time. */ class SubscriptionUnscheduleCancellationParams -constructor( +private constructor( private val subscriptionId: String, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, private val additionalBodyProperties: Map, -) { +) : Params { fun subscriptionId(): String = subscriptionId @@ -35,12 +36,12 @@ constructor( fun _additionalBodyProperties(): Map = additionalBodyProperties @JvmSynthetic - internal fun getBody(): Optional> = + internal fun _body(): Optional> = Optional.ofNullable(additionalBodyProperties.ifEmpty { null }) - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun getPathParam(index: Int): String { return when (index) { @@ -56,8 +57,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [SubscriptionUnscheduleCancellationParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var subscriptionId: String? = null private var additionalHeaders: Headers.Builder = Headers.builder() 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 3a6734c9..d9326c16 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 @@ -440,7 +440,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [SubscriptionUnscheduleCancellationResponse]. */ + class Builder internal constructor() { private var id: JsonField? = null private var activePlanPhaseOrder: JsonField? = null @@ -1091,7 +1092,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AdjustmentInterval]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustment: JsonField? = null @@ -1348,6 +1350,10 @@ private constructor( @JvmStatic fun ofMaximum(maximum: MaximumAdjustment) = Adjustment(maximum = maximum) } + /** + * An interface that defines how to map each variant of [Adjustment] to a value of type + * [T]. + */ interface Visitor { fun visitAmountDiscount(amountDiscount: AmountDiscountAdjustment): T @@ -1360,12 +1366,22 @@ private constructor( fun visitMaximum(maximum: MaximumAdjustment): T + /** + * Maps an unknown variant of [Adjustment] to a value of type [T]. + * + * An instance of [Adjustment] can contain an unknown variant if it was deserialized + * from data that doesn't match any known variant. For example, if the SDK is on an + * older version than the API, then the API may respond with new variants that the + * SDK is unaware of. + * + * @throws OrbInvalidDataException in the default implementation. + */ fun unknown(json: JsonValue?): T { throw OrbInvalidDataException("Unknown Adjustment: $json") } } - class Deserializer : BaseDeserializer(Adjustment::class) { + internal class Deserializer : BaseDeserializer(Adjustment::class) { override fun ObjectCodec.deserialize(node: JsonNode): Adjustment { val json = JsonValue.fromJsonNode(node) @@ -1419,7 +1435,7 @@ private constructor( } } - class Serializer : BaseSerializer(Adjustment::class) { + internal class Serializer : BaseSerializer(Adjustment::class) { override fun serialize( value: Adjustment, @@ -1558,7 +1574,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AmountDiscountAdjustment]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustmentType: JsonField? = null @@ -1717,6 +1734,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -1727,21 +1752,53 @@ private constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { AMOUNT_DISCOUNT, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { AMOUNT_DISCOUNT, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { AMOUNT_DISCOUNT -> Value.AMOUNT_DISCOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { AMOUNT_DISCOUNT -> Known.AMOUNT_DISCOUNT @@ -1901,7 +1958,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [PercentageDiscountAdjustment]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustmentType: JsonField? = null @@ -2063,6 +2121,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -2073,21 +2139,53 @@ private constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { PERCENTAGE_DISCOUNT, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PERCENTAGE_DISCOUNT, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { PERCENTAGE_DISCOUNT -> Value.PERCENTAGE_DISCOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { PERCENTAGE_DISCOUNT -> Known.PERCENTAGE_DISCOUNT @@ -2246,7 +2344,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [UsageDiscountAdjustment]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustmentType: JsonField? = null @@ -2405,6 +2504,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -2415,21 +2522,53 @@ private constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { USAGE_DISCOUNT, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { USAGE_DISCOUNT, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { USAGE_DISCOUNT -> Value.USAGE_DISCOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { USAGE_DISCOUNT -> Known.USAGE_DISCOUNT @@ -2598,7 +2737,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MinimumAdjustment]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustmentType: JsonField? = null @@ -2765,6 +2905,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -2775,21 +2923,53 @@ private constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { MINIMUM, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { MINIMUM, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { MINIMUM -> Value.MINIMUM else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { MINIMUM -> Known.MINIMUM @@ -2948,7 +3128,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MaximumAdjustment]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustmentType: JsonField? = null @@ -3106,6 +3287,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -3116,21 +3305,53 @@ private constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { MAXIMUM, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { MAXIMUM, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { MAXIMUM -> Value.MAXIMUM else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { MAXIMUM -> Known.MAXIMUM @@ -3266,7 +3487,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleAnchorConfiguration]. */ + class Builder internal constructor() { private var day: JsonField? = null private var month: JsonField = JsonMissing.of() @@ -3490,6 +3712,10 @@ private constructor( @JvmStatic fun ofUsage(usage: UsageDiscountInterval) = DiscountInterval(usage = usage) } + /** + * An interface that defines how to map each variant of [DiscountInterval] to a value of + * type [T]. + */ interface Visitor { fun visitAmount(amount: AmountDiscountInterval): T @@ -3498,12 +3724,22 @@ private constructor( fun visitUsage(usage: UsageDiscountInterval): T + /** + * Maps an unknown variant of [DiscountInterval] to a value of type [T]. + * + * An instance of [DiscountInterval] can contain an unknown variant if it was + * deserialized from data that doesn't match any known variant. For example, if the SDK + * is on an older version than the API, then the API may respond with new variants that + * the SDK is unaware of. + * + * @throws OrbInvalidDataException in the default implementation. + */ fun unknown(json: JsonValue?): T { throw OrbInvalidDataException("Unknown DiscountInterval: $json") } } - class Deserializer : BaseDeserializer(DiscountInterval::class) { + internal class Deserializer : BaseDeserializer(DiscountInterval::class) { override fun ObjectCodec.deserialize(node: JsonNode): DiscountInterval { val json = JsonValue.fromJsonNode(node) @@ -3541,7 +3777,7 @@ private constructor( } } - class Serializer : BaseSerializer(DiscountInterval::class) { + internal class Serializer : BaseSerializer(DiscountInterval::class) { override fun serialize( value: DiscountInterval, @@ -3660,7 +3896,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AmountDiscountInterval]. */ + class Builder internal constructor() { private var amountDiscount: JsonField? = null private var appliesToPriceIds: JsonField>? = null @@ -3809,6 +4046,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -3818,21 +4063,52 @@ private constructor( @JvmStatic fun of(value: String) = DiscountType(JsonField.of(value)) } + /** An enum containing [DiscountType]'s known values. */ enum class Known { AMOUNT, } + /** + * An enum containing [DiscountType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DiscountType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { AMOUNT, + /** + * An enum member indicating that [DiscountType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { AMOUNT -> Value.AMOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { AMOUNT -> Known.AMOUNT @@ -3974,7 +4250,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [PercentageDiscountInterval]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var appliesToPriceIntervalIds: JsonField>? = null @@ -4129,6 +4406,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -4138,21 +4423,52 @@ private constructor( @JvmStatic fun of(value: String) = DiscountType(JsonField.of(value)) } + /** An enum containing [DiscountType]'s known values. */ enum class Known { PERCENTAGE, } + /** + * An enum containing [DiscountType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DiscountType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PERCENTAGE, + /** + * An enum member indicating that [DiscountType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { PERCENTAGE -> Value.PERCENTAGE else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { PERCENTAGE -> Known.PERCENTAGE @@ -4300,7 +4616,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [UsageDiscountInterval]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var appliesToPriceIntervalIds: JsonField>? = null @@ -4454,6 +4771,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -4463,21 +4788,52 @@ private constructor( @JvmStatic fun of(value: String) = DiscountType(JsonField.of(value)) } + /** An enum containing [DiscountType]'s known values. */ enum class Known { USAGE, } + /** + * An enum containing [DiscountType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DiscountType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { USAGE, + /** + * An enum member indicating that [DiscountType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { USAGE -> Value.USAGE else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { USAGE -> Known.USAGE @@ -4584,7 +4940,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [FixedFeeQuantitySchedule]. */ + class Builder internal constructor() { private var endDate: JsonField? = null private var priceId: JsonField? = null @@ -4766,7 +5123,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MaximumInterval]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var appliesToPriceIntervalIds: JsonField>? = null @@ -4949,7 +5307,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -5095,7 +5454,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MinimumInterval]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var appliesToPriceIntervalIds: JsonField>? = null @@ -5434,7 +5794,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [PriceInterval]. */ + class Builder internal constructor() { private var id: JsonField? = null private var billingCycleDay: JsonField? = null @@ -5985,6 +6346,36 @@ private constructor( fun price(maxGroupTieredPackage: Price.MaxGroupTieredPackagePrice) = price(Price.ofMaxGroupTieredPackage(maxGroupTieredPackage)) + /** + * The Price resource represents a price that can be billed on a subscription, resulting + * in a charge on an invoice in the form of an invoice line item. Prices take a quantity + * and determine an amount to bill. + * + * Orb supports a few different pricing models out of the box. Each of these models is + * serialized differently in a given Price object. The model_type field determines the + * key for the configuration object that is present. + * + * For more on the types of prices, see + * [the core concepts documentation](/core-concepts#plan-and-price) + */ + fun price(scalableMatrixWithUnitPricing: Price.ScalableMatrixWithUnitPricingPrice) = + price(Price.ofScalableMatrixWithUnitPricing(scalableMatrixWithUnitPricing)) + + /** + * The Price resource represents a price that can be billed on a subscription, resulting + * in a charge on an invoice in the form of an invoice line item. Prices take a quantity + * and determine an amount to bill. + * + * Orb supports a few different pricing models out of the box. Each of these models is + * serialized differently in a given Price object. The model_type field determines the + * key for the configuration object that is present. + * + * For more on the types of prices, see + * [the core concepts documentation](/core-concepts#plan-and-price) + */ + fun price(scalableMatrixWithTieredPricing: Price.ScalableMatrixWithTieredPricingPrice) = + price(Price.ofScalableMatrixWithTieredPricing(scalableMatrixWithTieredPricing)) + /** * The start date of the price interval. This is the date that Orb starts billing for * this price. @@ -6089,7 +6480,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [FixedFeeQuantityTransition]. */ + class Builder internal constructor() { private var effectiveDate: JsonField? = null private var priceId: JsonField? = null @@ -6245,7 +6637,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [RedeemedCoupon]. */ + class Builder internal constructor() { private var couponId: JsonField? = null private var endDate: JsonField? = null @@ -6328,6 +6721,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -6341,19 +6742,37 @@ private constructor( @JvmStatic fun of(value: String) = Status(JsonField.of(value)) } + /** An enum containing [Status]'s known values. */ enum class Known { ACTIVE, ENDED, UPCOMING, } + /** + * An enum containing [Status]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Status] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ACTIVE, ENDED, UPCOMING, + /** An enum member indicating that [Status] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { ACTIVE -> Value.ACTIVE @@ -6362,6 +6781,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { ACTIVE -> Known.ACTIVE @@ -6425,7 +6852,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TrialInfo]. */ + class Builder internal constructor() { private var endDate: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUnscheduleFixedFeeQuantityUpdatesParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUnscheduleFixedFeeQuantityUpdatesParams.kt index 4fa945c9..24ac5bf6 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUnscheduleFixedFeeQuantityUpdatesParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUnscheduleFixedFeeQuantityUpdatesParams.kt @@ -11,6 +11,7 @@ import com.withorb.api.core.JsonField import com.withorb.api.core.JsonMissing import com.withorb.api.core.JsonValue import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -25,12 +26,12 @@ import java.util.Objects * code. */ class SubscriptionUnscheduleFixedFeeQuantityUpdatesParams -constructor( +private constructor( private val subscriptionId: String, private val body: SubscriptionUnscheduleFixedFeeQuantityUpdatesBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun subscriptionId(): String = subscriptionId @@ -46,11 +47,11 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getBody(): SubscriptionUnscheduleFixedFeeQuantityUpdatesBody = body + @JvmSynthetic internal fun _body(): SubscriptionUnscheduleFixedFeeQuantityUpdatesBody = body - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun getPathParam(index: Int): String { return when (index) { @@ -98,7 +99,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [SubscriptionUnscheduleFixedFeeQuantityUpdatesBody]. */ + class Builder internal constructor() { private var priceId: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -171,8 +173,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [SubscriptionUnscheduleFixedFeeQuantityUpdatesParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var subscriptionId: String? = null private var body: SubscriptionUnscheduleFixedFeeQuantityUpdatesBody.Builder = 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 3378896d..07613175 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 @@ -440,7 +440,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [SubscriptionUnscheduleFixedFeeQuantityUpdatesResponse]. */ + class Builder internal constructor() { private var id: JsonField? = null private var activePlanPhaseOrder: JsonField? = null @@ -1099,7 +1100,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AdjustmentInterval]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustment: JsonField? = null @@ -1356,6 +1358,10 @@ private constructor( @JvmStatic fun ofMaximum(maximum: MaximumAdjustment) = Adjustment(maximum = maximum) } + /** + * An interface that defines how to map each variant of [Adjustment] to a value of type + * [T]. + */ interface Visitor { fun visitAmountDiscount(amountDiscount: AmountDiscountAdjustment): T @@ -1368,12 +1374,22 @@ private constructor( fun visitMaximum(maximum: MaximumAdjustment): T + /** + * Maps an unknown variant of [Adjustment] to a value of type [T]. + * + * An instance of [Adjustment] can contain an unknown variant if it was deserialized + * from data that doesn't match any known variant. For example, if the SDK is on an + * older version than the API, then the API may respond with new variants that the + * SDK is unaware of. + * + * @throws OrbInvalidDataException in the default implementation. + */ fun unknown(json: JsonValue?): T { throw OrbInvalidDataException("Unknown Adjustment: $json") } } - class Deserializer : BaseDeserializer(Adjustment::class) { + internal class Deserializer : BaseDeserializer(Adjustment::class) { override fun ObjectCodec.deserialize(node: JsonNode): Adjustment { val json = JsonValue.fromJsonNode(node) @@ -1427,7 +1443,7 @@ private constructor( } } - class Serializer : BaseSerializer(Adjustment::class) { + internal class Serializer : BaseSerializer(Adjustment::class) { override fun serialize( value: Adjustment, @@ -1566,7 +1582,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AmountDiscountAdjustment]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustmentType: JsonField? = null @@ -1725,6 +1742,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -1735,21 +1760,53 @@ private constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { AMOUNT_DISCOUNT, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { AMOUNT_DISCOUNT, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { AMOUNT_DISCOUNT -> Value.AMOUNT_DISCOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { AMOUNT_DISCOUNT -> Known.AMOUNT_DISCOUNT @@ -1909,7 +1966,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [PercentageDiscountAdjustment]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustmentType: JsonField? = null @@ -2071,6 +2129,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -2081,21 +2147,53 @@ private constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { PERCENTAGE_DISCOUNT, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PERCENTAGE_DISCOUNT, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { PERCENTAGE_DISCOUNT -> Value.PERCENTAGE_DISCOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { PERCENTAGE_DISCOUNT -> Known.PERCENTAGE_DISCOUNT @@ -2254,7 +2352,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [UsageDiscountAdjustment]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustmentType: JsonField? = null @@ -2413,6 +2512,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -2423,21 +2530,53 @@ private constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { USAGE_DISCOUNT, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { USAGE_DISCOUNT, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { USAGE_DISCOUNT -> Value.USAGE_DISCOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { USAGE_DISCOUNT -> Known.USAGE_DISCOUNT @@ -2606,7 +2745,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MinimumAdjustment]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustmentType: JsonField? = null @@ -2773,6 +2913,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -2783,21 +2931,53 @@ private constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { MINIMUM, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { MINIMUM, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { MINIMUM -> Value.MINIMUM else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { MINIMUM -> Known.MINIMUM @@ -2956,7 +3136,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MaximumAdjustment]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustmentType: JsonField? = null @@ -3114,6 +3295,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -3124,21 +3313,53 @@ private constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { MAXIMUM, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { MAXIMUM, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { MAXIMUM -> Value.MAXIMUM else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { MAXIMUM -> Known.MAXIMUM @@ -3274,7 +3495,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleAnchorConfiguration]. */ + class Builder internal constructor() { private var day: JsonField? = null private var month: JsonField = JsonMissing.of() @@ -3498,6 +3720,10 @@ private constructor( @JvmStatic fun ofUsage(usage: UsageDiscountInterval) = DiscountInterval(usage = usage) } + /** + * An interface that defines how to map each variant of [DiscountInterval] to a value of + * type [T]. + */ interface Visitor { fun visitAmount(amount: AmountDiscountInterval): T @@ -3506,12 +3732,22 @@ private constructor( fun visitUsage(usage: UsageDiscountInterval): T + /** + * Maps an unknown variant of [DiscountInterval] to a value of type [T]. + * + * An instance of [DiscountInterval] can contain an unknown variant if it was + * deserialized from data that doesn't match any known variant. For example, if the SDK + * is on an older version than the API, then the API may respond with new variants that + * the SDK is unaware of. + * + * @throws OrbInvalidDataException in the default implementation. + */ fun unknown(json: JsonValue?): T { throw OrbInvalidDataException("Unknown DiscountInterval: $json") } } - class Deserializer : BaseDeserializer(DiscountInterval::class) { + internal class Deserializer : BaseDeserializer(DiscountInterval::class) { override fun ObjectCodec.deserialize(node: JsonNode): DiscountInterval { val json = JsonValue.fromJsonNode(node) @@ -3549,7 +3785,7 @@ private constructor( } } - class Serializer : BaseSerializer(DiscountInterval::class) { + internal class Serializer : BaseSerializer(DiscountInterval::class) { override fun serialize( value: DiscountInterval, @@ -3668,7 +3904,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AmountDiscountInterval]. */ + class Builder internal constructor() { private var amountDiscount: JsonField? = null private var appliesToPriceIds: JsonField>? = null @@ -3817,6 +4054,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -3826,21 +4071,52 @@ private constructor( @JvmStatic fun of(value: String) = DiscountType(JsonField.of(value)) } + /** An enum containing [DiscountType]'s known values. */ enum class Known { AMOUNT, } + /** + * An enum containing [DiscountType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DiscountType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { AMOUNT, + /** + * An enum member indicating that [DiscountType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { AMOUNT -> Value.AMOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { AMOUNT -> Known.AMOUNT @@ -3982,7 +4258,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [PercentageDiscountInterval]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var appliesToPriceIntervalIds: JsonField>? = null @@ -4137,6 +4414,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -4146,21 +4431,52 @@ private constructor( @JvmStatic fun of(value: String) = DiscountType(JsonField.of(value)) } + /** An enum containing [DiscountType]'s known values. */ enum class Known { PERCENTAGE, } + /** + * An enum containing [DiscountType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DiscountType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PERCENTAGE, + /** + * An enum member indicating that [DiscountType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { PERCENTAGE -> Value.PERCENTAGE else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { PERCENTAGE -> Known.PERCENTAGE @@ -4308,7 +4624,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [UsageDiscountInterval]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var appliesToPriceIntervalIds: JsonField>? = null @@ -4462,6 +4779,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -4471,21 +4796,52 @@ private constructor( @JvmStatic fun of(value: String) = DiscountType(JsonField.of(value)) } + /** An enum containing [DiscountType]'s known values. */ enum class Known { USAGE, } + /** + * An enum containing [DiscountType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DiscountType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { USAGE, + /** + * An enum member indicating that [DiscountType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { USAGE -> Value.USAGE else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { USAGE -> Known.USAGE @@ -4592,7 +4948,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [FixedFeeQuantitySchedule]. */ + class Builder internal constructor() { private var endDate: JsonField? = null private var priceId: JsonField? = null @@ -4774,7 +5131,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MaximumInterval]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var appliesToPriceIntervalIds: JsonField>? = null @@ -4957,7 +5315,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -5103,7 +5462,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MinimumInterval]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var appliesToPriceIntervalIds: JsonField>? = null @@ -5442,7 +5802,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [PriceInterval]. */ + class Builder internal constructor() { private var id: JsonField? = null private var billingCycleDay: JsonField? = null @@ -5993,6 +6354,36 @@ private constructor( fun price(maxGroupTieredPackage: Price.MaxGroupTieredPackagePrice) = price(Price.ofMaxGroupTieredPackage(maxGroupTieredPackage)) + /** + * The Price resource represents a price that can be billed on a subscription, resulting + * in a charge on an invoice in the form of an invoice line item. Prices take a quantity + * and determine an amount to bill. + * + * Orb supports a few different pricing models out of the box. Each of these models is + * serialized differently in a given Price object. The model_type field determines the + * key for the configuration object that is present. + * + * For more on the types of prices, see + * [the core concepts documentation](/core-concepts#plan-and-price) + */ + fun price(scalableMatrixWithUnitPricing: Price.ScalableMatrixWithUnitPricingPrice) = + price(Price.ofScalableMatrixWithUnitPricing(scalableMatrixWithUnitPricing)) + + /** + * The Price resource represents a price that can be billed on a subscription, resulting + * in a charge on an invoice in the form of an invoice line item. Prices take a quantity + * and determine an amount to bill. + * + * Orb supports a few different pricing models out of the box. Each of these models is + * serialized differently in a given Price object. The model_type field determines the + * key for the configuration object that is present. + * + * For more on the types of prices, see + * [the core concepts documentation](/core-concepts#plan-and-price) + */ + fun price(scalableMatrixWithTieredPricing: Price.ScalableMatrixWithTieredPricingPrice) = + price(Price.ofScalableMatrixWithTieredPricing(scalableMatrixWithTieredPricing)) + /** * The start date of the price interval. This is the date that Orb starts billing for * this price. @@ -6097,7 +6488,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [FixedFeeQuantityTransition]. */ + class Builder internal constructor() { private var effectiveDate: JsonField? = null private var priceId: JsonField? = null @@ -6253,7 +6645,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [RedeemedCoupon]. */ + class Builder internal constructor() { private var couponId: JsonField? = null private var endDate: JsonField? = null @@ -6336,6 +6729,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -6349,19 +6750,37 @@ private constructor( @JvmStatic fun of(value: String) = Status(JsonField.of(value)) } + /** An enum containing [Status]'s known values. */ enum class Known { ACTIVE, ENDED, UPCOMING, } + /** + * An enum containing [Status]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Status] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ACTIVE, ENDED, UPCOMING, + /** An enum member indicating that [Status] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { ACTIVE -> Value.ACTIVE @@ -6370,6 +6789,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { ACTIVE -> Known.ACTIVE @@ -6433,7 +6860,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TrialInfo]. */ + class Builder internal constructor() { private var endDate: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUnschedulePendingPlanChangesParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUnschedulePendingPlanChangesParams.kt index 6a0a375a..6abdc39c 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUnschedulePendingPlanChangesParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUnschedulePendingPlanChangesParams.kt @@ -4,6 +4,7 @@ package com.withorb.api.models import com.withorb.api.core.JsonValue import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -13,12 +14,12 @@ import java.util.Optional /** This endpoint can be used to unschedule any pending plan changes on an existing subscription. */ class SubscriptionUnschedulePendingPlanChangesParams -constructor( +private constructor( private val subscriptionId: String, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, private val additionalBodyProperties: Map, -) { +) : Params { fun subscriptionId(): String = subscriptionId @@ -29,12 +30,12 @@ constructor( fun _additionalBodyProperties(): Map = additionalBodyProperties @JvmSynthetic - internal fun getBody(): Optional> = + internal fun _body(): Optional> = Optional.ofNullable(additionalBodyProperties.ifEmpty { null }) - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun getPathParam(index: Int): String { return when (index) { @@ -50,8 +51,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [SubscriptionUnschedulePendingPlanChangesParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var subscriptionId: String? = null private var additionalHeaders: Headers.Builder = Headers.builder() 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 e33793de..6d21017d 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 @@ -440,7 +440,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [SubscriptionUnschedulePendingPlanChangesResponse]. */ + class Builder internal constructor() { private var id: JsonField? = null private var activePlanPhaseOrder: JsonField? = null @@ -1095,7 +1096,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AdjustmentInterval]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustment: JsonField? = null @@ -1352,6 +1354,10 @@ private constructor( @JvmStatic fun ofMaximum(maximum: MaximumAdjustment) = Adjustment(maximum = maximum) } + /** + * An interface that defines how to map each variant of [Adjustment] to a value of type + * [T]. + */ interface Visitor { fun visitAmountDiscount(amountDiscount: AmountDiscountAdjustment): T @@ -1364,12 +1370,22 @@ private constructor( fun visitMaximum(maximum: MaximumAdjustment): T + /** + * Maps an unknown variant of [Adjustment] to a value of type [T]. + * + * An instance of [Adjustment] can contain an unknown variant if it was deserialized + * from data that doesn't match any known variant. For example, if the SDK is on an + * older version than the API, then the API may respond with new variants that the + * SDK is unaware of. + * + * @throws OrbInvalidDataException in the default implementation. + */ fun unknown(json: JsonValue?): T { throw OrbInvalidDataException("Unknown Adjustment: $json") } } - class Deserializer : BaseDeserializer(Adjustment::class) { + internal class Deserializer : BaseDeserializer(Adjustment::class) { override fun ObjectCodec.deserialize(node: JsonNode): Adjustment { val json = JsonValue.fromJsonNode(node) @@ -1423,7 +1439,7 @@ private constructor( } } - class Serializer : BaseSerializer(Adjustment::class) { + internal class Serializer : BaseSerializer(Adjustment::class) { override fun serialize( value: Adjustment, @@ -1562,7 +1578,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AmountDiscountAdjustment]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustmentType: JsonField? = null @@ -1721,6 +1738,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -1731,21 +1756,53 @@ private constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { AMOUNT_DISCOUNT, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { AMOUNT_DISCOUNT, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { AMOUNT_DISCOUNT -> Value.AMOUNT_DISCOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { AMOUNT_DISCOUNT -> Known.AMOUNT_DISCOUNT @@ -1905,7 +1962,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [PercentageDiscountAdjustment]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustmentType: JsonField? = null @@ -2067,6 +2125,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -2077,21 +2143,53 @@ private constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { PERCENTAGE_DISCOUNT, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PERCENTAGE_DISCOUNT, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { PERCENTAGE_DISCOUNT -> Value.PERCENTAGE_DISCOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { PERCENTAGE_DISCOUNT -> Known.PERCENTAGE_DISCOUNT @@ -2250,7 +2348,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [UsageDiscountAdjustment]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustmentType: JsonField? = null @@ -2409,6 +2508,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -2419,21 +2526,53 @@ private constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { USAGE_DISCOUNT, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { USAGE_DISCOUNT, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { USAGE_DISCOUNT -> Value.USAGE_DISCOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { USAGE_DISCOUNT -> Known.USAGE_DISCOUNT @@ -2602,7 +2741,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MinimumAdjustment]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustmentType: JsonField? = null @@ -2769,6 +2909,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -2779,21 +2927,53 @@ private constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { MINIMUM, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { MINIMUM, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { MINIMUM -> Value.MINIMUM else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { MINIMUM -> Known.MINIMUM @@ -2952,7 +3132,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MaximumAdjustment]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustmentType: JsonField? = null @@ -3110,6 +3291,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -3120,21 +3309,53 @@ private constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { MAXIMUM, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { MAXIMUM, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { MAXIMUM -> Value.MAXIMUM else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { MAXIMUM -> Known.MAXIMUM @@ -3270,7 +3491,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleAnchorConfiguration]. */ + class Builder internal constructor() { private var day: JsonField? = null private var month: JsonField = JsonMissing.of() @@ -3494,6 +3716,10 @@ private constructor( @JvmStatic fun ofUsage(usage: UsageDiscountInterval) = DiscountInterval(usage = usage) } + /** + * An interface that defines how to map each variant of [DiscountInterval] to a value of + * type [T]. + */ interface Visitor { fun visitAmount(amount: AmountDiscountInterval): T @@ -3502,12 +3728,22 @@ private constructor( fun visitUsage(usage: UsageDiscountInterval): T + /** + * Maps an unknown variant of [DiscountInterval] to a value of type [T]. + * + * An instance of [DiscountInterval] can contain an unknown variant if it was + * deserialized from data that doesn't match any known variant. For example, if the SDK + * is on an older version than the API, then the API may respond with new variants that + * the SDK is unaware of. + * + * @throws OrbInvalidDataException in the default implementation. + */ fun unknown(json: JsonValue?): T { throw OrbInvalidDataException("Unknown DiscountInterval: $json") } } - class Deserializer : BaseDeserializer(DiscountInterval::class) { + internal class Deserializer : BaseDeserializer(DiscountInterval::class) { override fun ObjectCodec.deserialize(node: JsonNode): DiscountInterval { val json = JsonValue.fromJsonNode(node) @@ -3545,7 +3781,7 @@ private constructor( } } - class Serializer : BaseSerializer(DiscountInterval::class) { + internal class Serializer : BaseSerializer(DiscountInterval::class) { override fun serialize( value: DiscountInterval, @@ -3664,7 +3900,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AmountDiscountInterval]. */ + class Builder internal constructor() { private var amountDiscount: JsonField? = null private var appliesToPriceIds: JsonField>? = null @@ -3813,6 +4050,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -3822,21 +4067,52 @@ private constructor( @JvmStatic fun of(value: String) = DiscountType(JsonField.of(value)) } + /** An enum containing [DiscountType]'s known values. */ enum class Known { AMOUNT, } + /** + * An enum containing [DiscountType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DiscountType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { AMOUNT, + /** + * An enum member indicating that [DiscountType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { AMOUNT -> Value.AMOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { AMOUNT -> Known.AMOUNT @@ -3978,7 +4254,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [PercentageDiscountInterval]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var appliesToPriceIntervalIds: JsonField>? = null @@ -4133,6 +4410,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -4142,21 +4427,52 @@ private constructor( @JvmStatic fun of(value: String) = DiscountType(JsonField.of(value)) } + /** An enum containing [DiscountType]'s known values. */ enum class Known { PERCENTAGE, } + /** + * An enum containing [DiscountType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DiscountType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PERCENTAGE, + /** + * An enum member indicating that [DiscountType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { PERCENTAGE -> Value.PERCENTAGE else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { PERCENTAGE -> Known.PERCENTAGE @@ -4304,7 +4620,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [UsageDiscountInterval]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var appliesToPriceIntervalIds: JsonField>? = null @@ -4458,6 +4775,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -4467,21 +4792,52 @@ private constructor( @JvmStatic fun of(value: String) = DiscountType(JsonField.of(value)) } + /** An enum containing [DiscountType]'s known values. */ enum class Known { USAGE, } + /** + * An enum containing [DiscountType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DiscountType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { USAGE, + /** + * An enum member indicating that [DiscountType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { USAGE -> Value.USAGE else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { USAGE -> Known.USAGE @@ -4588,7 +4944,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [FixedFeeQuantitySchedule]. */ + class Builder internal constructor() { private var endDate: JsonField? = null private var priceId: JsonField? = null @@ -4770,7 +5127,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MaximumInterval]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var appliesToPriceIntervalIds: JsonField>? = null @@ -4953,7 +5311,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -5099,7 +5458,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MinimumInterval]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var appliesToPriceIntervalIds: JsonField>? = null @@ -5438,7 +5798,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [PriceInterval]. */ + class Builder internal constructor() { private var id: JsonField? = null private var billingCycleDay: JsonField? = null @@ -5989,6 +6350,36 @@ private constructor( fun price(maxGroupTieredPackage: Price.MaxGroupTieredPackagePrice) = price(Price.ofMaxGroupTieredPackage(maxGroupTieredPackage)) + /** + * The Price resource represents a price that can be billed on a subscription, resulting + * in a charge on an invoice in the form of an invoice line item. Prices take a quantity + * and determine an amount to bill. + * + * Orb supports a few different pricing models out of the box. Each of these models is + * serialized differently in a given Price object. The model_type field determines the + * key for the configuration object that is present. + * + * For more on the types of prices, see + * [the core concepts documentation](/core-concepts#plan-and-price) + */ + fun price(scalableMatrixWithUnitPricing: Price.ScalableMatrixWithUnitPricingPrice) = + price(Price.ofScalableMatrixWithUnitPricing(scalableMatrixWithUnitPricing)) + + /** + * The Price resource represents a price that can be billed on a subscription, resulting + * in a charge on an invoice in the form of an invoice line item. Prices take a quantity + * and determine an amount to bill. + * + * Orb supports a few different pricing models out of the box. Each of these models is + * serialized differently in a given Price object. The model_type field determines the + * key for the configuration object that is present. + * + * For more on the types of prices, see + * [the core concepts documentation](/core-concepts#plan-and-price) + */ + fun price(scalableMatrixWithTieredPricing: Price.ScalableMatrixWithTieredPricingPrice) = + price(Price.ofScalableMatrixWithTieredPricing(scalableMatrixWithTieredPricing)) + /** * The start date of the price interval. This is the date that Orb starts billing for * this price. @@ -6093,7 +6484,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [FixedFeeQuantityTransition]. */ + class Builder internal constructor() { private var effectiveDate: JsonField? = null private var priceId: JsonField? = null @@ -6249,7 +6641,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [RedeemedCoupon]. */ + class Builder internal constructor() { private var couponId: JsonField? = null private var endDate: JsonField? = null @@ -6332,6 +6725,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -6345,19 +6746,37 @@ private constructor( @JvmStatic fun of(value: String) = Status(JsonField.of(value)) } + /** An enum containing [Status]'s known values. */ enum class Known { ACTIVE, ENDED, UPCOMING, } + /** + * An enum containing [Status]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Status] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ACTIVE, ENDED, UPCOMING, + /** An enum member indicating that [Status] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { ACTIVE -> Value.ACTIVE @@ -6366,6 +6785,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { ACTIVE -> Known.ACTIVE @@ -6429,7 +6856,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TrialInfo]. */ + class Builder internal constructor() { private var endDate: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() 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 40f48f33..ce89ab85 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 @@ -12,6 +12,7 @@ import com.withorb.api.core.JsonField import com.withorb.api.core.JsonMissing import com.withorb.api.core.JsonValue import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -37,12 +38,12 @@ import java.util.Optional * for the remainder of the billing period. */ class SubscriptionUpdateFixedFeeQuantityParams -constructor( +private constructor( private val subscriptionId: String, private val body: SubscriptionUpdateFixedFeeQuantityBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun subscriptionId(): String = subscriptionId @@ -90,11 +91,11 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getBody(): SubscriptionUpdateFixedFeeQuantityBody = body + @JvmSynthetic internal fun _body(): SubscriptionUpdateFixedFeeQuantityBody = body - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun getPathParam(index: Int): String { return when (index) { @@ -192,7 +193,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [SubscriptionUpdateFixedFeeQuantityBody]. */ + class Builder internal constructor() { private var priceId: JsonField? = null private var quantity: JsonField? = null @@ -317,8 +319,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [SubscriptionUpdateFixedFeeQuantityParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var subscriptionId: String? = null private var body: SubscriptionUpdateFixedFeeQuantityBody.Builder = @@ -527,6 +530,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -540,19 +551,39 @@ constructor( @JvmStatic fun of(value: String) = ChangeOption(JsonField.of(value)) } + /** An enum containing [ChangeOption]'s known values. */ enum class Known { IMMEDIATE, UPCOMING_INVOICE, EFFECTIVE_DATE, } + /** + * An enum containing [ChangeOption]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ChangeOption] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { IMMEDIATE, UPCOMING_INVOICE, EFFECTIVE_DATE, + /** + * An enum member indicating that [ChangeOption] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { IMMEDIATE -> Value.IMMEDIATE @@ -561,6 +592,14 @@ constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { IMMEDIATE -> Known.IMMEDIATE 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 20323a47..57a197a6 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 @@ -440,7 +440,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [SubscriptionUpdateFixedFeeQuantityResponse]. */ + class Builder internal constructor() { private var id: JsonField? = null private var activePlanPhaseOrder: JsonField? = null @@ -1091,7 +1092,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AdjustmentInterval]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustment: JsonField? = null @@ -1348,6 +1350,10 @@ private constructor( @JvmStatic fun ofMaximum(maximum: MaximumAdjustment) = Adjustment(maximum = maximum) } + /** + * An interface that defines how to map each variant of [Adjustment] to a value of type + * [T]. + */ interface Visitor { fun visitAmountDiscount(amountDiscount: AmountDiscountAdjustment): T @@ -1360,12 +1366,22 @@ private constructor( fun visitMaximum(maximum: MaximumAdjustment): T + /** + * Maps an unknown variant of [Adjustment] to a value of type [T]. + * + * An instance of [Adjustment] can contain an unknown variant if it was deserialized + * from data that doesn't match any known variant. For example, if the SDK is on an + * older version than the API, then the API may respond with new variants that the + * SDK is unaware of. + * + * @throws OrbInvalidDataException in the default implementation. + */ fun unknown(json: JsonValue?): T { throw OrbInvalidDataException("Unknown Adjustment: $json") } } - class Deserializer : BaseDeserializer(Adjustment::class) { + internal class Deserializer : BaseDeserializer(Adjustment::class) { override fun ObjectCodec.deserialize(node: JsonNode): Adjustment { val json = JsonValue.fromJsonNode(node) @@ -1419,7 +1435,7 @@ private constructor( } } - class Serializer : BaseSerializer(Adjustment::class) { + internal class Serializer : BaseSerializer(Adjustment::class) { override fun serialize( value: Adjustment, @@ -1558,7 +1574,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AmountDiscountAdjustment]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustmentType: JsonField? = null @@ -1717,6 +1734,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -1727,21 +1752,53 @@ private constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { AMOUNT_DISCOUNT, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { AMOUNT_DISCOUNT, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { AMOUNT_DISCOUNT -> Value.AMOUNT_DISCOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { AMOUNT_DISCOUNT -> Known.AMOUNT_DISCOUNT @@ -1901,7 +1958,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [PercentageDiscountAdjustment]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustmentType: JsonField? = null @@ -2063,6 +2121,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -2073,21 +2139,53 @@ private constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { PERCENTAGE_DISCOUNT, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PERCENTAGE_DISCOUNT, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { PERCENTAGE_DISCOUNT -> Value.PERCENTAGE_DISCOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { PERCENTAGE_DISCOUNT -> Known.PERCENTAGE_DISCOUNT @@ -2246,7 +2344,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [UsageDiscountAdjustment]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustmentType: JsonField? = null @@ -2405,6 +2504,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -2415,21 +2522,53 @@ private constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { USAGE_DISCOUNT, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { USAGE_DISCOUNT, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { USAGE_DISCOUNT -> Value.USAGE_DISCOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { USAGE_DISCOUNT -> Known.USAGE_DISCOUNT @@ -2598,7 +2737,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MinimumAdjustment]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustmentType: JsonField? = null @@ -2765,6 +2905,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -2775,21 +2923,53 @@ private constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { MINIMUM, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { MINIMUM, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { MINIMUM -> Value.MINIMUM else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { MINIMUM -> Known.MINIMUM @@ -2948,7 +3128,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MaximumAdjustment]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustmentType: JsonField? = null @@ -3106,6 +3287,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -3116,21 +3305,53 @@ private constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { MAXIMUM, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { MAXIMUM, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { MAXIMUM -> Value.MAXIMUM else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { MAXIMUM -> Known.MAXIMUM @@ -3266,7 +3487,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleAnchorConfiguration]. */ + class Builder internal constructor() { private var day: JsonField? = null private var month: JsonField = JsonMissing.of() @@ -3490,6 +3712,10 @@ private constructor( @JvmStatic fun ofUsage(usage: UsageDiscountInterval) = DiscountInterval(usage = usage) } + /** + * An interface that defines how to map each variant of [DiscountInterval] to a value of + * type [T]. + */ interface Visitor { fun visitAmount(amount: AmountDiscountInterval): T @@ -3498,12 +3724,22 @@ private constructor( fun visitUsage(usage: UsageDiscountInterval): T + /** + * Maps an unknown variant of [DiscountInterval] to a value of type [T]. + * + * An instance of [DiscountInterval] can contain an unknown variant if it was + * deserialized from data that doesn't match any known variant. For example, if the SDK + * is on an older version than the API, then the API may respond with new variants that + * the SDK is unaware of. + * + * @throws OrbInvalidDataException in the default implementation. + */ fun unknown(json: JsonValue?): T { throw OrbInvalidDataException("Unknown DiscountInterval: $json") } } - class Deserializer : BaseDeserializer(DiscountInterval::class) { + internal class Deserializer : BaseDeserializer(DiscountInterval::class) { override fun ObjectCodec.deserialize(node: JsonNode): DiscountInterval { val json = JsonValue.fromJsonNode(node) @@ -3541,7 +3777,7 @@ private constructor( } } - class Serializer : BaseSerializer(DiscountInterval::class) { + internal class Serializer : BaseSerializer(DiscountInterval::class) { override fun serialize( value: DiscountInterval, @@ -3660,7 +3896,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AmountDiscountInterval]. */ + class Builder internal constructor() { private var amountDiscount: JsonField? = null private var appliesToPriceIds: JsonField>? = null @@ -3809,6 +4046,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -3818,21 +4063,52 @@ private constructor( @JvmStatic fun of(value: String) = DiscountType(JsonField.of(value)) } + /** An enum containing [DiscountType]'s known values. */ enum class Known { AMOUNT, } + /** + * An enum containing [DiscountType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DiscountType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { AMOUNT, + /** + * An enum member indicating that [DiscountType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { AMOUNT -> Value.AMOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { AMOUNT -> Known.AMOUNT @@ -3974,7 +4250,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [PercentageDiscountInterval]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var appliesToPriceIntervalIds: JsonField>? = null @@ -4129,6 +4406,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -4138,21 +4423,52 @@ private constructor( @JvmStatic fun of(value: String) = DiscountType(JsonField.of(value)) } + /** An enum containing [DiscountType]'s known values. */ enum class Known { PERCENTAGE, } + /** + * An enum containing [DiscountType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DiscountType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PERCENTAGE, + /** + * An enum member indicating that [DiscountType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { PERCENTAGE -> Value.PERCENTAGE else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { PERCENTAGE -> Known.PERCENTAGE @@ -4300,7 +4616,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [UsageDiscountInterval]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var appliesToPriceIntervalIds: JsonField>? = null @@ -4454,6 +4771,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -4463,21 +4788,52 @@ private constructor( @JvmStatic fun of(value: String) = DiscountType(JsonField.of(value)) } + /** An enum containing [DiscountType]'s known values. */ enum class Known { USAGE, } + /** + * An enum containing [DiscountType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DiscountType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { USAGE, + /** + * An enum member indicating that [DiscountType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { USAGE -> Value.USAGE else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { USAGE -> Known.USAGE @@ -4584,7 +4940,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [FixedFeeQuantitySchedule]. */ + class Builder internal constructor() { private var endDate: JsonField? = null private var priceId: JsonField? = null @@ -4766,7 +5123,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MaximumInterval]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var appliesToPriceIntervalIds: JsonField>? = null @@ -4949,7 +5307,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -5095,7 +5454,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MinimumInterval]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var appliesToPriceIntervalIds: JsonField>? = null @@ -5434,7 +5794,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [PriceInterval]. */ + class Builder internal constructor() { private var id: JsonField? = null private var billingCycleDay: JsonField? = null @@ -5985,6 +6346,36 @@ private constructor( fun price(maxGroupTieredPackage: Price.MaxGroupTieredPackagePrice) = price(Price.ofMaxGroupTieredPackage(maxGroupTieredPackage)) + /** + * The Price resource represents a price that can be billed on a subscription, resulting + * in a charge on an invoice in the form of an invoice line item. Prices take a quantity + * and determine an amount to bill. + * + * Orb supports a few different pricing models out of the box. Each of these models is + * serialized differently in a given Price object. The model_type field determines the + * key for the configuration object that is present. + * + * For more on the types of prices, see + * [the core concepts documentation](/core-concepts#plan-and-price) + */ + fun price(scalableMatrixWithUnitPricing: Price.ScalableMatrixWithUnitPricingPrice) = + price(Price.ofScalableMatrixWithUnitPricing(scalableMatrixWithUnitPricing)) + + /** + * The Price resource represents a price that can be billed on a subscription, resulting + * in a charge on an invoice in the form of an invoice line item. Prices take a quantity + * and determine an amount to bill. + * + * Orb supports a few different pricing models out of the box. Each of these models is + * serialized differently in a given Price object. The model_type field determines the + * key for the configuration object that is present. + * + * For more on the types of prices, see + * [the core concepts documentation](/core-concepts#plan-and-price) + */ + fun price(scalableMatrixWithTieredPricing: Price.ScalableMatrixWithTieredPricingPrice) = + price(Price.ofScalableMatrixWithTieredPricing(scalableMatrixWithTieredPricing)) + /** * The start date of the price interval. This is the date that Orb starts billing for * this price. @@ -6089,7 +6480,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [FixedFeeQuantityTransition]. */ + class Builder internal constructor() { private var effectiveDate: JsonField? = null private var priceId: JsonField? = null @@ -6245,7 +6637,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [RedeemedCoupon]. */ + class Builder internal constructor() { private var couponId: JsonField? = null private var endDate: JsonField? = null @@ -6328,6 +6721,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -6341,19 +6742,37 @@ private constructor( @JvmStatic fun of(value: String) = Status(JsonField.of(value)) } + /** An enum containing [Status]'s known values. */ enum class Known { ACTIVE, ENDED, UPCOMING, } + /** + * An enum containing [Status]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Status] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ACTIVE, ENDED, UPCOMING, + /** An enum member indicating that [Status] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { ACTIVE -> Value.ACTIVE @@ -6362,6 +6781,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { ACTIVE -> Known.ACTIVE @@ -6425,7 +6852,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TrialInfo]. */ + class Builder internal constructor() { private var endDate: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUpdateParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUpdateParams.kt index 7f13834a..1c06a8c4 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUpdateParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUpdateParams.kt @@ -11,6 +11,7 @@ import com.withorb.api.core.JsonField import com.withorb.api.core.JsonMissing import com.withorb.api.core.JsonValue import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams @@ -24,12 +25,12 @@ import java.util.Optional * `invoicing_threshold`, and `default_invoice_memo` properties on a subscription. */ class SubscriptionUpdateParams -constructor( +private constructor( private val subscriptionId: String, private val body: SubscriptionUpdateBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun subscriptionId(): String = subscriptionId @@ -105,11 +106,11 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getBody(): SubscriptionUpdateBody = body + @JvmSynthetic internal fun _body(): SubscriptionUpdateBody = body - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun getPathParam(index: Int): String { return when (index) { @@ -244,7 +245,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [SubscriptionUpdateBody]. */ + class Builder internal constructor() { private var autoCollection: JsonField = JsonMissing.of() private var defaultInvoiceMemo: JsonField = JsonMissing.of() @@ -452,8 +454,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [SubscriptionUpdateParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var subscriptionId: String? = null private var body: SubscriptionUpdateBody.Builder = SubscriptionUpdateBody.builder() @@ -761,7 +764,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUpdateTrialParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUpdateTrialParams.kt index e4ee33ea..475c9e72 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUpdateTrialParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUpdateTrialParams.kt @@ -21,6 +21,7 @@ import com.withorb.api.core.JsonField import com.withorb.api.core.JsonMissing import com.withorb.api.core.JsonValue import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.checkRequired import com.withorb.api.core.getOrThrow import com.withorb.api.core.http.Headers @@ -51,12 +52,12 @@ import java.util.Optional * extended). */ class SubscriptionUpdateTrialParams -constructor( +private constructor( private val subscriptionId: String, private val body: SubscriptionUpdateTrialBody, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun subscriptionId(): String = subscriptionId @@ -90,11 +91,11 @@ constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getBody(): SubscriptionUpdateTrialBody = body + @JvmSynthetic internal fun _body(): SubscriptionUpdateTrialBody = body - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun getPathParam(index: Int): String { return when (index) { @@ -166,7 +167,8 @@ constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [SubscriptionUpdateTrialBody]. */ + class Builder internal constructor() { private var trialEndDate: JsonField? = null private var shift: JsonField = JsonMissing.of() @@ -272,8 +274,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [SubscriptionUpdateTrialParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var subscriptionId: String? = null private var body: SubscriptionUpdateTrialBody.Builder = @@ -540,18 +543,32 @@ constructor( TrialEndDate(unionMember1 = unionMember1) } + /** + * An interface that defines how to map each variant of [TrialEndDate] to a value of type + * [T]. + */ interface Visitor { fun visitOffsetDateTime(offsetDateTime: OffsetDateTime): T fun visitUnionMember1(unionMember1: UnionMember1): T + /** + * Maps an unknown variant of [TrialEndDate] to a value of type [T]. + * + * An instance of [TrialEndDate] can contain an unknown variant if it was deserialized + * from data that doesn't match any known variant. For example, if the SDK is on an + * older version than the API, then the API may respond with new variants that the SDK + * is unaware of. + * + * @throws OrbInvalidDataException in the default implementation. + */ fun unknown(json: JsonValue?): T { throw OrbInvalidDataException("Unknown TrialEndDate: $json") } } - class Deserializer : BaseDeserializer(TrialEndDate::class) { + internal class Deserializer : BaseDeserializer(TrialEndDate::class) { override fun ObjectCodec.deserialize(node: JsonNode): TrialEndDate { val json = JsonValue.fromJsonNode(node) @@ -567,7 +584,7 @@ constructor( } } - class Serializer : BaseSerializer(TrialEndDate::class) { + internal class Serializer : BaseSerializer(TrialEndDate::class) { override fun serialize( value: TrialEndDate, @@ -589,6 +606,14 @@ constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -598,21 +623,51 @@ constructor( @JvmStatic fun of(value: String) = UnionMember1(JsonField.of(value)) } + /** An enum containing [UnionMember1]'s known values. */ enum class Known { IMMEDIATE, } + /** + * An enum containing [UnionMember1]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [UnionMember1] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { IMMEDIATE, + /** + * An enum member indicating that [UnionMember1] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ fun value(): Value = when (this) { IMMEDIATE -> Value.IMMEDIATE else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { IMMEDIATE -> Known.IMMEDIATE 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 5423501c..23d7dc7c 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 @@ -440,7 +440,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [SubscriptionUpdateTrialResponse]. */ + class Builder internal constructor() { private var id: JsonField? = null private var activePlanPhaseOrder: JsonField? = null @@ -1082,7 +1083,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AdjustmentInterval]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustment: JsonField? = null @@ -1339,6 +1341,10 @@ private constructor( @JvmStatic fun ofMaximum(maximum: MaximumAdjustment) = Adjustment(maximum = maximum) } + /** + * An interface that defines how to map each variant of [Adjustment] to a value of type + * [T]. + */ interface Visitor { fun visitAmountDiscount(amountDiscount: AmountDiscountAdjustment): T @@ -1351,12 +1357,22 @@ private constructor( fun visitMaximum(maximum: MaximumAdjustment): T + /** + * Maps an unknown variant of [Adjustment] to a value of type [T]. + * + * An instance of [Adjustment] can contain an unknown variant if it was deserialized + * from data that doesn't match any known variant. For example, if the SDK is on an + * older version than the API, then the API may respond with new variants that the + * SDK is unaware of. + * + * @throws OrbInvalidDataException in the default implementation. + */ fun unknown(json: JsonValue?): T { throw OrbInvalidDataException("Unknown Adjustment: $json") } } - class Deserializer : BaseDeserializer(Adjustment::class) { + internal class Deserializer : BaseDeserializer(Adjustment::class) { override fun ObjectCodec.deserialize(node: JsonNode): Adjustment { val json = JsonValue.fromJsonNode(node) @@ -1410,7 +1426,7 @@ private constructor( } } - class Serializer : BaseSerializer(Adjustment::class) { + internal class Serializer : BaseSerializer(Adjustment::class) { override fun serialize( value: Adjustment, @@ -1549,7 +1565,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AmountDiscountAdjustment]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustmentType: JsonField? = null @@ -1708,6 +1725,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -1718,21 +1743,53 @@ private constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { AMOUNT_DISCOUNT, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { AMOUNT_DISCOUNT, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { AMOUNT_DISCOUNT -> Value.AMOUNT_DISCOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { AMOUNT_DISCOUNT -> Known.AMOUNT_DISCOUNT @@ -1892,7 +1949,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [PercentageDiscountAdjustment]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustmentType: JsonField? = null @@ -2054,6 +2112,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -2064,21 +2130,53 @@ private constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { PERCENTAGE_DISCOUNT, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PERCENTAGE_DISCOUNT, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { PERCENTAGE_DISCOUNT -> Value.PERCENTAGE_DISCOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { PERCENTAGE_DISCOUNT -> Known.PERCENTAGE_DISCOUNT @@ -2237,7 +2335,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [UsageDiscountAdjustment]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustmentType: JsonField? = null @@ -2396,6 +2495,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -2406,21 +2513,53 @@ private constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { USAGE_DISCOUNT, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { USAGE_DISCOUNT, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { USAGE_DISCOUNT -> Value.USAGE_DISCOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { USAGE_DISCOUNT -> Known.USAGE_DISCOUNT @@ -2589,7 +2728,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MinimumAdjustment]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustmentType: JsonField? = null @@ -2756,6 +2896,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -2766,21 +2914,53 @@ private constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { MINIMUM, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { MINIMUM, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { MINIMUM -> Value.MINIMUM else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { MINIMUM -> Known.MINIMUM @@ -2939,7 +3119,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MaximumAdjustment]. */ + class Builder internal constructor() { private var id: JsonField? = null private var adjustmentType: JsonField? = null @@ -3097,6 +3278,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value @@ -3107,21 +3296,53 @@ private constructor( @JvmStatic fun of(value: String) = AdjustmentType(JsonField.of(value)) } + /** An enum containing [AdjustmentType]'s known values. */ enum class Known { MAXIMUM, } + /** + * An enum containing [AdjustmentType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [AdjustmentType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { MAXIMUM, + /** + * An enum member indicating that [AdjustmentType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ fun value(): Value = when (this) { MAXIMUM -> Value.MAXIMUM else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a + * known member. + */ fun known(): Known = when (this) { MAXIMUM -> Known.MAXIMUM @@ -3257,7 +3478,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillingCycleAnchorConfiguration]. */ + class Builder internal constructor() { private var day: JsonField? = null private var month: JsonField = JsonMissing.of() @@ -3481,6 +3703,10 @@ private constructor( @JvmStatic fun ofUsage(usage: UsageDiscountInterval) = DiscountInterval(usage = usage) } + /** + * An interface that defines how to map each variant of [DiscountInterval] to a value of + * type [T]. + */ interface Visitor { fun visitAmount(amount: AmountDiscountInterval): T @@ -3489,12 +3715,22 @@ private constructor( fun visitUsage(usage: UsageDiscountInterval): T + /** + * Maps an unknown variant of [DiscountInterval] to a value of type [T]. + * + * An instance of [DiscountInterval] can contain an unknown variant if it was + * deserialized from data that doesn't match any known variant. For example, if the SDK + * is on an older version than the API, then the API may respond with new variants that + * the SDK is unaware of. + * + * @throws OrbInvalidDataException in the default implementation. + */ fun unknown(json: JsonValue?): T { throw OrbInvalidDataException("Unknown DiscountInterval: $json") } } - class Deserializer : BaseDeserializer(DiscountInterval::class) { + internal class Deserializer : BaseDeserializer(DiscountInterval::class) { override fun ObjectCodec.deserialize(node: JsonNode): DiscountInterval { val json = JsonValue.fromJsonNode(node) @@ -3532,7 +3768,7 @@ private constructor( } } - class Serializer : BaseSerializer(DiscountInterval::class) { + internal class Serializer : BaseSerializer(DiscountInterval::class) { override fun serialize( value: DiscountInterval, @@ -3651,7 +3887,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [AmountDiscountInterval]. */ + class Builder internal constructor() { private var amountDiscount: JsonField? = null private var appliesToPriceIds: JsonField>? = null @@ -3800,6 +4037,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -3809,21 +4054,52 @@ private constructor( @JvmStatic fun of(value: String) = DiscountType(JsonField.of(value)) } + /** An enum containing [DiscountType]'s known values. */ enum class Known { AMOUNT, } + /** + * An enum containing [DiscountType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DiscountType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { AMOUNT, + /** + * An enum member indicating that [DiscountType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { AMOUNT -> Value.AMOUNT else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { AMOUNT -> Known.AMOUNT @@ -3965,7 +4241,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [PercentageDiscountInterval]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var appliesToPriceIntervalIds: JsonField>? = null @@ -4120,6 +4397,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -4129,21 +4414,52 @@ private constructor( @JvmStatic fun of(value: String) = DiscountType(JsonField.of(value)) } + /** An enum containing [DiscountType]'s known values. */ enum class Known { PERCENTAGE, } + /** + * An enum containing [DiscountType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DiscountType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PERCENTAGE, + /** + * An enum member indicating that [DiscountType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { PERCENTAGE -> Value.PERCENTAGE else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { PERCENTAGE -> Known.PERCENTAGE @@ -4291,7 +4607,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [UsageDiscountInterval]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var appliesToPriceIntervalIds: JsonField>? = null @@ -4445,6 +4762,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -4454,21 +4779,52 @@ private constructor( @JvmStatic fun of(value: String) = DiscountType(JsonField.of(value)) } + /** An enum containing [DiscountType]'s known values. */ enum class Known { USAGE, } + /** + * An enum containing [DiscountType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [DiscountType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { USAGE, + /** + * An enum member indicating that [DiscountType] was instantiated with an + * unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { USAGE -> Value.USAGE else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { USAGE -> Known.USAGE @@ -4575,7 +4931,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [FixedFeeQuantitySchedule]. */ + class Builder internal constructor() { private var endDate: JsonField? = null private var priceId: JsonField? = null @@ -4757,7 +5114,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MaximumInterval]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var appliesToPriceIntervalIds: JsonField>? = null @@ -4940,7 +5298,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Metadata]. */ + class Builder internal constructor() { private var additionalProperties: MutableMap = mutableMapOf() @@ -5086,7 +5445,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MinimumInterval]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var appliesToPriceIntervalIds: JsonField>? = null @@ -5425,7 +5785,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [PriceInterval]. */ + class Builder internal constructor() { private var id: JsonField? = null private var billingCycleDay: JsonField? = null @@ -5976,6 +6337,36 @@ private constructor( fun price(maxGroupTieredPackage: Price.MaxGroupTieredPackagePrice) = price(Price.ofMaxGroupTieredPackage(maxGroupTieredPackage)) + /** + * The Price resource represents a price that can be billed on a subscription, resulting + * in a charge on an invoice in the form of an invoice line item. Prices take a quantity + * and determine an amount to bill. + * + * Orb supports a few different pricing models out of the box. Each of these models is + * serialized differently in a given Price object. The model_type field determines the + * key for the configuration object that is present. + * + * For more on the types of prices, see + * [the core concepts documentation](/core-concepts#plan-and-price) + */ + fun price(scalableMatrixWithUnitPricing: Price.ScalableMatrixWithUnitPricingPrice) = + price(Price.ofScalableMatrixWithUnitPricing(scalableMatrixWithUnitPricing)) + + /** + * The Price resource represents a price that can be billed on a subscription, resulting + * in a charge on an invoice in the form of an invoice line item. Prices take a quantity + * and determine an amount to bill. + * + * Orb supports a few different pricing models out of the box. Each of these models is + * serialized differently in a given Price object. The model_type field determines the + * key for the configuration object that is present. + * + * For more on the types of prices, see + * [the core concepts documentation](/core-concepts#plan-and-price) + */ + fun price(scalableMatrixWithTieredPricing: Price.ScalableMatrixWithTieredPricingPrice) = + price(Price.ofScalableMatrixWithTieredPricing(scalableMatrixWithTieredPricing)) + /** * The start date of the price interval. This is the date that Orb starts billing for * this price. @@ -6080,7 +6471,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [FixedFeeQuantityTransition]. */ + class Builder internal constructor() { private var effectiveDate: JsonField? = null private var priceId: JsonField? = null @@ -6236,7 +6628,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [RedeemedCoupon]. */ + class Builder internal constructor() { private var couponId: JsonField? = null private var endDate: JsonField? = null @@ -6319,6 +6712,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -6332,19 +6733,37 @@ private constructor( @JvmStatic fun of(value: String) = Status(JsonField.of(value)) } + /** An enum containing [Status]'s known values. */ enum class Known { ACTIVE, ENDED, UPCOMING, } + /** + * An enum containing [Status]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Status] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { ACTIVE, ENDED, UPCOMING, + /** An enum member indicating that [Status] was instantiated with an unknown value. */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { ACTIVE -> Value.ACTIVE @@ -6353,6 +6772,14 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { ACTIVE -> Known.ACTIVE @@ -6416,7 +6843,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TrialInfo]. */ + class Builder internal constructor() { private var endDate: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUsage.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUsage.kt index 849d787f..340b8860 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUsage.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/SubscriptionUsage.kt @@ -110,18 +110,32 @@ private constructor( fun ofGrouped(grouped: GroupedSubscriptionUsage) = SubscriptionUsage(grouped = grouped) } + /** + * An interface that defines how to map each variant of [SubscriptionUsage] to a value of type + * [T]. + */ interface Visitor { fun visitUngrouped(ungrouped: UngroupedSubscriptionUsage): T fun visitGrouped(grouped: GroupedSubscriptionUsage): T + /** + * Maps an unknown variant of [SubscriptionUsage] to a value of type [T]. + * + * An instance of [SubscriptionUsage] can contain an unknown variant if it was deserialized + * from data that doesn't match any known variant. For example, if the SDK is on an older + * version than the API, then the API may respond with new variants that the SDK is unaware + * of. + * + * @throws OrbInvalidDataException in the default implementation. + */ fun unknown(json: JsonValue?): T { throw OrbInvalidDataException("Unknown SubscriptionUsage: $json") } } - class Deserializer : BaseDeserializer(SubscriptionUsage::class) { + internal class Deserializer : BaseDeserializer(SubscriptionUsage::class) { override fun ObjectCodec.deserialize(node: JsonNode): SubscriptionUsage { val json = JsonValue.fromJsonNode(node) @@ -139,7 +153,7 @@ private constructor( } } - class Serializer : BaseSerializer(SubscriptionUsage::class) { + internal class Serializer : BaseSerializer(SubscriptionUsage::class) { override fun serialize( value: SubscriptionUsage, @@ -192,7 +206,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [UngroupedSubscriptionUsage]. */ + class Builder internal constructor() { private var data: JsonField>? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -306,7 +321,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Data]. */ + class Builder internal constructor() { private var billableMetric: JsonField? = null private var usage: JsonField>? = null @@ -427,7 +443,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillableMetric]. */ + class Builder internal constructor() { private var id: JsonField? = null private var name: JsonField? = null @@ -555,7 +572,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Usage]. */ + class Builder internal constructor() { private var quantity: JsonField? = null private var timeframeEnd: JsonField? = null @@ -643,6 +661,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -654,17 +680,38 @@ private constructor( @JvmStatic fun of(value: String) = ViewMode(JsonField.of(value)) } + /** An enum containing [ViewMode]'s known values. */ enum class Known { PERIODIC, CUMULATIVE, } + /** + * An enum containing [ViewMode]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ViewMode] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PERIODIC, CUMULATIVE, + /** + * An enum member indicating that [ViewMode] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { PERIODIC -> Value.PERIODIC @@ -672,6 +719,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { PERIODIC -> Known.PERIODIC @@ -778,7 +834,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [GroupedSubscriptionUsage]. */ + class Builder internal constructor() { private var data: JsonField>? = null private var paginationMetadata: JsonField = JsonMissing.of() @@ -914,7 +971,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Data]. */ + class Builder internal constructor() { private var billableMetric: JsonField? = null private var metricGroup: JsonField? = null @@ -1044,7 +1102,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [BillableMetric]. */ + class Builder internal constructor() { private var id: JsonField? = null private var name: JsonField? = null @@ -1162,7 +1221,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [MetricGroup]. */ + class Builder internal constructor() { private var propertyKey: JsonField? = null private var propertyValue: JsonField? = null @@ -1295,7 +1355,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Usage]. */ + class Builder internal constructor() { private var quantity: JsonField? = null private var timeframeEnd: JsonField? = null @@ -1383,6 +1444,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -1394,17 +1463,38 @@ private constructor( @JvmStatic fun of(value: String) = ViewMode(JsonField.of(value)) } + /** An enum containing [ViewMode]'s known values. */ enum class Known { PERIODIC, CUMULATIVE, } + /** + * An enum containing [ViewMode]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [ViewMode] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { PERIODIC, CUMULATIVE, + /** + * An enum member indicating that [ViewMode] was instantiated with an unknown + * value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ fun value(): Value = when (this) { PERIODIC -> Value.PERIODIC @@ -1412,6 +1502,15 @@ private constructor( else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known + * member. + */ fun known(): Known = when (this) { PERIODIC -> Known.PERIODIC diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/Subscriptions.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/Subscriptions.kt index 9b0c1acb..6e735207 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/Subscriptions.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/Subscriptions.kt @@ -63,7 +63,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [Subscriptions]. */ + class Builder internal constructor() { private var data: JsonField>? = null private var paginationMetadata: JsonField? = null diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/TopLevelPingParams.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/TopLevelPingParams.kt index 958b0db0..3df1bc5a 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/TopLevelPingParams.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/TopLevelPingParams.kt @@ -3,6 +3,7 @@ package com.withorb.api.models import com.withorb.api.core.NoAutoDetect +import com.withorb.api.core.Params import com.withorb.api.core.http.Headers import com.withorb.api.core.http.QueryParams import java.util.Objects @@ -15,18 +16,18 @@ import java.util.Objects * This API does not have any side-effects or return any Orb resources. */ class TopLevelPingParams -constructor( +private constructor( private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, -) { +) : Params { fun _additionalHeaders(): Headers = additionalHeaders fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders + override fun _headers(): Headers = additionalHeaders - @JvmSynthetic internal fun getQueryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = additionalQueryParams fun toBuilder() = Builder().from(this) @@ -35,8 +36,9 @@ constructor( @JvmStatic fun builder() = Builder() } + /** A builder for [TopLevelPingParams]. */ @NoAutoDetect - class Builder { + class Builder internal constructor() { private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/TopLevelPingResponse.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/TopLevelPingResponse.kt index e88848aa..19984a49 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/TopLevelPingResponse.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/TopLevelPingResponse.kt @@ -52,7 +52,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TopLevelPingResponse]. */ + class Builder internal constructor() { private var response: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/models/TrialDiscount.kt b/orb-java-core/src/main/kotlin/com/withorb/api/models/TrialDiscount.kt index 63f4baa6..5e9388c2 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/models/TrialDiscount.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/models/TrialDiscount.kt @@ -109,7 +109,8 @@ private constructor( @JvmStatic fun builder() = Builder() } - class Builder { + /** A builder for [TrialDiscount]. */ + class Builder internal constructor() { private var appliesToPriceIds: JsonField>? = null private var discountType: JsonField? = null @@ -239,6 +240,14 @@ private constructor( private val value: JsonField, ) : Enum { + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { @@ -248,21 +257,49 @@ private constructor( @JvmStatic fun of(value: String) = DiscountType(JsonField.of(value)) } + /** An enum containing [DiscountType]'s known values. */ enum class Known { TRIAL, } + /** + * An enum containing [DiscountType]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [DiscountType] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { TRIAL, + /** + * An enum member indicating that [DiscountType] was instantiated with an unknown value. + */ _UNKNOWN, } + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ fun value(): Value = when (this) { TRIAL -> Value.TRIAL else -> Value._UNKNOWN } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws OrbInvalidDataException if this class instance's value is a not a known member. + */ fun known(): Known = when (this) { TRIAL -> Known.TRIAL 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 600ce0fd..b797a3a8 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 @@ -11,6 +11,7 @@ import com.withorb.api.core.http.HttpMethod import com.withorb.api.core.http.HttpRequest import com.withorb.api.core.http.HttpResponse.Handler import com.withorb.api.core.json +import com.withorb.api.core.prepareAsync import com.withorb.api.errors.OrbError import com.withorb.api.models.Alert import com.withorb.api.models.AlertCreateForCustomerParams @@ -43,21 +44,19 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("alerts", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { retrieveHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { retrieveHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } private val updateHandler: Handler = @@ -72,22 +71,20 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.PUT) .addPathSegments("alerts", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { updateHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { updateHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } private val listHandler: Handler = @@ -113,22 +110,20 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("alerts") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { listHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { listHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - .let { AlertListPageAsync.of(this, params, it) } - } + .let { AlertListPageAsync.of(this, params, it) } + } } private val createForCustomerHandler: Handler = @@ -150,22 +145,20 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("alerts", "customer_id", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { createForCustomerHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { createForCustomerHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } private val createForExternalCustomerHandler: Handler = @@ -187,22 +180,20 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("alerts", "external_customer_id", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { createForExternalCustomerHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { createForExternalCustomerHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } private val createForSubscriptionHandler: Handler = @@ -228,22 +219,20 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("alerts", "subscription_id", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { createForSubscriptionHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { createForSubscriptionHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } private val disableHandler: Handler = @@ -262,22 +251,20 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("alerts", params.getPathParam(0), "disable") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .apply { params.getBody().ifPresent { body(json(clientOptions.jsonMapper, it)) } } + .apply { params._body().ifPresent { body(json(clientOptions.jsonMapper, it)) } } .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { disableHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { disableHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } private val enableHandler: Handler = @@ -296,21 +283,19 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("alerts", params.getPathParam(0), "enable") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .apply { params.getBody().ifPresent { body(json(clientOptions.jsonMapper, it)) } } + .apply { params._body().ifPresent { body(json(clientOptions.jsonMapper, it)) } } .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { enableHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { enableHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/CouponServiceAsyncImpl.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/CouponServiceAsyncImpl.kt index ac36ad83..6dede981 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/CouponServiceAsyncImpl.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/CouponServiceAsyncImpl.kt @@ -11,6 +11,7 @@ import com.withorb.api.core.http.HttpMethod import com.withorb.api.core.http.HttpRequest import com.withorb.api.core.http.HttpResponse.Handler import com.withorb.api.core.json +import com.withorb.api.core.prepareAsync import com.withorb.api.errors.OrbError import com.withorb.api.models.Coupon import com.withorb.api.models.CouponArchiveParams @@ -50,22 +51,20 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("coupons") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { createHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { createHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } private val listHandler: Handler = @@ -88,22 +87,20 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("coupons") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { listHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { listHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - .let { CouponListPageAsync.of(this, params, it) } - } + .let { CouponListPageAsync.of(this, params, it) } + } } private val archiveHandler: Handler = @@ -122,22 +119,20 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("coupons", params.getPathParam(0), "archive") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .apply { params.getBody().ifPresent { body(json(clientOptions.jsonMapper, it)) } } + .apply { params._body().ifPresent { body(json(clientOptions.jsonMapper, it)) } } .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { archiveHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { archiveHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } private val fetchHandler: Handler = @@ -155,20 +150,18 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("coupons", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { fetchHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { fetchHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } } 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 0ae7a105..08709d35 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 @@ -11,6 +11,7 @@ import com.withorb.api.core.http.HttpMethod import com.withorb.api.core.http.HttpRequest import com.withorb.api.core.http.HttpResponse.Handler import com.withorb.api.core.json +import com.withorb.api.core.prepareAsync import com.withorb.api.errors.OrbError import com.withorb.api.models.CreditNote import com.withorb.api.models.CreditNoteCreateParams @@ -38,22 +39,20 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("credit_notes") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { createHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { createHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } private val listHandler: Handler = @@ -73,22 +72,20 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("credit_notes") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { listHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { listHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - .let { CreditNoteListPageAsync.of(this, params, it) } - } + .let { CreditNoteListPageAsync.of(this, params, it) } + } } private val fetchHandler: Handler = @@ -106,20 +103,18 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("credit_notes", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { fetchHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { fetchHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } } 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 b58ca0be..6b3ca294 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 @@ -12,6 +12,7 @@ import com.withorb.api.core.http.HttpMethod import com.withorb.api.core.http.HttpRequest import com.withorb.api.core.http.HttpResponse.Handler import com.withorb.api.core.json +import com.withorb.api.core.prepareAsync import com.withorb.api.errors.OrbError import com.withorb.api.models.Customer import com.withorb.api.models.CustomerCreateParams @@ -77,22 +78,20 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("customers") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { createHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { createHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } private val updateHandler: Handler = @@ -112,22 +111,20 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.PUT) .addPathSegments("customers", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { updateHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { updateHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } private val listHandler: Handler = @@ -149,22 +146,20 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("customers") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { listHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { listHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - .let { CustomerListPageAsync.of(this, params, it) } - } + .let { CustomerListPageAsync.of(this, params, it) } + } } private val deleteHandler: Handler = emptyHandler().withErrorHandler(errorHandler) @@ -192,16 +187,12 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.DELETE) .addPathSegments("customers", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .apply { params.getBody().ifPresent { body(json(clientOptions.jsonMapper, it)) } } + .apply { params._body().ifPresent { body(json(clientOptions.jsonMapper, it)) } } .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response.use { deleteHandler.handle(it) } - } + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> response.use { deleteHandler.handle(it) } } } private val fetchHandler: Handler = @@ -222,21 +213,19 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("customers", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { fetchHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { fetchHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } private val fetchByExternalIdHandler: Handler = @@ -257,21 +246,19 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("customers", "external_customer_id", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { fetchByExternalIdHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { fetchByExternalIdHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } private val syncPaymentMethodsFromGatewayHandler: Handler = @@ -298,16 +285,14 @@ internal constructor( params.getPathParam(0), "sync_payment_methods_from_gateway" ) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .apply { params.getBody().ifPresent { body(json(clientOptions.jsonMapper, it)) } } + .apply { params._body().ifPresent { body(json(clientOptions.jsonMapper, it)) } } .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response.use { syncPaymentMethodsFromGatewayHandler.handle(it) } - } + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response.use { syncPaymentMethodsFromGatewayHandler.handle(it) } + } } private val syncPaymentMethodsFromGatewayByExternalCustomerIdHandler: Handler = @@ -333,16 +318,14 @@ internal constructor( params.getPathParam(0), "sync_payment_methods_from_gateway" ) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .apply { params.getBody().ifPresent { body(json(clientOptions.jsonMapper, it)) } } + .apply { params._body().ifPresent { body(json(clientOptions.jsonMapper, it)) } } .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response.use { syncPaymentMethodsFromGatewayByExternalCustomerIdHandler.handle(it) } - } + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response.use { syncPaymentMethodsFromGatewayByExternalCustomerIdHandler.handle(it) } + } } private val updateByExternalIdHandler: Handler = @@ -361,21 +344,19 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.PUT) .addPathSegments("customers", "external_customer_id", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { updateByExternalIdHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { updateByExternalIdHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/DimensionalPriceGroupServiceAsyncImpl.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/DimensionalPriceGroupServiceAsyncImpl.kt index 8702efa7..ef73d818 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/DimensionalPriceGroupServiceAsyncImpl.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/DimensionalPriceGroupServiceAsyncImpl.kt @@ -11,6 +11,7 @@ import com.withorb.api.core.http.HttpMethod import com.withorb.api.core.http.HttpRequest import com.withorb.api.core.http.HttpResponse.Handler import com.withorb.api.core.json +import com.withorb.api.core.prepareAsync import com.withorb.api.errors.OrbError import com.withorb.api.models.DimensionalPriceGroup import com.withorb.api.models.DimensionalPriceGroupCreateParams @@ -56,22 +57,20 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("dimensional_price_groups") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { createHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { createHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } private val retrieveHandler: Handler = @@ -86,21 +85,19 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("dimensional_price_groups", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { retrieveHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { retrieveHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } private val listHandler: Handler = @@ -116,21 +113,19 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("dimensional_price_groups") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { listHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { listHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - .let { DimensionalPriceGroupListPageAsync.of(this, params, it) } - } + .let { DimensionalPriceGroupListPageAsync.of(this, params, it) } + } } } 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 3415e1db..35ca0e20 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 @@ -11,6 +11,7 @@ import com.withorb.api.core.http.HttpMethod import com.withorb.api.core.http.HttpRequest import com.withorb.api.core.http.HttpResponse.Handler import com.withorb.api.core.json +import com.withorb.api.core.prepareAsync import com.withorb.api.errors.OrbError import com.withorb.api.models.EventDeprecateParams import com.withorb.api.models.EventDeprecateResponse @@ -93,22 +94,20 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.PUT) .addPathSegments("events", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { updateHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { updateHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } private val deprecateHandler: Handler = @@ -158,22 +157,20 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.PUT) .addPathSegments("events", params.getPathParam(0), "deprecate") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .apply { params.getBody().ifPresent { body(json(clientOptions.jsonMapper, it)) } } + .apply { params._body().ifPresent { body(json(clientOptions.jsonMapper, it)) } } .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { deprecateHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { deprecateHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } private val ingestHandler: Handler = @@ -376,22 +373,20 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("ingest") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { ingestHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { ingestHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } private val searchHandler: Handler = @@ -421,21 +416,19 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("events", "search") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { searchHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { searchHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/InvoiceLineItemServiceAsyncImpl.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/InvoiceLineItemServiceAsyncImpl.kt index b85145fe..f1e7c2ec 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/InvoiceLineItemServiceAsyncImpl.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/InvoiceLineItemServiceAsyncImpl.kt @@ -11,6 +11,7 @@ import com.withorb.api.core.http.HttpMethod import com.withorb.api.core.http.HttpRequest import com.withorb.api.core.http.HttpResponse.Handler import com.withorb.api.core.json +import com.withorb.api.core.prepareAsync import com.withorb.api.errors.OrbError import com.withorb.api.models.InvoiceLineItemCreateParams import com.withorb.api.models.InvoiceLineItemCreateResponse @@ -39,21 +40,19 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("invoice_line_items") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { createHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { createHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } } 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 2443c502..3c2319d5 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 @@ -11,6 +11,7 @@ import com.withorb.api.core.http.HttpMethod import com.withorb.api.core.http.HttpRequest import com.withorb.api.core.http.HttpResponse.Handler import com.withorb.api.core.json +import com.withorb.api.core.prepareAsync import com.withorb.api.errors.OrbError import com.withorb.api.models.Invoice import com.withorb.api.models.InvoiceCreateParams @@ -45,22 +46,20 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("invoices") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { createHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { createHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } private val updateHandler: Handler = @@ -80,22 +79,20 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.PUT) .addPathSegments("invoices", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { updateHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { updateHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } private val listHandler: Handler = @@ -124,22 +121,20 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("invoices") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { listHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { listHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - .let { InvoiceListPageAsync.of(this, params, it) } - } + .let { InvoiceListPageAsync.of(this, params, it) } + } } private val fetchHandler: Handler = @@ -156,21 +151,19 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("invoices", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { fetchHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { fetchHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } private val fetchUpcomingHandler: Handler = @@ -189,21 +182,19 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("invoices", "upcoming") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { fetchUpcomingHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { fetchUpcomingHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } private val issueHandler: Handler = @@ -224,22 +215,20 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("invoices", params.getPathParam(0), "issue") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { issueHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { issueHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } private val markPaidHandler: Handler = @@ -257,22 +246,20 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("invoices", params.getPathParam(0), "mark_paid") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { markPaidHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { markPaidHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } private val payHandler: Handler = @@ -290,22 +277,20 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("invoices", params.getPathParam(0), "pay") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .apply { params.getBody().ifPresent { body(json(clientOptions.jsonMapper, it)) } } + .apply { params._body().ifPresent { body(json(clientOptions.jsonMapper, it)) } } .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { payHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { payHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } private val voidInvoiceHandler: Handler = @@ -327,21 +312,19 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("invoices", params.getPathParam(0), "void") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .apply { params.getBody().ifPresent { body(json(clientOptions.jsonMapper, it)) } } + .apply { params._body().ifPresent { body(json(clientOptions.jsonMapper, it)) } } .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { voidInvoiceHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { voidInvoiceHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } } 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 b6eec159..076b70ee 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 @@ -11,6 +11,7 @@ import com.withorb.api.core.http.HttpMethod import com.withorb.api.core.http.HttpRequest import com.withorb.api.core.http.HttpResponse.Handler import com.withorb.api.core.json +import com.withorb.api.core.prepareAsync import com.withorb.api.errors.OrbError import com.withorb.api.models.Item import com.withorb.api.models.ItemCreateParams @@ -39,22 +40,20 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("items") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { createHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { createHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } private val updateHandler: Handler = @@ -69,22 +68,20 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.PUT) .addPathSegments("items", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { updateHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { updateHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } private val listHandler: Handler = @@ -100,22 +97,20 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("items") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { listHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { listHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - .let { ItemListPageAsync.of(this, params, it) } - } + .let { ItemListPageAsync.of(this, params, it) } + } } private val fetchHandler: Handler = @@ -130,20 +125,18 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("items", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { fetchHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { fetchHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } } 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 a1607951..8d37fd7e 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 @@ -11,6 +11,7 @@ import com.withorb.api.core.http.HttpMethod import com.withorb.api.core.http.HttpRequest import com.withorb.api.core.http.HttpResponse.Handler import com.withorb.api.core.json +import com.withorb.api.core.prepareAsync import com.withorb.api.errors.OrbError import com.withorb.api.models.BillableMetric import com.withorb.api.models.MetricCreateParams @@ -43,22 +44,20 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("metrics") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { createHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { createHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } private val updateHandler: Handler = @@ -76,22 +75,20 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.PUT) .addPathSegments("metrics", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { updateHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { updateHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } private val listHandler: Handler = @@ -111,22 +108,20 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("metrics") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { listHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { listHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - .let { MetricListPageAsync.of(this, params, it) } - } + .let { MetricListPageAsync.of(this, params, it) } + } } private val fetchHandler: Handler = @@ -144,20 +139,18 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("metrics", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { fetchHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { fetchHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } } 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 3b637765..5fc6fb45 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 @@ -11,6 +11,7 @@ import com.withorb.api.core.http.HttpMethod import com.withorb.api.core.http.HttpRequest import com.withorb.api.core.http.HttpResponse.Handler import com.withorb.api.core.json +import com.withorb.api.core.prepareAsync import com.withorb.api.errors.OrbError import com.withorb.api.models.Plan import com.withorb.api.models.PlanCreateParams @@ -47,22 +48,20 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("plans") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { createHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { createHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } private val updateHandler: Handler = @@ -82,22 +81,20 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.PUT) .addPathSegments("plans", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { updateHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { updateHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } private val listHandler: Handler = @@ -118,22 +115,20 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("plans") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { listHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { listHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - .let { PlanListPageAsync.of(this, params, it) } - } + .let { PlanListPageAsync.of(this, params, it) } + } } private val fetchHandler: Handler = @@ -165,20 +160,18 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("plans", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { fetchHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { fetchHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } } 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 de29ed46..f111ad35 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 @@ -11,6 +11,7 @@ import com.withorb.api.core.http.HttpMethod import com.withorb.api.core.http.HttpRequest import com.withorb.api.core.http.HttpResponse.Handler import com.withorb.api.core.json +import com.withorb.api.core.prepareAsync import com.withorb.api.errors.OrbError import com.withorb.api.models.Price import com.withorb.api.models.PriceCreateParams @@ -60,22 +61,20 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("prices") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { createHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { createHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } private val updateHandler: Handler = @@ -93,22 +92,20 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.PUT) .addPathSegments("prices", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { updateHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { updateHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } private val listHandler: Handler = @@ -127,22 +124,20 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("prices") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { listHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { listHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - .let { PriceListPageAsync.of(this, params, it) } - } + .let { PriceListPageAsync.of(this, params, it) } + } } private val evaluateHandler: Handler = @@ -175,22 +170,20 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("prices", params.getPathParam(0), "evaluate") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { evaluateHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { evaluateHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } private val fetchHandler: Handler = @@ -205,20 +198,18 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("prices", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { fetchHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { fetchHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } } 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 cf635eb8..0ea96467 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 @@ -11,6 +11,7 @@ import com.withorb.api.core.http.HttpMethod import com.withorb.api.core.http.HttpRequest import com.withorb.api.core.http.HttpResponse.Handler import com.withorb.api.core.json +import com.withorb.api.core.prepareAsync import com.withorb.api.errors.OrbError import com.withorb.api.models.Subscription import com.withorb.api.models.SubscriptionCancelParams @@ -302,22 +303,20 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("subscriptions") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { createHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { createHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } private val updateHandler: Handler = @@ -335,22 +334,20 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.PUT) .addPathSegments("subscriptions", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { updateHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { updateHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } private val listHandler: Handler = @@ -375,22 +372,20 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("subscriptions") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { listHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { listHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - .let { SubscriptionListPageAsync.of(this, params, it) } - } + .let { SubscriptionListPageAsync.of(this, params, it) } + } } private val cancelHandler: Handler = @@ -458,22 +453,20 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("subscriptions", params.getPathParam(0), "cancel") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { cancelHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { cancelHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } private val fetchHandler: Handler = @@ -491,21 +484,19 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("subscriptions", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { fetchHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { fetchHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } private val fetchCostsHandler: Handler = @@ -531,21 +522,19 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("subscriptions", params.getPathParam(0), "costs") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { fetchCostsHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { fetchCostsHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } private val fetchScheduleHandler: Handler = @@ -565,22 +554,20 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("subscriptions", params.getPathParam(0), "schedule") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { fetchScheduleHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { fetchScheduleHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - .let { SubscriptionFetchSchedulePageAsync.of(this, params, it) } - } + .let { SubscriptionFetchSchedulePageAsync.of(this, params, it) } + } } private val fetchUsageHandler: Handler = @@ -771,21 +758,19 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("subscriptions", params.getPathParam(0), "usage") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { fetchUsageHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { fetchUsageHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } private val priceIntervalsHandler: Handler = @@ -867,22 +852,20 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("subscriptions", params.getPathParam(0), "price_intervals") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { priceIntervalsHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { priceIntervalsHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } private val schedulePlanChangeHandler: Handler = @@ -1063,22 +1046,20 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("subscriptions", params.getPathParam(0), "schedule_plan_change") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { schedulePlanChangeHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { schedulePlanChangeHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } private val triggerPhaseHandler: Handler = @@ -1096,22 +1077,20 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("subscriptions", params.getPathParam(0), "trigger_phase") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { triggerPhaseHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { triggerPhaseHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } private val unscheduleCancellationHandler: Handler = @@ -1133,22 +1112,20 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("subscriptions", params.getPathParam(0), "unschedule_cancellation") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .apply { params.getBody().ifPresent { body(json(clientOptions.jsonMapper, it)) } } + .apply { params._body().ifPresent { body(json(clientOptions.jsonMapper, it)) } } .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { unscheduleCancellationHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { unscheduleCancellationHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } private val unscheduleFixedFeeQuantityUpdatesHandler: @@ -1174,22 +1151,20 @@ internal constructor( params.getPathParam(0), "unschedule_fixed_fee_quantity_updates" ) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { unscheduleFixedFeeQuantityUpdatesHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { unscheduleFixedFeeQuantityUpdatesHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } private val unschedulePendingPlanChangesHandler: @@ -1212,22 +1187,20 @@ internal constructor( params.getPathParam(0), "unschedule_pending_plan_changes" ) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .apply { params.getBody().ifPresent { body(json(clientOptions.jsonMapper, it)) } } + .apply { params._body().ifPresent { body(json(clientOptions.jsonMapper, it)) } } .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { unschedulePendingPlanChangesHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { unschedulePendingPlanChangesHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } private val updateFixedFeeQuantityHandler: Handler = @@ -1260,22 +1233,20 @@ internal constructor( params.getPathParam(0), "update_fixed_fee_quantity" ) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { updateFixedFeeQuantityHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { updateFixedFeeQuantityHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } private val updateTrialHandler: Handler = @@ -1308,21 +1279,19 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("subscriptions", params.getPathParam(0), "update_trial") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { updateTrialHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { updateTrialHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/TopLevelServiceAsyncImpl.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/TopLevelServiceAsyncImpl.kt index 30876e9f..5b8863da 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/TopLevelServiceAsyncImpl.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/TopLevelServiceAsyncImpl.kt @@ -10,6 +10,7 @@ import com.withorb.api.core.handlers.withErrorHandler import com.withorb.api.core.http.HttpMethod import com.withorb.api.core.http.HttpRequest import com.withorb.api.core.http.HttpResponse.Handler +import com.withorb.api.core.prepareAsync import com.withorb.api.errors.OrbError import com.withorb.api.models.TopLevelPingParams import com.withorb.api.models.TopLevelPingResponse @@ -41,20 +42,18 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("ping") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { pingHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { pingHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } } 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 ab64bc18..3b925ede 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 @@ -10,6 +10,7 @@ import com.withorb.api.core.handlers.withErrorHandler import com.withorb.api.core.http.HttpMethod import com.withorb.api.core.http.HttpRequest import com.withorb.api.core.http.HttpResponse.Handler +import com.withorb.api.core.prepareAsync import com.withorb.api.errors.OrbError import com.withorb.api.models.CouponSubscriptionListPageAsync import com.withorb.api.models.CouponSubscriptionListParams @@ -40,21 +41,19 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("coupons", params.getPathParam(0), "subscriptions") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { listHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { listHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - .let { CouponSubscriptionListPageAsync.of(this, params, it) } - } + .let { CouponSubscriptionListPageAsync.of(this, params, it) } + } } } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/customers/BalanceTransactionServiceAsyncImpl.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/customers/BalanceTransactionServiceAsyncImpl.kt index 714ece1f..989ffd6f 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/customers/BalanceTransactionServiceAsyncImpl.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/customers/BalanceTransactionServiceAsyncImpl.kt @@ -11,6 +11,7 @@ import com.withorb.api.core.http.HttpMethod import com.withorb.api.core.http.HttpRequest import com.withorb.api.core.http.HttpResponse.Handler import com.withorb.api.core.json +import com.withorb.api.core.prepareAsync import com.withorb.api.errors.OrbError import com.withorb.api.models.CustomerBalanceTransactionCreateParams import com.withorb.api.models.CustomerBalanceTransactionCreateResponse @@ -41,22 +42,20 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("customers", params.getPathParam(0), "balance_transactions") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { createHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { createHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } private val listHandler: Handler = @@ -98,21 +97,19 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("customers", params.getPathParam(0), "balance_transactions") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { listHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { listHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - .let { CustomerBalanceTransactionListPageAsync.of(this, params, it) } - } + .let { CustomerBalanceTransactionListPageAsync.of(this, params, it) } + } } } 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 863a2b56..09e00b30 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 @@ -10,6 +10,7 @@ import com.withorb.api.core.handlers.withErrorHandler import com.withorb.api.core.http.HttpMethod import com.withorb.api.core.http.HttpRequest import com.withorb.api.core.http.HttpResponse.Handler +import com.withorb.api.core.prepareAsync import com.withorb.api.errors.OrbError import com.withorb.api.models.CustomerCostListByExternalIdParams import com.withorb.api.models.CustomerCostListByExternalIdResponse @@ -146,21 +147,19 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("customers", params.getPathParam(0), "costs") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { listHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { listHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } private val listByExternalIdHandler: Handler = @@ -290,20 +289,18 @@ internal constructor( params.getPathParam(0), "costs" ) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { listByExternalIdHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { listByExternalIdHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/customers/CreditServiceAsyncImpl.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/customers/CreditServiceAsyncImpl.kt index 3a9a40e5..b967b959 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/customers/CreditServiceAsyncImpl.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/customers/CreditServiceAsyncImpl.kt @@ -10,6 +10,7 @@ import com.withorb.api.core.handlers.withErrorHandler import com.withorb.api.core.http.HttpMethod import com.withorb.api.core.http.HttpRequest import com.withorb.api.core.http.HttpResponse.Handler +import com.withorb.api.core.prepareAsync import com.withorb.api.errors.OrbError import com.withorb.api.models.CustomerCreditListByExternalIdPageAsync import com.withorb.api.models.CustomerCreditListByExternalIdParams @@ -57,22 +58,20 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("customers", params.getPathParam(0), "credits") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { listHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { listHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - .let { CustomerCreditListPageAsync.of(this, params, it) } - } + .let { CustomerCreditListPageAsync.of(this, params, it) } + } } private val listByExternalIdHandler: Handler = @@ -101,21 +100,19 @@ internal constructor( params.getPathParam(0), "credits" ) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { listByExternalIdHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { listByExternalIdHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - .let { CustomerCreditListByExternalIdPageAsync.of(this, params, it) } - } + .let { CustomerCreditListByExternalIdPageAsync.of(this, params, it) } + } } } 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 f1db9755..97222e27 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 @@ -11,6 +11,7 @@ import com.withorb.api.core.http.HttpMethod import com.withorb.api.core.http.HttpRequest import com.withorb.api.core.http.HttpResponse.Handler import com.withorb.api.core.json +import com.withorb.api.core.prepareAsync import com.withorb.api.errors.OrbError import com.withorb.api.models.CustomerCreditLedgerCreateEntryByExternalIdParams import com.withorb.api.models.CustomerCreditLedgerCreateEntryByExternalIdResponse @@ -120,22 +121,20 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("customers", params.getPathParam(0), "credits", "ledger") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { listHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { listHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - .let { CustomerCreditLedgerListPageAsync.of(this, params, it) } - } + .let { CustomerCreditLedgerListPageAsync.of(this, params, it) } + } } private val createEntryHandler: Handler = @@ -253,22 +252,20 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("customers", params.getPathParam(0), "credits", "ledger_entry") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { createEntryHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { createEntryHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } private val createEntryByExternalIdHandler: @@ -393,22 +390,20 @@ internal constructor( "credits", "ledger_entry" ) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { createEntryByExternalIdHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { createEntryByExternalIdHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } private val listByExternalIdHandler: @@ -511,21 +506,19 @@ internal constructor( "credits", "ledger" ) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { listByExternalIdHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { listByExternalIdHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - .let { CustomerCreditLedgerListByExternalIdPageAsync.of(this, params, it) } - } + .let { CustomerCreditLedgerListByExternalIdPageAsync.of(this, params, it) } + } } } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/customers/credits/TopUpServiceAsyncImpl.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/customers/credits/TopUpServiceAsyncImpl.kt index efcc9fe9..3ddbe05e 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/customers/credits/TopUpServiceAsyncImpl.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/customers/credits/TopUpServiceAsyncImpl.kt @@ -12,6 +12,7 @@ import com.withorb.api.core.http.HttpMethod import com.withorb.api.core.http.HttpRequest import com.withorb.api.core.http.HttpResponse.Handler import com.withorb.api.core.json +import com.withorb.api.core.prepareAsync import com.withorb.api.errors.OrbError import com.withorb.api.models.CustomerCreditTopUpCreateByExternalIdParams import com.withorb.api.models.CustomerCreditTopUpCreateByExternalIdResponse @@ -52,22 +53,20 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("customers", params.getPathParam(0), "credits", "top_ups") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { createHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { createHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } private val listHandler: Handler = @@ -83,22 +82,20 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("customers", params.getPathParam(0), "credits", "top_ups") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { listHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { listHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - .let { CustomerCreditTopUpListPageAsync.of(this, params, it) } - } + .let { CustomerCreditTopUpListPageAsync.of(this, params, it) } + } } private val deleteHandler: Handler = emptyHandler().withErrorHandler(errorHandler) @@ -118,16 +115,12 @@ internal constructor( "top_ups", params.getPathParam(1) ) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .apply { params.getBody().ifPresent { body(json(clientOptions.jsonMapper, it)) } } + .apply { params._body().ifPresent { body(json(clientOptions.jsonMapper, it)) } } .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response.use { deleteHandler.handle(it) } - } + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> response.use { deleteHandler.handle(it) } } } private val createByExternalIdHandler: Handler = @@ -156,22 +149,20 @@ internal constructor( "credits", "top_ups" ) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { createByExternalIdHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { createByExternalIdHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } private val deleteByExternalIdHandler: Handler = @@ -193,16 +184,12 @@ internal constructor( "top_ups", params.getPathParam(1) ) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .apply { params.getBody().ifPresent { body(json(clientOptions.jsonMapper, it)) } } + .apply { params._body().ifPresent { body(json(clientOptions.jsonMapper, it)) } } .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response.use { deleteByExternalIdHandler.handle(it) } - } + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> response.use { deleteByExternalIdHandler.handle(it) } } } private val listByExternalIdHandler: @@ -225,21 +212,19 @@ internal constructor( "credits", "top_ups" ) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { listByExternalIdHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { listByExternalIdHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - .let { CustomerCreditTopUpListByExternalIdPageAsync.of(this, params, it) } - } + .let { CustomerCreditTopUpListByExternalIdPageAsync.of(this, params, it) } + } } } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/dimensionalPriceGroups/ExternalDimensionalPriceGroupIdServiceAsyncImpl.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/dimensionalPriceGroups/ExternalDimensionalPriceGroupIdServiceAsyncImpl.kt index eeb4a000..e294b316 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/async/dimensionalPriceGroups/ExternalDimensionalPriceGroupIdServiceAsyncImpl.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/async/dimensionalPriceGroups/ExternalDimensionalPriceGroupIdServiceAsyncImpl.kt @@ -10,6 +10,7 @@ import com.withorb.api.core.handlers.withErrorHandler import com.withorb.api.core.http.HttpMethod import com.withorb.api.core.http.HttpRequest import com.withorb.api.core.http.HttpResponse.Handler +import com.withorb.api.core.prepareAsync import com.withorb.api.errors.OrbError import com.withorb.api.models.DimensionalPriceGroup import com.withorb.api.models.DimensionalPriceGroupExternalDimensionalPriceGroupIdRetrieveParams @@ -38,20 +39,18 @@ internal constructor( "external_dimensional_price_group_id", params.getPathParam(0) ) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { retrieveHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { retrieveHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } } 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 f583ae8e..9807a4ca 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 @@ -11,6 +11,7 @@ import com.withorb.api.core.http.HttpMethod import com.withorb.api.core.http.HttpRequest import com.withorb.api.core.http.HttpResponse.Handler import com.withorb.api.core.json +import com.withorb.api.core.prepareAsync import com.withorb.api.errors.OrbError import com.withorb.api.models.EventBackfillCloseParams import com.withorb.api.models.EventBackfillCloseResponse @@ -73,22 +74,20 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("events", "backfills") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { createHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { createHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } private val listHandler: Handler = @@ -111,22 +110,20 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("events", "backfills") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { listHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { listHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - .let { EventBackfillListPageAsync.of(this, params, it) } - } + .let { EventBackfillListPageAsync.of(this, params, it) } + } } private val closeHandler: Handler = @@ -146,22 +143,20 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("events", "backfills", params.getPathParam(0), "close") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .apply { params.getBody().ifPresent { body(json(clientOptions.jsonMapper, it)) } } + .apply { params._body().ifPresent { body(json(clientOptions.jsonMapper, it)) } } .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { closeHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { closeHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } private val fetchHandler: Handler = @@ -177,21 +172,19 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("events", "backfills", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { fetchHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { fetchHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } private val revertHandler: Handler = @@ -214,21 +207,19 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("events", "backfills", params.getPathParam(0), "revert") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .apply { params.getBody().ifPresent { body(json(clientOptions.jsonMapper, it)) } } + .apply { params._body().ifPresent { body(json(clientOptions.jsonMapper, it)) } } .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { revertHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { revertHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } } 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 038e2f53..2d22a44d 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 @@ -10,6 +10,7 @@ import com.withorb.api.core.handlers.withErrorHandler import com.withorb.api.core.http.HttpMethod import com.withorb.api.core.http.HttpRequest import com.withorb.api.core.http.HttpResponse.Handler +import com.withorb.api.core.prepareAsync import com.withorb.api.errors.OrbError import com.withorb.api.models.EventVolumeListParams import com.withorb.api.models.EventVolumes @@ -46,20 +47,18 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("events", "volume") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { listHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { listHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } } 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 45325308..3f2968b9 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 @@ -11,6 +11,7 @@ import com.withorb.api.core.http.HttpMethod import com.withorb.api.core.http.HttpRequest import com.withorb.api.core.http.HttpResponse.Handler import com.withorb.api.core.json +import com.withorb.api.core.prepareAsync import com.withorb.api.errors.OrbError import com.withorb.api.models.Plan import com.withorb.api.models.PlanExternalPlanIdFetchParams @@ -41,22 +42,20 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.PUT) .addPathSegments("plans", "external_plan_id", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { updateHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { updateHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } private val fetchHandler: Handler = @@ -87,20 +86,18 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("plans", "external_plan_id", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { fetchHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { fetchHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } } 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 1a935531..b7c50457 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 @@ -11,6 +11,7 @@ import com.withorb.api.core.http.HttpMethod import com.withorb.api.core.http.HttpRequest import com.withorb.api.core.http.HttpResponse.Handler import com.withorb.api.core.json +import com.withorb.api.core.prepareAsync import com.withorb.api.errors.OrbError import com.withorb.api.models.Price import com.withorb.api.models.PriceExternalPriceIdFetchParams @@ -39,22 +40,20 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.PUT) .addPathSegments("prices", "external_price_id", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { updateHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { updateHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } private val fetchHandler: Handler = @@ -73,20 +72,18 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("prices", "external_price_id", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() - return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response - -> - response - .use { fetchHandler.handle(it) } - .apply { - if (requestOptions.responseValidation ?: clientOptions.responseValidation) { - validate() + .prepareAsync(clientOptions, params) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + response + .use { fetchHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } } - } - } + } } } 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 f4b58005..5db7719b 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 @@ -11,6 +11,7 @@ import com.withorb.api.core.http.HttpMethod import com.withorb.api.core.http.HttpRequest import com.withorb.api.core.http.HttpResponse.Handler import com.withorb.api.core.json +import com.withorb.api.core.prepare import com.withorb.api.errors.OrbError import com.withorb.api.models.Alert import com.withorb.api.models.AlertCreateForCustomerParams @@ -39,11 +40,8 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("alerts", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { retrieveHandler.handle(it) } @@ -64,12 +62,9 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.PUT) .addPathSegments("alerts", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { updateHandler.handle(it) } @@ -100,11 +95,8 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("alerts") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { listHandler.handle(it) } @@ -136,12 +128,9 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("alerts", "customer_id", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { createForCustomerHandler.handle(it) } @@ -172,12 +161,9 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("alerts", "external_customer_id", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { createForExternalCustomerHandler.handle(it) } @@ -212,12 +198,9 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("alerts", "subscription_id", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { createForSubscriptionHandler.handle(it) } @@ -242,12 +225,9 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("alerts", params.getPathParam(0), "disable") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .apply { params.getBody().ifPresent { body(json(clientOptions.jsonMapper, it)) } } + .apply { params._body().ifPresent { body(json(clientOptions.jsonMapper, it)) } } .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { disableHandler.handle(it) } @@ -272,12 +252,9 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("alerts", params.getPathParam(0), "enable") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .apply { params.getBody().ifPresent { body(json(clientOptions.jsonMapper, it)) } } + .apply { params._body().ifPresent { body(json(clientOptions.jsonMapper, it)) } } .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { enableHandler.handle(it) } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/CouponServiceImpl.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/CouponServiceImpl.kt index 075a6eba..e7b9b6db 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/CouponServiceImpl.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/CouponServiceImpl.kt @@ -11,6 +11,7 @@ import com.withorb.api.core.http.HttpMethod import com.withorb.api.core.http.HttpRequest import com.withorb.api.core.http.HttpResponse.Handler import com.withorb.api.core.json +import com.withorb.api.core.prepare import com.withorb.api.errors.OrbError import com.withorb.api.models.Coupon import com.withorb.api.models.CouponArchiveParams @@ -46,12 +47,9 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("coupons") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { createHandler.handle(it) } @@ -80,11 +78,8 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("coupons") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { listHandler.handle(it) } @@ -110,12 +105,9 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("coupons", params.getPathParam(0), "archive") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .apply { params.getBody().ifPresent { body(json(clientOptions.jsonMapper, it)) } } + .apply { params._body().ifPresent { body(json(clientOptions.jsonMapper, it)) } } .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { archiveHandler.handle(it) } @@ -139,11 +131,8 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("coupons", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { fetchHandler.handle(it) } 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 8096e29c..514ba039 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 @@ -11,6 +11,7 @@ import com.withorb.api.core.http.HttpMethod import com.withorb.api.core.http.HttpRequest import com.withorb.api.core.http.HttpResponse.Handler import com.withorb.api.core.json +import com.withorb.api.core.prepare import com.withorb.api.errors.OrbError import com.withorb.api.models.CreditNote import com.withorb.api.models.CreditNoteCreateParams @@ -37,12 +38,9 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("credit_notes") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { createHandler.handle(it) } @@ -71,11 +69,8 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("credit_notes") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { listHandler.handle(it) } @@ -100,11 +95,8 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("credit_notes", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { fetchHandler.handle(it) } 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 2fcbdb5f..a3d76a13 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 @@ -12,6 +12,7 @@ import com.withorb.api.core.http.HttpMethod import com.withorb.api.core.http.HttpRequest import com.withorb.api.core.http.HttpResponse.Handler import com.withorb.api.core.json +import com.withorb.api.core.prepare import com.withorb.api.errors.OrbError import com.withorb.api.models.Customer import com.withorb.api.models.CustomerCreateParams @@ -73,12 +74,9 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("customers") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { createHandler.handle(it) } @@ -104,12 +102,9 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.PUT) .addPathSegments("customers", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { updateHandler.handle(it) } @@ -140,11 +135,8 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("customers") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { listHandler.handle(it) } @@ -179,12 +171,9 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.DELETE) .addPathSegments("customers", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .apply { params.getBody().ifPresent { body(json(clientOptions.jsonMapper, it)) } } + .apply { params._body().ifPresent { body(json(clientOptions.jsonMapper, it)) } } .build() + .prepare(clientOptions, params) clientOptions.httpClient.execute(request, requestOptions).let { response -> response.use { deleteHandler.handle(it) } } @@ -205,11 +194,8 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("customers", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { fetchHandler.handle(it) } @@ -239,11 +225,8 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("customers", "external_customer_id", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { fetchByExternalIdHandler.handle(it) } @@ -279,12 +262,9 @@ internal constructor( params.getPathParam(0), "sync_payment_methods_from_gateway" ) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .apply { params.getBody().ifPresent { body(json(clientOptions.jsonMapper, it)) } } + .apply { params._body().ifPresent { body(json(clientOptions.jsonMapper, it)) } } .build() + .prepare(clientOptions, params) clientOptions.httpClient.execute(request, requestOptions).let { response -> response.use { syncPaymentMethodsFromGatewayHandler.handle(it) } } @@ -313,12 +293,9 @@ internal constructor( params.getPathParam(0), "sync_payment_methods_from_gateway" ) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .apply { params.getBody().ifPresent { body(json(clientOptions.jsonMapper, it)) } } + .apply { params._body().ifPresent { body(json(clientOptions.jsonMapper, it)) } } .build() + .prepare(clientOptions, params) clientOptions.httpClient.execute(request, requestOptions).let { response -> response.use { syncPaymentMethodsFromGatewayByExternalCustomerIdHandler.handle(it) } } @@ -340,12 +317,9 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.PUT) .addPathSegments("customers", "external_customer_id", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { updateByExternalIdHandler.handle(it) } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/DimensionalPriceGroupServiceImpl.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/DimensionalPriceGroupServiceImpl.kt index faa27b0b..5ac1deb2 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/DimensionalPriceGroupServiceImpl.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/DimensionalPriceGroupServiceImpl.kt @@ -11,6 +11,7 @@ import com.withorb.api.core.http.HttpMethod import com.withorb.api.core.http.HttpRequest import com.withorb.api.core.http.HttpResponse.Handler import com.withorb.api.core.json +import com.withorb.api.core.prepare import com.withorb.api.errors.OrbError import com.withorb.api.models.DimensionalPriceGroup import com.withorb.api.models.DimensionalPriceGroupCreateParams @@ -54,12 +55,9 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("dimensional_price_groups") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { createHandler.handle(it) } @@ -83,11 +81,8 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("dimensional_price_groups", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { retrieveHandler.handle(it) } @@ -112,11 +107,8 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("dimensional_price_groups") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { listHandler.handle(it) } 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 d04281b4..10ba429a 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 @@ -11,6 +11,7 @@ import com.withorb.api.core.http.HttpMethod import com.withorb.api.core.http.HttpRequest import com.withorb.api.core.http.HttpResponse.Handler import com.withorb.api.core.json +import com.withorb.api.core.prepare import com.withorb.api.errors.OrbError import com.withorb.api.models.EventDeprecateParams import com.withorb.api.models.EventDeprecateResponse @@ -92,12 +93,9 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.PUT) .addPathSegments("events", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { updateHandler.handle(it) } @@ -156,12 +154,9 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.PUT) .addPathSegments("events", params.getPathParam(0), "deprecate") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .apply { params.getBody().ifPresent { body(json(clientOptions.jsonMapper, it)) } } + .apply { params._body().ifPresent { body(json(clientOptions.jsonMapper, it)) } } .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { deprecateHandler.handle(it) } @@ -373,12 +368,9 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("ingest") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { ingestHandler.handle(it) } @@ -417,12 +409,9 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("events", "search") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { searchHandler.handle(it) } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/InvoiceLineItemServiceImpl.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/InvoiceLineItemServiceImpl.kt index b2c7797f..327eda85 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/InvoiceLineItemServiceImpl.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/InvoiceLineItemServiceImpl.kt @@ -11,6 +11,7 @@ import com.withorb.api.core.http.HttpMethod import com.withorb.api.core.http.HttpRequest import com.withorb.api.core.http.HttpResponse.Handler import com.withorb.api.core.json +import com.withorb.api.core.prepare import com.withorb.api.errors.OrbError import com.withorb.api.models.InvoiceLineItemCreateParams import com.withorb.api.models.InvoiceLineItemCreateResponse @@ -38,12 +39,9 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("invoice_line_items") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { createHandler.handle(it) } 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 e63e9bab..7f616ac7 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 @@ -11,6 +11,7 @@ import com.withorb.api.core.http.HttpMethod import com.withorb.api.core.http.HttpRequest import com.withorb.api.core.http.HttpResponse.Handler import com.withorb.api.core.json +import com.withorb.api.core.prepare import com.withorb.api.errors.OrbError import com.withorb.api.models.Invoice import com.withorb.api.models.InvoiceCreateParams @@ -41,12 +42,9 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("invoices") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { createHandler.handle(it) } @@ -72,12 +70,9 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.PUT) .addPathSegments("invoices", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { updateHandler.handle(it) } @@ -112,11 +107,8 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("invoices") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { listHandler.handle(it) } @@ -140,11 +132,8 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("invoices", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { fetchHandler.handle(it) } @@ -172,11 +161,8 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("invoices", "upcoming") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { fetchUpcomingHandler.handle(it) } @@ -203,12 +189,9 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("invoices", params.getPathParam(0), "issue") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { issueHandler.handle(it) } @@ -232,12 +215,9 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("invoices", params.getPathParam(0), "mark_paid") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { markPaidHandler.handle(it) } @@ -261,12 +241,9 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("invoices", params.getPathParam(0), "pay") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .apply { params.getBody().ifPresent { body(json(clientOptions.jsonMapper, it)) } } + .apply { params._body().ifPresent { body(json(clientOptions.jsonMapper, it)) } } .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { payHandler.handle(it) } @@ -297,12 +274,9 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("invoices", params.getPathParam(0), "void") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .apply { params.getBody().ifPresent { body(json(clientOptions.jsonMapper, it)) } } + .apply { params._body().ifPresent { body(json(clientOptions.jsonMapper, it)) } } .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { voidInvoiceHandler.handle(it) } 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 dfb3bb12..1693683a 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 @@ -11,6 +11,7 @@ import com.withorb.api.core.http.HttpMethod import com.withorb.api.core.http.HttpRequest import com.withorb.api.core.http.HttpResponse.Handler import com.withorb.api.core.json +import com.withorb.api.core.prepare import com.withorb.api.errors.OrbError import com.withorb.api.models.Item import com.withorb.api.models.ItemCreateParams @@ -35,12 +36,9 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("items") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { createHandler.handle(it) } @@ -61,12 +59,9 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.PUT) .addPathSegments("items", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { updateHandler.handle(it) } @@ -87,11 +82,8 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("items") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { listHandler.handle(it) } @@ -113,11 +105,8 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("items", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { fetchHandler.handle(it) } 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 e9561a68..32ae47c5 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 @@ -11,6 +11,7 @@ import com.withorb.api.core.http.HttpMethod import com.withorb.api.core.http.HttpRequest import com.withorb.api.core.http.HttpResponse.Handler import com.withorb.api.core.json +import com.withorb.api.core.prepare import com.withorb.api.errors.OrbError import com.withorb.api.models.BillableMetric import com.withorb.api.models.MetricCreateParams @@ -42,12 +43,9 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("metrics") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { createHandler.handle(it) } @@ -74,12 +72,9 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.PUT) .addPathSegments("metrics", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { updateHandler.handle(it) } @@ -105,11 +100,8 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("metrics") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { listHandler.handle(it) } @@ -134,11 +126,8 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("metrics", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { fetchHandler.handle(it) } 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 f9a84cfe..ade04bc0 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 @@ -11,6 +11,7 @@ import com.withorb.api.core.http.HttpMethod import com.withorb.api.core.http.HttpRequest import com.withorb.api.core.http.HttpResponse.Handler import com.withorb.api.core.json +import com.withorb.api.core.prepare import com.withorb.api.errors.OrbError import com.withorb.api.models.Plan import com.withorb.api.models.PlanCreateParams @@ -43,12 +44,9 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("plans") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { createHandler.handle(it) } @@ -74,12 +72,9 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.PUT) .addPathSegments("plans", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { updateHandler.handle(it) } @@ -105,11 +100,8 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("plans") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { listHandler.handle(it) } @@ -148,11 +140,8 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("plans", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { fetchHandler.handle(it) } 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 9e8ac6d9..ffbe5f3c 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 @@ -11,6 +11,7 @@ import com.withorb.api.core.http.HttpMethod import com.withorb.api.core.http.HttpRequest import com.withorb.api.core.http.HttpResponse.Handler import com.withorb.api.core.json +import com.withorb.api.core.prepare import com.withorb.api.errors.OrbError import com.withorb.api.models.Price import com.withorb.api.models.PriceCreateParams @@ -56,12 +57,9 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("prices") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { createHandler.handle(it) } @@ -85,12 +83,9 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.PUT) .addPathSegments("prices", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { updateHandler.handle(it) } @@ -114,11 +109,8 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("prices") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { listHandler.handle(it) } @@ -161,12 +153,9 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("prices", params.getPathParam(0), "evaluate") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { evaluateHandler.handle(it) } @@ -187,11 +176,8 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("prices", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { fetchHandler.handle(it) } 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 78e31a13..ea75383d 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 @@ -11,6 +11,7 @@ import com.withorb.api.core.http.HttpMethod import com.withorb.api.core.http.HttpRequest import com.withorb.api.core.http.HttpResponse.Handler import com.withorb.api.core.json +import com.withorb.api.core.prepare import com.withorb.api.errors.OrbError import com.withorb.api.models.Subscription import com.withorb.api.models.SubscriptionCancelParams @@ -301,12 +302,9 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("subscriptions") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { createHandler.handle(it) } @@ -333,12 +331,9 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.PUT) .addPathSegments("subscriptions", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { updateHandler.handle(it) } @@ -372,11 +367,8 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("subscriptions") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { listHandler.handle(it) } @@ -454,12 +446,9 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("subscriptions", params.getPathParam(0), "cancel") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { cancelHandler.handle(it) } @@ -486,11 +475,8 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("subscriptions", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { fetchHandler.handle(it) } @@ -525,11 +511,8 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("subscriptions", params.getPathParam(0), "costs") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { fetchCostsHandler.handle(it) } @@ -558,11 +541,8 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("subscriptions", params.getPathParam(0), "schedule") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { fetchScheduleHandler.handle(it) } @@ -763,11 +743,8 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("subscriptions", params.getPathParam(0), "usage") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { fetchUsageHandler.handle(it) } @@ -858,12 +835,9 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("subscriptions", params.getPathParam(0), "price_intervals") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { priceIntervalsHandler.handle(it) } @@ -1053,12 +1027,9 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("subscriptions", params.getPathParam(0), "schedule_plan_change") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { schedulePlanChangeHandler.handle(it) } @@ -1085,12 +1056,9 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("subscriptions", params.getPathParam(0), "trigger_phase") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { triggerPhaseHandler.handle(it) } @@ -1121,12 +1089,9 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("subscriptions", params.getPathParam(0), "unschedule_cancellation") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .apply { params.getBody().ifPresent { body(json(clientOptions.jsonMapper, it)) } } + .apply { params._body().ifPresent { body(json(clientOptions.jsonMapper, it)) } } .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { unscheduleCancellationHandler.handle(it) } @@ -1161,12 +1126,9 @@ internal constructor( params.getPathParam(0), "unschedule_fixed_fee_quantity_updates" ) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { unscheduleFixedFeeQuantityUpdatesHandler.handle(it) } @@ -1198,12 +1160,9 @@ internal constructor( params.getPathParam(0), "unschedule_pending_plan_changes" ) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .apply { params.getBody().ifPresent { body(json(clientOptions.jsonMapper, it)) } } + .apply { params._body().ifPresent { body(json(clientOptions.jsonMapper, it)) } } .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { unschedulePendingPlanChangesHandler.handle(it) } @@ -1245,12 +1204,9 @@ internal constructor( params.getPathParam(0), "update_fixed_fee_quantity" ) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { updateFixedFeeQuantityHandler.handle(it) } @@ -1292,12 +1248,9 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("subscriptions", params.getPathParam(0), "update_trial") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { updateTrialHandler.handle(it) } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/TopLevelServiceImpl.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/TopLevelServiceImpl.kt index d47af6f4..040f415b 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/TopLevelServiceImpl.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/TopLevelServiceImpl.kt @@ -10,6 +10,7 @@ import com.withorb.api.core.handlers.withErrorHandler import com.withorb.api.core.http.HttpMethod import com.withorb.api.core.http.HttpRequest import com.withorb.api.core.http.HttpResponse.Handler +import com.withorb.api.core.prepare import com.withorb.api.errors.OrbError import com.withorb.api.models.TopLevelPingParams import com.withorb.api.models.TopLevelPingResponse @@ -40,11 +41,8 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("ping") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { pingHandler.handle(it) } 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 0a6a8ab3..263a03fa 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 @@ -10,6 +10,7 @@ import com.withorb.api.core.handlers.withErrorHandler import com.withorb.api.core.http.HttpMethod import com.withorb.api.core.http.HttpRequest import com.withorb.api.core.http.HttpResponse.Handler +import com.withorb.api.core.prepare import com.withorb.api.errors.OrbError import com.withorb.api.models.CouponSubscriptionListPage import com.withorb.api.models.CouponSubscriptionListParams @@ -39,11 +40,8 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("coupons", params.getPathParam(0), "subscriptions") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { listHandler.handle(it) } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/customers/BalanceTransactionServiceImpl.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/customers/BalanceTransactionServiceImpl.kt index 5a39e596..c81887d9 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/customers/BalanceTransactionServiceImpl.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/customers/BalanceTransactionServiceImpl.kt @@ -11,6 +11,7 @@ import com.withorb.api.core.http.HttpMethod import com.withorb.api.core.http.HttpRequest import com.withorb.api.core.http.HttpResponse.Handler import com.withorb.api.core.json +import com.withorb.api.core.prepare import com.withorb.api.errors.OrbError import com.withorb.api.models.CustomerBalanceTransactionCreateParams import com.withorb.api.models.CustomerBalanceTransactionCreateResponse @@ -40,12 +41,9 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("customers", params.getPathParam(0), "balance_transactions") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { createHandler.handle(it) } @@ -96,11 +94,8 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("customers", params.getPathParam(0), "balance_transactions") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { listHandler.handle(it) } 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 e13c23fc..c5f05b48 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 @@ -10,6 +10,7 @@ import com.withorb.api.core.handlers.withErrorHandler import com.withorb.api.core.http.HttpMethod import com.withorb.api.core.http.HttpRequest import com.withorb.api.core.http.HttpResponse.Handler +import com.withorb.api.core.prepare import com.withorb.api.errors.OrbError import com.withorb.api.models.CustomerCostListByExternalIdParams import com.withorb.api.models.CustomerCostListByExternalIdResponse @@ -145,11 +146,8 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("customers", params.getPathParam(0), "costs") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { listHandler.handle(it) } @@ -288,11 +286,8 @@ internal constructor( params.getPathParam(0), "costs" ) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { listByExternalIdHandler.handle(it) } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/customers/CreditServiceImpl.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/customers/CreditServiceImpl.kt index caf77948..2b75935d 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/customers/CreditServiceImpl.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/customers/CreditServiceImpl.kt @@ -10,6 +10,7 @@ import com.withorb.api.core.handlers.withErrorHandler import com.withorb.api.core.http.HttpMethod import com.withorb.api.core.http.HttpRequest import com.withorb.api.core.http.HttpResponse.Handler +import com.withorb.api.core.prepare import com.withorb.api.errors.OrbError import com.withorb.api.models.CustomerCreditListByExternalIdPage import com.withorb.api.models.CustomerCreditListByExternalIdParams @@ -56,11 +57,8 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("customers", params.getPathParam(0), "credits") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { listHandler.handle(it) } @@ -99,11 +97,8 @@ internal constructor( params.getPathParam(0), "credits" ) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { listByExternalIdHandler.handle(it) } 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 292e3963..8ec58bd8 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 @@ -11,6 +11,7 @@ import com.withorb.api.core.http.HttpMethod import com.withorb.api.core.http.HttpRequest import com.withorb.api.core.http.HttpResponse.Handler import com.withorb.api.core.json +import com.withorb.api.core.prepare import com.withorb.api.errors.OrbError import com.withorb.api.models.CustomerCreditLedgerCreateEntryByExternalIdParams import com.withorb.api.models.CustomerCreditLedgerCreateEntryByExternalIdResponse @@ -119,11 +120,8 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("customers", params.getPathParam(0), "credits", "ledger") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { listHandler.handle(it) } @@ -251,12 +249,9 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("customers", params.getPathParam(0), "credits", "ledger_entry") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { createEntryHandler.handle(it) } @@ -390,12 +385,9 @@ internal constructor( "credits", "ledger_entry" ) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { createEntryByExternalIdHandler.handle(it) } @@ -505,11 +497,8 @@ internal constructor( "credits", "ledger" ) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { listByExternalIdHandler.handle(it) } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/customers/credits/TopUpServiceImpl.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/customers/credits/TopUpServiceImpl.kt index 86ab4069..dc07a056 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/customers/credits/TopUpServiceImpl.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/customers/credits/TopUpServiceImpl.kt @@ -12,6 +12,7 @@ import com.withorb.api.core.http.HttpMethod import com.withorb.api.core.http.HttpRequest import com.withorb.api.core.http.HttpResponse.Handler import com.withorb.api.core.json +import com.withorb.api.core.prepare import com.withorb.api.errors.OrbError import com.withorb.api.models.CustomerCreditTopUpCreateByExternalIdParams import com.withorb.api.models.CustomerCreditTopUpCreateByExternalIdResponse @@ -51,12 +52,9 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("customers", params.getPathParam(0), "credits", "top_ups") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { createHandler.handle(it) } @@ -81,11 +79,8 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("customers", params.getPathParam(0), "credits", "top_ups") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { listHandler.handle(it) } @@ -112,12 +107,9 @@ internal constructor( "top_ups", params.getPathParam(1) ) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .apply { params.getBody().ifPresent { body(json(clientOptions.jsonMapper, it)) } } + .apply { params._body().ifPresent { body(json(clientOptions.jsonMapper, it)) } } .build() + .prepare(clientOptions, params) clientOptions.httpClient.execute(request, requestOptions).let { response -> response.use { deleteHandler.handle(it) } } @@ -149,12 +141,9 @@ internal constructor( "credits", "top_ups" ) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { createByExternalIdHandler.handle(it) } @@ -185,12 +174,9 @@ internal constructor( "top_ups", params.getPathParam(1) ) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .apply { params.getBody().ifPresent { body(json(clientOptions.jsonMapper, it)) } } + .apply { params._body().ifPresent { body(json(clientOptions.jsonMapper, it)) } } .build() + .prepare(clientOptions, params) clientOptions.httpClient.execute(request, requestOptions).let { response -> response.use { deleteByExternalIdHandler.handle(it) } } @@ -215,11 +201,8 @@ internal constructor( "credits", "top_ups" ) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { listByExternalIdHandler.handle(it) } diff --git a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/dimensionalPriceGroups/ExternalDimensionalPriceGroupIdServiceImpl.kt b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/dimensionalPriceGroups/ExternalDimensionalPriceGroupIdServiceImpl.kt index 232f1bca..d65c0267 100644 --- a/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/dimensionalPriceGroups/ExternalDimensionalPriceGroupIdServiceImpl.kt +++ b/orb-java-core/src/main/kotlin/com/withorb/api/services/blocking/dimensionalPriceGroups/ExternalDimensionalPriceGroupIdServiceImpl.kt @@ -10,6 +10,7 @@ import com.withorb.api.core.handlers.withErrorHandler import com.withorb.api.core.http.HttpMethod import com.withorb.api.core.http.HttpRequest import com.withorb.api.core.http.HttpResponse.Handler +import com.withorb.api.core.prepare import com.withorb.api.errors.OrbError import com.withorb.api.models.DimensionalPriceGroup import com.withorb.api.models.DimensionalPriceGroupExternalDimensionalPriceGroupIdRetrieveParams @@ -37,11 +38,8 @@ internal constructor( "external_dimensional_price_group_id", params.getPathParam(0) ) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { retrieveHandler.handle(it) } 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 dd182bd7..e398df82 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 @@ -11,6 +11,7 @@ import com.withorb.api.core.http.HttpMethod import com.withorb.api.core.http.HttpRequest import com.withorb.api.core.http.HttpResponse.Handler import com.withorb.api.core.json +import com.withorb.api.core.prepare import com.withorb.api.errors.OrbError import com.withorb.api.models.EventBackfillCloseParams import com.withorb.api.models.EventBackfillCloseResponse @@ -72,12 +73,9 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("events", "backfills") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { createHandler.handle(it) } @@ -109,11 +107,8 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("events", "backfills") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { listHandler.handle(it) } @@ -143,12 +138,9 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("events", "backfills", params.getPathParam(0), "close") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .apply { params.getBody().ifPresent { body(json(clientOptions.jsonMapper, it)) } } + .apply { params._body().ifPresent { body(json(clientOptions.jsonMapper, it)) } } .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { closeHandler.handle(it) } @@ -173,11 +165,8 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("events", "backfills", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { fetchHandler.handle(it) } @@ -209,12 +198,9 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("events", "backfills", params.getPathParam(0), "revert") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .apply { params.getBody().ifPresent { body(json(clientOptions.jsonMapper, it)) } } + .apply { params._body().ifPresent { body(json(clientOptions.jsonMapper, it)) } } .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { revertHandler.handle(it) } 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 ca962a27..458f7efe 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 @@ -10,6 +10,7 @@ import com.withorb.api.core.handlers.withErrorHandler import com.withorb.api.core.http.HttpMethod import com.withorb.api.core.http.HttpRequest import com.withorb.api.core.http.HttpResponse.Handler +import com.withorb.api.core.prepare import com.withorb.api.errors.OrbError import com.withorb.api.models.EventVolumeListParams import com.withorb.api.models.EventVolumes @@ -42,11 +43,8 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("events", "volume") - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { listHandler.handle(it) } 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 36584fb1..7fe6f784 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 @@ -11,6 +11,7 @@ import com.withorb.api.core.http.HttpMethod import com.withorb.api.core.http.HttpRequest import com.withorb.api.core.http.HttpResponse.Handler import com.withorb.api.core.json +import com.withorb.api.core.prepare import com.withorb.api.errors.OrbError import com.withorb.api.models.Plan import com.withorb.api.models.PlanExternalPlanIdFetchParams @@ -40,12 +41,9 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.PUT) .addPathSegments("plans", "external_plan_id", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { updateHandler.handle(it) } @@ -85,11 +83,8 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("plans", "external_plan_id", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { fetchHandler.handle(it) } 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 43717b30..866dd260 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 @@ -11,6 +11,7 @@ import com.withorb.api.core.http.HttpMethod import com.withorb.api.core.http.HttpRequest import com.withorb.api.core.http.HttpResponse.Handler import com.withorb.api.core.json +import com.withorb.api.core.prepare import com.withorb.api.errors.OrbError import com.withorb.api.models.Price import com.withorb.api.models.PriceExternalPriceIdFetchParams @@ -38,12 +39,9 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.PUT) .addPathSegments("prices", "external_price_id", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) - .body(json(clientOptions.jsonMapper, params.getBody())) + .body(json(clientOptions.jsonMapper, params._body())) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { updateHandler.handle(it) } @@ -71,11 +69,8 @@ internal constructor( HttpRequest.builder() .method(HttpMethod.GET) .addPathSegments("prices", "external_price_id", params.getPathParam(0)) - .putAllQueryParams(clientOptions.queryParams) - .replaceAllQueryParams(params.getQueryParams()) - .putAllHeaders(clientOptions.headers) - .replaceAllHeaders(params.getHeaders()) .build() + .prepare(clientOptions, params) return clientOptions.httpClient.execute(request, requestOptions).let { response -> response .use { fetchHandler.handle(it) } diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/core/http/RetryingHttpClientTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/core/http/RetryingHttpClientTest.kt index 95d45431..917372c0 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/core/http/RetryingHttpClientTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/core/http/RetryingHttpClientTest.kt @@ -5,38 +5,83 @@ import com.github.tomakehurst.wiremock.junit5.WireMockRuntimeInfo import com.github.tomakehurst.wiremock.junit5.WireMockTest import com.github.tomakehurst.wiremock.stubbing.Scenario import com.withorb.api.client.okhttp.OkHttpClient +import com.withorb.api.core.RequestOptions +import java.io.InputStream +import java.util.concurrent.CompletableFuture import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.BeforeEach -import org.junit.jupiter.api.Test import org.junit.jupiter.params.ParameterizedTest import org.junit.jupiter.params.provider.ValueSource @WireMockTest internal class RetryingHttpClientTest { + private var openResponseCount = 0 private lateinit var httpClient: HttpClient @BeforeEach fun beforeEach(wmRuntimeInfo: WireMockRuntimeInfo) { - httpClient = OkHttpClient.builder().baseUrl(wmRuntimeInfo.httpBaseUrl).build() + val okHttpClient = OkHttpClient.builder().baseUrl(wmRuntimeInfo.httpBaseUrl).build() + httpClient = + object : HttpClient { + override fun execute( + request: HttpRequest, + requestOptions: RequestOptions + ): HttpResponse = trackClose(okHttpClient.execute(request, requestOptions)) + + override fun executeAsync( + request: HttpRequest, + requestOptions: RequestOptions + ): CompletableFuture = + okHttpClient.executeAsync(request, requestOptions).thenApply { trackClose(it) } + + override fun close() = okHttpClient.close() + + private fun trackClose(response: HttpResponse): HttpResponse { + openResponseCount++ + return object : HttpResponse { + private var isClosed = false + + override fun statusCode(): Int = response.statusCode() + + override fun headers(): Headers = response.headers() + + override fun body(): InputStream = response.body() + + override fun close() { + response.close() + if (isClosed) { + return + } + openResponseCount-- + isClosed = true + } + } + } + } resetAllScenarios() } - @Test - fun byDefaultShouldNotAddIdempotencyHeaderToRequest() { - val request = - HttpRequest.builder().method(HttpMethod.POST).addPathSegment("something").build() + @ParameterizedTest + @ValueSource(booleans = [false, true]) + fun execute(async: Boolean) { stubFor(post(urlPathEqualTo("/something")).willReturn(ok())) val retryingClient = RetryingHttpClient.builder().httpClient(httpClient).build() - val response = retryingClient.execute(request) + + val response = + retryingClient.execute( + HttpRequest.builder().method(HttpMethod.POST).addPathSegment("something").build(), + async + ) + assertThat(response.statusCode()).isEqualTo(200) verify(1, postRequestedFor(urlPathEqualTo("/something"))) + assertNoResponseLeaks() } - @Test - fun whenProvidedShouldAddIdempotencyHeaderToRequest() { - val request = - HttpRequest.builder().method(HttpMethod.POST).addPathSegment("something").build() + @ParameterizedTest + @ValueSource(booleans = [false, true]) + fun execute_withIdempotencyHeader(async: Boolean) { stubFor( post(urlPathEqualTo("/something")) .withHeader("X-Some-Header", matching("stainless-java-retry-.+")) @@ -45,21 +90,28 @@ internal class RetryingHttpClientTest { val retryingClient = RetryingHttpClient.builder() .httpClient(httpClient) + .maxRetries(2) .idempotencyHeader("X-Some-Header") .build() - val response = retryingClient.execute(request) + + val response = + retryingClient.execute( + HttpRequest.builder().method(HttpMethod.POST).addPathSegment("something").build(), + async + ) + assertThat(response.statusCode()).isEqualTo(200) verify(1, postRequestedFor(urlPathEqualTo("/something"))) + assertNoResponseLeaks() } @ParameterizedTest @ValueSource(booleans = [false, true]) - fun retryAfterHeader(async: Boolean) { - val request = - HttpRequest.builder().method(HttpMethod.POST).addPathSegment("something").build() + fun execute_withRetryAfterHeader(async: Boolean) { stubFor( post(urlPathEqualTo("/something")) - .inScenario("foo") // first we fail with a retry after header given as a date + // First we fail with a retry after header given as a date + .inScenario("foo") .whenScenarioStateIs(Scenario.STARTED) .willReturn( serviceUnavailable().withHeader("Retry-After", "Wed, 21 Oct 2015 07:28:00 GMT") @@ -68,14 +120,16 @@ internal class RetryingHttpClientTest { ) stubFor( post(urlPathEqualTo("/something")) - .inScenario("foo") // then we fail with a retry after header given as a delay + // Then we fail with a retry after header given as a delay + .inScenario("foo") .whenScenarioStateIs("RETRY_AFTER_DATE") .willReturn(serviceUnavailable().withHeader("Retry-After", "1.234")) .willSetStateTo("RETRY_AFTER_DELAY") ) stubFor( post(urlPathEqualTo("/something")) - .inScenario("foo") // then we return a success + // Then we return a success + .inScenario("foo") .whenScenarioStateIs("RETRY_AFTER_DELAY") .willReturn(ok()) .willSetStateTo("COMPLETED") @@ -84,8 +138,10 @@ internal class RetryingHttpClientTest { RetryingHttpClient.builder().httpClient(httpClient).maxRetries(2).build() val response = - if (async) retryingClient.executeAsync(request).get() - else retryingClient.execute(request) + retryingClient.execute( + HttpRequest.builder().method(HttpMethod.POST).addPathSegment("something").build(), + async + ) assertThat(response.statusCode()).isEqualTo(200) verify( @@ -103,17 +159,12 @@ internal class RetryingHttpClientTest { postRequestedFor(urlPathEqualTo("/something")) .withHeader("x-stainless-retry-count", equalTo("2")) ) + assertNoResponseLeaks() } @ParameterizedTest @ValueSource(booleans = [false, true]) - fun overwriteRetryCountHeader(async: Boolean) { - val request = - HttpRequest.builder() - .method(HttpMethod.POST) - .addPathSegment("something") - .putHeader("x-stainless-retry-count", "42") - .build() + fun execute_withOverwrittenRetryCountHeader(async: Boolean) { stubFor( post(urlPathEqualTo("/something")) .inScenario("foo") // first we fail with a retry after header given as a date @@ -134,8 +185,14 @@ internal class RetryingHttpClientTest { RetryingHttpClient.builder().httpClient(httpClient).maxRetries(2).build() val response = - if (async) retryingClient.executeAsync(request).get() - else retryingClient.execute(request) + retryingClient.execute( + HttpRequest.builder() + .method(HttpMethod.POST) + .addPathSegment("something") + .putHeader("x-stainless-retry-count", "42") + .build(), + async + ) assertThat(response.statusCode()).isEqualTo(200) verify( @@ -143,12 +200,12 @@ internal class RetryingHttpClientTest { postRequestedFor(urlPathEqualTo("/something")) .withHeader("x-stainless-retry-count", equalTo("42")) ) + assertNoResponseLeaks() } - @Test - fun retryAfterMsHeader() { - val request = - HttpRequest.builder().method(HttpMethod.POST).addPathSegment("something").build() + @ParameterizedTest + @ValueSource(booleans = [false, true]) + fun execute_withRetryAfterMsHeader(async: Boolean) { stubFor( post(urlPathEqualTo("/something")) .inScenario("foo") @@ -165,8 +222,22 @@ internal class RetryingHttpClientTest { ) val retryingClient = RetryingHttpClient.builder().httpClient(httpClient).maxRetries(1).build() - val response = retryingClient.execute(request) + + val response = + retryingClient.execute( + HttpRequest.builder().method(HttpMethod.POST).addPathSegment("something").build(), + async + ) + assertThat(response.statusCode()).isEqualTo(200) verify(2, postRequestedFor(urlPathEqualTo("/something"))) + assertNoResponseLeaks() } + + private fun HttpClient.execute(request: HttpRequest, async: Boolean): HttpResponse = + if (async) executeAsync(request).get() else execute(request) + + // When retrying, all failed responses should be closed. Only the final returned response should + // be open. + private fun assertNoResponseLeaks() = assertThat(openResponseCount).isEqualTo(1) } diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/core/http/SerializerTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/core/http/SerializerTest.kt index ee098af5..234ff9bf 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/core/http/SerializerTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/core/http/SerializerTest.kt @@ -65,7 +65,8 @@ internal class SerializerTest { } @NoAutoDetect - class Builder { + class Builder internal constructor() { + private var isActive: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/AlertCreateForCustomerParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/AlertCreateForCustomerParamsTest.kt index fecb4940..cff65af2 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/AlertCreateForCustomerParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/AlertCreateForCustomerParamsTest.kt @@ -18,7 +18,7 @@ class AlertCreateForCustomerParamsTest { } @Test - fun getBody() { + fun body() { val params = AlertCreateForCustomerParams.builder() .customerId("customer_id") @@ -26,7 +26,7 @@ class AlertCreateForCustomerParamsTest { .type(AlertCreateForCustomerParams.Type.USAGE_EXCEEDED) .addThreshold(AlertCreateForCustomerParams.Threshold.builder().value(0.0).build()) .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.currency()).isEqualTo("currency") assertThat(body.type()).isEqualTo(AlertCreateForCustomerParams.Type.USAGE_EXCEEDED) @@ -35,14 +35,14 @@ class AlertCreateForCustomerParamsTest { } @Test - fun getBodyWithoutOptionalFields() { + fun bodyWithoutOptionalFields() { val params = AlertCreateForCustomerParams.builder() .customerId("customer_id") .currency("currency") .type(AlertCreateForCustomerParams.Type.USAGE_EXCEEDED) .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.currency()).isEqualTo("currency") assertThat(body.type()).isEqualTo(AlertCreateForCustomerParams.Type.USAGE_EXCEEDED) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/AlertCreateForExternalCustomerParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/AlertCreateForExternalCustomerParamsTest.kt index 4e9c38c5..272c086e 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/AlertCreateForExternalCustomerParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/AlertCreateForExternalCustomerParamsTest.kt @@ -20,7 +20,7 @@ class AlertCreateForExternalCustomerParamsTest { } @Test - fun getBody() { + fun body() { val params = AlertCreateForExternalCustomerParams.builder() .externalCustomerId("external_customer_id") @@ -30,7 +30,7 @@ class AlertCreateForExternalCustomerParamsTest { AlertCreateForExternalCustomerParams.Threshold.builder().value(0.0).build() ) .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.currency()).isEqualTo("currency") assertThat(body.type()).isEqualTo(AlertCreateForExternalCustomerParams.Type.USAGE_EXCEEDED) @@ -41,14 +41,14 @@ class AlertCreateForExternalCustomerParamsTest { } @Test - fun getBodyWithoutOptionalFields() { + fun bodyWithoutOptionalFields() { val params = AlertCreateForExternalCustomerParams.builder() .externalCustomerId("external_customer_id") .currency("currency") .type(AlertCreateForExternalCustomerParams.Type.USAGE_EXCEEDED) .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.currency()).isEqualTo("currency") assertThat(body.type()).isEqualTo(AlertCreateForExternalCustomerParams.Type.USAGE_EXCEEDED) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/AlertCreateForSubscriptionParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/AlertCreateForSubscriptionParamsTest.kt index 2d494bd8..7e9f1fdd 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/AlertCreateForSubscriptionParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/AlertCreateForSubscriptionParamsTest.kt @@ -18,7 +18,7 @@ class AlertCreateForSubscriptionParamsTest { } @Test - fun getBody() { + fun body() { val params = AlertCreateForSubscriptionParams.builder() .subscriptionId("subscription_id") @@ -28,7 +28,7 @@ class AlertCreateForSubscriptionParamsTest { .type(AlertCreateForSubscriptionParams.Type.USAGE_EXCEEDED) .metricId("metric_id") .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.thresholds()) .isEqualTo( @@ -39,7 +39,7 @@ class AlertCreateForSubscriptionParamsTest { } @Test - fun getBodyWithoutOptionalFields() { + fun bodyWithoutOptionalFields() { val params = AlertCreateForSubscriptionParams.builder() .subscriptionId("subscription_id") @@ -48,7 +48,7 @@ class AlertCreateForSubscriptionParamsTest { ) .type(AlertCreateForSubscriptionParams.Type.USAGE_EXCEEDED) .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.thresholds()) .isEqualTo( diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/AlertDisableParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/AlertDisableParamsTest.kt index 6e1b9be4..c841dea5 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/AlertDisableParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/AlertDisableParamsTest.kt @@ -17,7 +17,7 @@ class AlertDisableParamsTest { } @Test - fun getQueryParams() { + fun queryParams() { val params = AlertDisableParams.builder() .alertConfigurationId("alert_configuration_id") @@ -25,15 +25,15 @@ class AlertDisableParamsTest { .build() val expected = QueryParams.builder() expected.put("subscription_id", "subscription_id") - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } @Test - fun getQueryParamsWithoutOptionalFields() { + fun queryParamsWithoutOptionalFields() { val params = AlertDisableParams.builder().alertConfigurationId("alert_configuration_id").build() val expected = QueryParams.builder() - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } @Test diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/AlertEnableParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/AlertEnableParamsTest.kt index 402b764a..6ee1865b 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/AlertEnableParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/AlertEnableParamsTest.kt @@ -17,7 +17,7 @@ class AlertEnableParamsTest { } @Test - fun getQueryParams() { + fun queryParams() { val params = AlertEnableParams.builder() .alertConfigurationId("alert_configuration_id") @@ -25,15 +25,15 @@ class AlertEnableParamsTest { .build() val expected = QueryParams.builder() expected.put("subscription_id", "subscription_id") - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } @Test - fun getQueryParamsWithoutOptionalFields() { + fun queryParamsWithoutOptionalFields() { val params = AlertEnableParams.builder().alertConfigurationId("alert_configuration_id").build() val expected = QueryParams.builder() - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } @Test diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/AlertListParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/AlertListParamsTest.kt index 35bb3306..62e2ab8c 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/AlertListParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/AlertListParamsTest.kt @@ -25,7 +25,7 @@ class AlertListParamsTest { } @Test - fun getQueryParams() { + fun queryParams() { val params = AlertListParams.builder() .createdAtGt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) @@ -48,13 +48,13 @@ class AlertListParamsTest { expected.put("external_customer_id", "external_customer_id") expected.put("limit", "1") expected.put("subscription_id", "subscription_id") - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } @Test - fun getQueryParamsWithoutOptionalFields() { + fun queryParamsWithoutOptionalFields() { val params = AlertListParams.builder().build() val expected = QueryParams.builder() - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } } diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/AlertUpdateParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/AlertUpdateParamsTest.kt index d29cab69..1e02e5b9 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/AlertUpdateParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/AlertUpdateParamsTest.kt @@ -16,26 +16,26 @@ class AlertUpdateParamsTest { } @Test - fun getBody() { + fun body() { val params = AlertUpdateParams.builder() .alertConfigurationId("alert_configuration_id") .addThreshold(AlertUpdateParams.Threshold.builder().value(0.0).build()) .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.thresholds()) .isEqualTo(listOf(AlertUpdateParams.Threshold.builder().value(0.0).build())) } @Test - fun getBodyWithoutOptionalFields() { + fun bodyWithoutOptionalFields() { val params = AlertUpdateParams.builder() .alertConfigurationId("alert_configuration_id") .addThreshold(AlertUpdateParams.Threshold.builder().value(0.0).build()) .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.thresholds()) .isEqualTo(listOf(AlertUpdateParams.Threshold.builder().value(0.0).build())) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/CouponCreateParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/CouponCreateParamsTest.kt index 1c738f37..e4854a24 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/CouponCreateParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/CouponCreateParamsTest.kt @@ -10,15 +10,7 @@ class CouponCreateParamsTest { @Test fun createCouponCreateParams() { CouponCreateParams.builder() - .discount( - CouponCreateParams.Discount.NewCouponPercentageDiscount.builder() - .discountType( - CouponCreateParams.Discount.NewCouponPercentageDiscount.DiscountType - .PERCENTAGE - ) - .percentageDiscount(0.0) - .build() - ) + .newCouponPercentageDiscount(0.0) .redemptionCode("HALFOFF") .durationInMonths(12L) .maxRedemptions(1L) @@ -26,23 +18,15 @@ class CouponCreateParamsTest { } @Test - fun getBody() { + fun body() { val params = CouponCreateParams.builder() - .discount( - CouponCreateParams.Discount.NewCouponPercentageDiscount.builder() - .discountType( - CouponCreateParams.Discount.NewCouponPercentageDiscount.DiscountType - .PERCENTAGE - ) - .percentageDiscount(0.0) - .build() - ) + .newCouponPercentageDiscount(0.0) .redemptionCode("HALFOFF") .durationInMonths(12L) .maxRedemptions(1L) .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.discount()) .isEqualTo( @@ -62,21 +46,13 @@ class CouponCreateParamsTest { } @Test - fun getBodyWithoutOptionalFields() { + fun bodyWithoutOptionalFields() { val params = CouponCreateParams.builder() - .discount( - CouponCreateParams.Discount.NewCouponPercentageDiscount.builder() - .discountType( - CouponCreateParams.Discount.NewCouponPercentageDiscount.DiscountType - .PERCENTAGE - ) - .percentageDiscount(0.0) - .build() - ) + .newCouponPercentageDiscount(0.0) .redemptionCode("HALFOFF") .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.discount()) .isEqualTo( diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/CouponListParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/CouponListParamsTest.kt index 1b09a92a..af4bf209 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/CouponListParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/CouponListParamsTest.kt @@ -19,7 +19,7 @@ class CouponListParamsTest { } @Test - fun getQueryParams() { + fun queryParams() { val params = CouponListParams.builder() .cursor("cursor") @@ -32,13 +32,13 @@ class CouponListParamsTest { expected.put("limit", "1") expected.put("redemption_code", "redemption_code") expected.put("show_archived", "true") - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } @Test - fun getQueryParamsWithoutOptionalFields() { + fun queryParamsWithoutOptionalFields() { val params = CouponListParams.builder().build() val expected = QueryParams.builder() - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } } diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/CouponSubscriptionListParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/CouponSubscriptionListParamsTest.kt index 6ca7910d..75ef5c63 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/CouponSubscriptionListParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/CouponSubscriptionListParamsTest.kt @@ -18,7 +18,7 @@ class CouponSubscriptionListParamsTest { } @Test - fun getQueryParams() { + fun queryParams() { val params = CouponSubscriptionListParams.builder() .couponId("coupon_id") @@ -28,14 +28,14 @@ class CouponSubscriptionListParamsTest { val expected = QueryParams.builder() expected.put("cursor", "cursor") expected.put("limit", "1") - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } @Test - fun getQueryParamsWithoutOptionalFields() { + fun queryParamsWithoutOptionalFields() { val params = CouponSubscriptionListParams.builder().couponId("coupon_id").build() val expected = QueryParams.builder() - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } @Test diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/CreditNoteCreateParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/CreditNoteCreateParamsTest.kt index 8bd661a2..a9c36cfb 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/CreditNoteCreateParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/CreditNoteCreateParamsTest.kt @@ -22,7 +22,7 @@ class CreditNoteCreateParamsTest { } @Test - fun getBody() { + fun body() { val params = CreditNoteCreateParams.builder() .addLineItem( @@ -34,7 +34,7 @@ class CreditNoteCreateParamsTest { .memo("An optional memo for my credit note.") .reason(CreditNoteCreateParams.Reason.DUPLICATE) .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.lineItems()) .isEqualTo( @@ -50,7 +50,7 @@ class CreditNoteCreateParamsTest { } @Test - fun getBodyWithoutOptionalFields() { + fun bodyWithoutOptionalFields() { val params = CreditNoteCreateParams.builder() .addLineItem( @@ -60,7 +60,7 @@ class CreditNoteCreateParamsTest { .build() ) .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.lineItems()) .isEqualTo( diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/CreditNoteListParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/CreditNoteListParamsTest.kt index e56651f0..af928ead 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/CreditNoteListParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/CreditNoteListParamsTest.kt @@ -14,18 +14,18 @@ class CreditNoteListParamsTest { } @Test - fun getQueryParams() { + fun queryParams() { val params = CreditNoteListParams.builder().cursor("cursor").limit(1L).build() val expected = QueryParams.builder() expected.put("cursor", "cursor") expected.put("limit", "1") - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } @Test - fun getQueryParamsWithoutOptionalFields() { + fun queryParamsWithoutOptionalFields() { val params = CreditNoteListParams.builder().build() val expected = QueryParams.builder() - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } } diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerBalanceTransactionCreateParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerBalanceTransactionCreateParamsTest.kt index 69fed9c6..c2789e27 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerBalanceTransactionCreateParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerBalanceTransactionCreateParamsTest.kt @@ -18,7 +18,7 @@ class CustomerBalanceTransactionCreateParamsTest { } @Test - fun getBody() { + fun body() { val params = CustomerBalanceTransactionCreateParams.builder() .customerId("customer_id") @@ -26,7 +26,7 @@ class CustomerBalanceTransactionCreateParamsTest { .type(CustomerBalanceTransactionCreateParams.Type.INCREMENT) .description("description") .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.amount()).isEqualTo("amount") assertThat(body.type()).isEqualTo(CustomerBalanceTransactionCreateParams.Type.INCREMENT) @@ -34,14 +34,14 @@ class CustomerBalanceTransactionCreateParamsTest { } @Test - fun getBodyWithoutOptionalFields() { + fun bodyWithoutOptionalFields() { val params = CustomerBalanceTransactionCreateParams.builder() .customerId("customer_id") .amount("amount") .type(CustomerBalanceTransactionCreateParams.Type.INCREMENT) .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.amount()).isEqualTo("amount") assertThat(body.type()).isEqualTo(CustomerBalanceTransactionCreateParams.Type.INCREMENT) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerBalanceTransactionListParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerBalanceTransactionListParamsTest.kt index a107f663..0e9c02b9 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerBalanceTransactionListParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerBalanceTransactionListParamsTest.kt @@ -23,7 +23,7 @@ class CustomerBalanceTransactionListParamsTest { } @Test - fun getQueryParams() { + fun queryParams() { val params = CustomerBalanceTransactionListParams.builder() .customerId("customer_id") @@ -41,15 +41,15 @@ class CustomerBalanceTransactionListParamsTest { expected.put("operation_time[gte]", "2019-12-27T18:11:19.117Z") expected.put("operation_time[lt]", "2019-12-27T18:11:19.117Z") expected.put("operation_time[lte]", "2019-12-27T18:11:19.117Z") - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } @Test - fun getQueryParamsWithoutOptionalFields() { + fun queryParamsWithoutOptionalFields() { val params = CustomerBalanceTransactionListParams.builder().customerId("customer_id").build() val expected = QueryParams.builder() - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } @Test diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCostListByExternalIdParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCostListByExternalIdParamsTest.kt index 70bcb624..be43658a 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCostListByExternalIdParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCostListByExternalIdParamsTest.kt @@ -21,7 +21,7 @@ class CustomerCostListByExternalIdParamsTest { } @Test - fun getQueryParams() { + fun queryParams() { val params = CustomerCostListByExternalIdParams.builder() .externalCustomerId("external_customer_id") @@ -35,17 +35,17 @@ class CustomerCostListByExternalIdParamsTest { expected.put("timeframe_end", "2022-03-01T05:00:00Z") expected.put("timeframe_start", "2022-02-01T05:00:00Z") expected.put("view_mode", CustomerCostListByExternalIdParams.ViewMode.PERIODIC.toString()) - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } @Test - fun getQueryParamsWithoutOptionalFields() { + fun queryParamsWithoutOptionalFields() { val params = CustomerCostListByExternalIdParams.builder() .externalCustomerId("external_customer_id") .build() val expected = QueryParams.builder() - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } @Test diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCostListByExternalIdResponseTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCostListByExternalIdResponseTest.kt index 2c7c0305..be05894f 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCostListByExternalIdResponseTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCostListByExternalIdResponseTest.kt @@ -105,6 +105,14 @@ class CustomerCostListByExternalIdResponseTest { .unitAmount("unit_amount") .build() ) + .dimensionalPriceConfiguration( + Price.UnitPrice.DimensionalPriceConfiguration.builder() + .addDimensionValue("string") + .dimensionalPriceGroupId( + "dimensional_price_group_id" + ) + .build() + ) .build() ) .subtotal("subtotal") @@ -205,6 +213,12 @@ class CustomerCostListByExternalIdResponseTest { .unitAmount("unit_amount") .build() ) + .dimensionalPriceConfiguration( + Price.UnitPrice.DimensionalPriceConfiguration.builder() + .addDimensionValue("string") + .dimensionalPriceGroupId("dimensional_price_group_id") + .build() + ) .build() ) .subtotal("subtotal") diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCostListParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCostListParamsTest.kt index 93ce194d..dda488dd 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCostListParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCostListParamsTest.kt @@ -21,7 +21,7 @@ class CustomerCostListParamsTest { } @Test - fun getQueryParams() { + fun queryParams() { val params = CustomerCostListParams.builder() .customerId("customer_id") @@ -35,14 +35,14 @@ class CustomerCostListParamsTest { expected.put("timeframe_end", "2022-03-01T05:00:00Z") expected.put("timeframe_start", "2022-02-01T05:00:00Z") expected.put("view_mode", CustomerCostListParams.ViewMode.PERIODIC.toString()) - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } @Test - fun getQueryParamsWithoutOptionalFields() { + fun queryParamsWithoutOptionalFields() { val params = CustomerCostListParams.builder().customerId("customer_id").build() val expected = QueryParams.builder() - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } @Test diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCostListResponseTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCostListResponseTest.kt index 1deef6a0..16913c58 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCostListResponseTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCostListResponseTest.kt @@ -105,6 +105,14 @@ class CustomerCostListResponseTest { .unitAmount("unit_amount") .build() ) + .dimensionalPriceConfiguration( + Price.UnitPrice.DimensionalPriceConfiguration.builder() + .addDimensionValue("string") + .dimensionalPriceGroupId( + "dimensional_price_group_id" + ) + .build() + ) .build() ) .subtotal("subtotal") @@ -205,6 +213,12 @@ class CustomerCostListResponseTest { .unitAmount("unit_amount") .build() ) + .dimensionalPriceConfiguration( + Price.UnitPrice.DimensionalPriceConfiguration.builder() + .addDimensionValue("string") + .dimensionalPriceGroupId("dimensional_price_group_id") + .build() + ) .build() ) .subtotal("subtotal") diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreateParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreateParamsTest.kt index 1cbfa634..56a4f5e5 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreateParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreateParamsTest.kt @@ -82,7 +82,7 @@ class CustomerCreateParamsTest { } @Test - fun getBody() { + fun body() { val params = CustomerCreateParams.builder() .email("dev@stainlessapi.com") @@ -154,7 +154,7 @@ class CustomerCreateParamsTest { ) .timezone("timezone") .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.email()).isEqualTo("dev@stainlessapi.com") assertThat(body.name()).isEqualTo("x") @@ -234,9 +234,9 @@ class CustomerCreateParamsTest { } @Test - fun getBodyWithoutOptionalFields() { + fun bodyWithoutOptionalFields() { val params = CustomerCreateParams.builder().email("dev@stainlessapi.com").name("x").build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.email()).isEqualTo("dev@stainlessapi.com") assertThat(body.name()).isEqualTo("x") diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditLedgerListByExternalIdParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditLedgerListByExternalIdParamsTest.kt index 072781fa..26d582db 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditLedgerListByExternalIdParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditLedgerListByExternalIdParamsTest.kt @@ -27,7 +27,7 @@ class CustomerCreditLedgerListByExternalIdParamsTest { } @Test - fun getQueryParams() { + fun queryParams() { val params = CustomerCreditLedgerListByExternalIdParams.builder() .externalCustomerId("external_customer_id") @@ -59,17 +59,17 @@ class CustomerCreditLedgerListByExternalIdParamsTest { ) expected.put("limit", "1") expected.put("minimum_amount", "minimum_amount") - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } @Test - fun getQueryParamsWithoutOptionalFields() { + fun queryParamsWithoutOptionalFields() { val params = CustomerCreditLedgerListByExternalIdParams.builder() .externalCustomerId("external_customer_id") .build() val expected = QueryParams.builder() - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } @Test diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditLedgerListParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditLedgerListParamsTest.kt index be878076..8a9f6612 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditLedgerListParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditLedgerListParamsTest.kt @@ -27,7 +27,7 @@ class CustomerCreditLedgerListParamsTest { } @Test - fun getQueryParams() { + fun queryParams() { val params = CustomerCreditLedgerListParams.builder() .customerId("customer_id") @@ -56,14 +56,14 @@ class CustomerCreditLedgerListParamsTest { expected.put("entry_type", CustomerCreditLedgerListParams.EntryType.INCREMENT.toString()) expected.put("limit", "1") expected.put("minimum_amount", "minimum_amount") - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } @Test - fun getQueryParamsWithoutOptionalFields() { + fun queryParamsWithoutOptionalFields() { val params = CustomerCreditLedgerListParams.builder().customerId("customer_id").build() val expected = QueryParams.builder() - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } @Test diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditListByExternalIdParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditListByExternalIdParamsTest.kt index 7c047b15..7e280759 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditListByExternalIdParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditListByExternalIdParamsTest.kt @@ -20,7 +20,7 @@ class CustomerCreditListByExternalIdParamsTest { } @Test - fun getQueryParams() { + fun queryParams() { val params = CustomerCreditListByExternalIdParams.builder() .externalCustomerId("external_customer_id") @@ -34,17 +34,17 @@ class CustomerCreditListByExternalIdParamsTest { expected.put("cursor", "cursor") expected.put("include_all_blocks", "true") expected.put("limit", "1") - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } @Test - fun getQueryParamsWithoutOptionalFields() { + fun queryParamsWithoutOptionalFields() { val params = CustomerCreditListByExternalIdParams.builder() .externalCustomerId("external_customer_id") .build() val expected = QueryParams.builder() - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } @Test diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditListParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditListParamsTest.kt index 001058c5..ab1b94af 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditListParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditListParamsTest.kt @@ -20,7 +20,7 @@ class CustomerCreditListParamsTest { } @Test - fun getQueryParams() { + fun queryParams() { val params = CustomerCreditListParams.builder() .customerId("customer_id") @@ -34,14 +34,14 @@ class CustomerCreditListParamsTest { expected.put("cursor", "cursor") expected.put("include_all_blocks", "true") expected.put("limit", "1") - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } @Test - fun getQueryParamsWithoutOptionalFields() { + fun queryParamsWithoutOptionalFields() { val params = CustomerCreditListParams.builder().customerId("customer_id").build() val expected = QueryParams.builder() - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } @Test diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditTopUpCreateByExternalIdParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditTopUpCreateByExternalIdParamsTest.kt index 14aaa16f..caa670f4 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditTopUpCreateByExternalIdParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditTopUpCreateByExternalIdParamsTest.kt @@ -29,7 +29,7 @@ class CustomerCreditTopUpCreateByExternalIdParamsTest { } @Test - fun getBody() { + fun body() { val params = CustomerCreditTopUpCreateByExternalIdParams.builder() .externalCustomerId("external_customer_id") @@ -48,7 +48,7 @@ class CustomerCreditTopUpCreateByExternalIdParamsTest { .expiresAfter(0L) .expiresAfterUnit(CustomerCreditTopUpCreateByExternalIdParams.ExpiresAfterUnit.DAY) .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.amount()).isEqualTo("amount") assertThat(body.currency()).isEqualTo("currency") @@ -69,7 +69,7 @@ class CustomerCreditTopUpCreateByExternalIdParamsTest { } @Test - fun getBodyWithoutOptionalFields() { + fun bodyWithoutOptionalFields() { val params = CustomerCreditTopUpCreateByExternalIdParams.builder() .externalCustomerId("external_customer_id") @@ -84,7 +84,7 @@ class CustomerCreditTopUpCreateByExternalIdParamsTest { .perUnitCostBasis("per_unit_cost_basis") .threshold("threshold") .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.amount()).isEqualTo("amount") assertThat(body.currency()).isEqualTo("currency") diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditTopUpCreateParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditTopUpCreateParamsTest.kt index 5c8d2d3a..9a6ad03d 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditTopUpCreateParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditTopUpCreateParamsTest.kt @@ -29,7 +29,7 @@ class CustomerCreditTopUpCreateParamsTest { } @Test - fun getBody() { + fun body() { val params = CustomerCreditTopUpCreateParams.builder() .customerId("customer_id") @@ -48,7 +48,7 @@ class CustomerCreditTopUpCreateParamsTest { .expiresAfter(0L) .expiresAfterUnit(CustomerCreditTopUpCreateParams.ExpiresAfterUnit.DAY) .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.amount()).isEqualTo("amount") assertThat(body.currency()).isEqualTo("currency") @@ -69,7 +69,7 @@ class CustomerCreditTopUpCreateParamsTest { } @Test - fun getBodyWithoutOptionalFields() { + fun bodyWithoutOptionalFields() { val params = CustomerCreditTopUpCreateParams.builder() .customerId("customer_id") @@ -84,7 +84,7 @@ class CustomerCreditTopUpCreateParamsTest { .perUnitCostBasis("per_unit_cost_basis") .threshold("threshold") .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.amount()).isEqualTo("amount") assertThat(body.currency()).isEqualTo("currency") diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditTopUpListByExternalIdParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditTopUpListByExternalIdParamsTest.kt index 0c6fef59..d0dc9212 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditTopUpListByExternalIdParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditTopUpListByExternalIdParamsTest.kt @@ -18,7 +18,7 @@ class CustomerCreditTopUpListByExternalIdParamsTest { } @Test - fun getQueryParams() { + fun queryParams() { val params = CustomerCreditTopUpListByExternalIdParams.builder() .externalCustomerId("external_customer_id") @@ -28,17 +28,17 @@ class CustomerCreditTopUpListByExternalIdParamsTest { val expected = QueryParams.builder() expected.put("cursor", "cursor") expected.put("limit", "1") - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } @Test - fun getQueryParamsWithoutOptionalFields() { + fun queryParamsWithoutOptionalFields() { val params = CustomerCreditTopUpListByExternalIdParams.builder() .externalCustomerId("external_customer_id") .build() val expected = QueryParams.builder() - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } @Test diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditTopUpListParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditTopUpListParamsTest.kt index bd477ca6..059a5467 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditTopUpListParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerCreditTopUpListParamsTest.kt @@ -18,7 +18,7 @@ class CustomerCreditTopUpListParamsTest { } @Test - fun getQueryParams() { + fun queryParams() { val params = CustomerCreditTopUpListParams.builder() .customerId("customer_id") @@ -28,14 +28,14 @@ class CustomerCreditTopUpListParamsTest { val expected = QueryParams.builder() expected.put("cursor", "cursor") expected.put("limit", "1") - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } @Test - fun getQueryParamsWithoutOptionalFields() { + fun queryParamsWithoutOptionalFields() { val params = CustomerCreditTopUpListParams.builder().customerId("customer_id").build() val expected = QueryParams.builder() - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } @Test diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerListParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerListParamsTest.kt index ac70c8b8..80d2fc25 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerListParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerListParamsTest.kt @@ -22,7 +22,7 @@ class CustomerListParamsTest { } @Test - fun getQueryParams() { + fun queryParams() { val params = CustomerListParams.builder() .createdAtGt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) @@ -39,13 +39,13 @@ class CustomerListParamsTest { expected.put("created_at[lte]", "2019-12-27T18:11:19.117Z") expected.put("cursor", "cursor") expected.put("limit", "1") - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } @Test - fun getQueryParamsWithoutOptionalFields() { + fun queryParamsWithoutOptionalFields() { val params = CustomerListParams.builder().build() val expected = QueryParams.builder() - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } } diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerUpdateByExternalIdParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerUpdateByExternalIdParamsTest.kt index 34704946..43b1b283 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerUpdateByExternalIdParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerUpdateByExternalIdParamsTest.kt @@ -87,7 +87,7 @@ class CustomerUpdateByExternalIdParamsTest { } @Test - fun getBody() { + fun body() { val params = CustomerUpdateByExternalIdParams.builder() .id("external_customer_id") @@ -164,7 +164,7 @@ class CustomerUpdateByExternalIdParamsTest { .build() ) .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.accountingSyncConfiguration()) .contains( @@ -251,9 +251,9 @@ class CustomerUpdateByExternalIdParamsTest { } @Test - fun getBodyWithoutOptionalFields() { + fun bodyWithoutOptionalFields() { val params = CustomerUpdateByExternalIdParams.builder().id("external_customer_id").build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull } diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerUpdateParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerUpdateParamsTest.kt index b59bbc81..2756de2c 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerUpdateParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/CustomerUpdateParamsTest.kt @@ -82,7 +82,7 @@ class CustomerUpdateParamsTest { } @Test - fun getBody() { + fun body() { val params = CustomerUpdateParams.builder() .customerId("customer_id") @@ -154,7 +154,7 @@ class CustomerUpdateParamsTest { .build() ) .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.accountingSyncConfiguration()) .contains( @@ -233,9 +233,9 @@ class CustomerUpdateParamsTest { } @Test - fun getBodyWithoutOptionalFields() { + fun bodyWithoutOptionalFields() { val params = CustomerUpdateParams.builder().customerId("customer_id").build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull } diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/DimensionalPriceGroupCreateParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/DimensionalPriceGroupCreateParamsTest.kt index a0e7d4d5..93728ac3 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/DimensionalPriceGroupCreateParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/DimensionalPriceGroupCreateParamsTest.kt @@ -25,7 +25,7 @@ class DimensionalPriceGroupCreateParamsTest { } @Test - fun getBody() { + fun body() { val params = DimensionalPriceGroupCreateParams.builder() .billableMetricId("billable_metric_id") @@ -39,7 +39,7 @@ class DimensionalPriceGroupCreateParamsTest { .build() ) .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.billableMetricId()).isEqualTo("billable_metric_id") assertThat(body.dimensions()).isEqualTo(listOf("region", "instance_type")) @@ -55,7 +55,7 @@ class DimensionalPriceGroupCreateParamsTest { } @Test - fun getBodyWithoutOptionalFields() { + fun bodyWithoutOptionalFields() { val params = DimensionalPriceGroupCreateParams.builder() .billableMetricId("billable_metric_id") @@ -63,7 +63,7 @@ class DimensionalPriceGroupCreateParamsTest { .addDimension("instance_type") .name("name") .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.billableMetricId()).isEqualTo("billable_metric_id") assertThat(body.dimensions()).isEqualTo(listOf("region", "instance_type")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/DimensionalPriceGroupListParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/DimensionalPriceGroupListParamsTest.kt index 4234674b..b617fa4d 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/DimensionalPriceGroupListParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/DimensionalPriceGroupListParamsTest.kt @@ -14,18 +14,18 @@ class DimensionalPriceGroupListParamsTest { } @Test - fun getQueryParams() { + fun queryParams() { val params = DimensionalPriceGroupListParams.builder().cursor("cursor").limit(1L).build() val expected = QueryParams.builder() expected.put("cursor", "cursor") expected.put("limit", "1") - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } @Test - fun getQueryParamsWithoutOptionalFields() { + fun queryParamsWithoutOptionalFields() { val params = DimensionalPriceGroupListParams.builder().build() val expected = QueryParams.builder() - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } } diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/EventBackfillCreateParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/EventBackfillCreateParamsTest.kt index 71eedf83..c2285bff 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/EventBackfillCreateParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/EventBackfillCreateParamsTest.kt @@ -22,7 +22,7 @@ class EventBackfillCreateParamsTest { } @Test - fun getBody() { + fun body() { val params = EventBackfillCreateParams.builder() .timeframeEnd(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) @@ -33,7 +33,7 @@ class EventBackfillCreateParamsTest { .externalCustomerId("external_customer_id") .replaceExistingEvents(true) .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.timeframeEnd()).isEqualTo(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) assertThat(body.timeframeStart()) @@ -47,13 +47,13 @@ class EventBackfillCreateParamsTest { } @Test - fun getBodyWithoutOptionalFields() { + fun bodyWithoutOptionalFields() { val params = EventBackfillCreateParams.builder() .timeframeEnd(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .timeframeStart(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.timeframeEnd()).isEqualTo(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) assertThat(body.timeframeStart()) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/EventBackfillListParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/EventBackfillListParamsTest.kt index 79d0f08d..f3b27b30 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/EventBackfillListParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/EventBackfillListParamsTest.kt @@ -14,18 +14,18 @@ class EventBackfillListParamsTest { } @Test - fun getQueryParams() { + fun queryParams() { val params = EventBackfillListParams.builder().cursor("cursor").limit(1L).build() val expected = QueryParams.builder() expected.put("cursor", "cursor") expected.put("limit", "1") - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } @Test - fun getQueryParamsWithoutOptionalFields() { + fun queryParamsWithoutOptionalFields() { val params = EventBackfillListParams.builder().build() val expected = QueryParams.builder() - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } } diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/EventIngestParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/EventIngestParamsTest.kt index 7fd9e4cd..d16ad836 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/EventIngestParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/EventIngestParamsTest.kt @@ -29,7 +29,7 @@ class EventIngestParamsTest { } @Test - fun getQueryParams() { + fun queryParams() { val params = EventIngestParams.builder() .addEvent( @@ -48,11 +48,11 @@ class EventIngestParamsTest { val expected = QueryParams.builder() expected.put("backfill_id", "backfill_id") expected.put("debug", "true") - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } @Test - fun getQueryParamsWithoutOptionalFields() { + fun queryParamsWithoutOptionalFields() { val params = EventIngestParams.builder() .addEvent( @@ -65,11 +65,11 @@ class EventIngestParamsTest { ) .build() val expected = QueryParams.builder() - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } @Test - fun getBody() { + fun body() { val params = EventIngestParams.builder() .addEvent( @@ -85,7 +85,7 @@ class EventIngestParamsTest { .backfillId("backfill_id") .debug(true) .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.events()) .isEqualTo( @@ -103,7 +103,7 @@ class EventIngestParamsTest { } @Test - fun getBodyWithoutOptionalFields() { + fun bodyWithoutOptionalFields() { val params = EventIngestParams.builder() .addEvent( @@ -115,7 +115,7 @@ class EventIngestParamsTest { .build() ) .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.events()) .isEqualTo( diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/EventSearchParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/EventSearchParamsTest.kt index 461616c2..f9410fd1 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/EventSearchParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/EventSearchParamsTest.kt @@ -18,14 +18,14 @@ class EventSearchParamsTest { } @Test - fun getBody() { + fun body() { val params = EventSearchParams.builder() .addEventId("string") .timeframeEnd(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .timeframeStart(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.eventIds()).isEqualTo(listOf("string")) assertThat(body.timeframeEnd()).contains(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) @@ -33,9 +33,9 @@ class EventSearchParamsTest { } @Test - fun getBodyWithoutOptionalFields() { + fun bodyWithoutOptionalFields() { val params = EventSearchParams.builder().addEventId("string").build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.eventIds()).isEqualTo(listOf("string")) } diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/EventUpdateParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/EventUpdateParamsTest.kt index 5883b628..1bbf2714 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/EventUpdateParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/EventUpdateParamsTest.kt @@ -22,7 +22,7 @@ class EventUpdateParamsTest { } @Test - fun getBody() { + fun body() { val params = EventUpdateParams.builder() .eventId("event_id") @@ -32,7 +32,7 @@ class EventUpdateParamsTest { .customerId("customer_id") .externalCustomerId("external_customer_id") .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.eventName()).isEqualTo("event_name") assertThat(body._properties()).isEqualTo(JsonValue.from(mapOf())) @@ -42,7 +42,7 @@ class EventUpdateParamsTest { } @Test - fun getBodyWithoutOptionalFields() { + fun bodyWithoutOptionalFields() { val params = EventUpdateParams.builder() .eventId("event_id") @@ -50,7 +50,7 @@ class EventUpdateParamsTest { .properties(JsonValue.from(mapOf())) .timestamp(OffsetDateTime.parse("2020-12-09T16:09:53Z")) .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.eventName()).isEqualTo("event_name") assertThat(body._properties()).isEqualTo(JsonValue.from(mapOf())) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/EventVolumeListParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/EventVolumeListParamsTest.kt index bea0ebe9..ee372031 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/EventVolumeListParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/EventVolumeListParamsTest.kt @@ -20,7 +20,7 @@ class EventVolumeListParamsTest { } @Test - fun getQueryParams() { + fun queryParams() { val params = EventVolumeListParams.builder() .timeframeStart(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) @@ -33,17 +33,17 @@ class EventVolumeListParamsTest { expected.put("cursor", "cursor") expected.put("limit", "1") expected.put("timeframe_end", "2024-10-11T06:00:00Z") - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } @Test - fun getQueryParamsWithoutOptionalFields() { + fun queryParamsWithoutOptionalFields() { val params = EventVolumeListParams.builder() .timeframeStart(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() val expected = QueryParams.builder() expected.put("timeframe_start", "2019-12-27T18:11:19.117Z") - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } } diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/InvoiceCreateParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/InvoiceCreateParamsTest.kt index 87f47af3..178f7c53 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/InvoiceCreateParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/InvoiceCreateParamsTest.kt @@ -53,7 +53,7 @@ class InvoiceCreateParamsTest { } @Test - fun getBody() { + fun body() { val params = InvoiceCreateParams.builder() .currency("USD") @@ -93,7 +93,7 @@ class InvoiceCreateParamsTest { ) .willAutoIssue(false) .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.currency()).isEqualTo("USD") assertThat(body.invoiceDate()).isEqualTo(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) @@ -141,7 +141,7 @@ class InvoiceCreateParamsTest { } @Test - fun getBodyWithoutOptionalFields() { + fun bodyWithoutOptionalFields() { val params = InvoiceCreateParams.builder() .currency("USD") @@ -163,7 +163,7 @@ class InvoiceCreateParamsTest { ) .netTerms(0L) .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.currency()).isEqualTo("USD") assertThat(body.invoiceDate()).isEqualTo(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/InvoiceFetchUpcomingParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/InvoiceFetchUpcomingParamsTest.kt index db1f67b3..501774d3 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/InvoiceFetchUpcomingParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/InvoiceFetchUpcomingParamsTest.kt @@ -14,18 +14,18 @@ class InvoiceFetchUpcomingParamsTest { } @Test - fun getQueryParams() { + fun queryParams() { val params = InvoiceFetchUpcomingParams.builder().subscriptionId("subscription_id").build() val expected = QueryParams.builder() expected.put("subscription_id", "subscription_id") - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } @Test - fun getQueryParamsWithoutOptionalFields() { + fun queryParamsWithoutOptionalFields() { val params = InvoiceFetchUpcomingParams.builder().subscriptionId("subscription_id").build() val expected = QueryParams.builder() expected.put("subscription_id", "subscription_id") - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } } diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/InvoiceFetchUpcomingResponseTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/InvoiceFetchUpcomingResponseTest.kt index 666acb5c..bc3a2d11 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/InvoiceFetchUpcomingResponseTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/InvoiceFetchUpcomingResponseTest.kt @@ -109,7 +109,27 @@ class InvoiceFetchUpcomingResponseTest { .addLineItem( InvoiceFetchUpcomingResponse.LineItem.builder() .id("id") + .adjustedSubtotal("5.00") + .addAdjustment( + InvoiceFetchUpcomingResponse.LineItem.Adjustment + .AmountDiscountAdjustment + .builder() + .id("id") + .adjustmentType( + InvoiceFetchUpcomingResponse.LineItem.Adjustment + .AmountDiscountAdjustment + .AdjustmentType + .AMOUNT_DISCOUNT + ) + .amountDiscount("amount_discount") + .addAppliesToPriceId("string") + .isInvoiceLevel(true) + .planPhaseOrder(0L) + .reason("reason") + .build() + ) .amount("7.00") + .creditsApplied("6.00") .discount( PercentageDiscount.builder() .addAppliesToPriceId("h74gfhdjvn7ujokd") @@ -136,6 +156,7 @@ class InvoiceFetchUpcomingResponseTest { ) .minimumAmount("minimum_amount") .name("Fixed Fee") + .partiallyInvoicedAmount("4.00") .price( Price.UnitPrice.builder() .id("id") @@ -210,6 +231,12 @@ class InvoiceFetchUpcomingResponseTest { .unitAmount("unit_amount") .build() ) + .dimensionalPriceConfiguration( + Price.UnitPrice.DimensionalPriceConfiguration.builder() + .addDimensionValue("string") + .dimensionalPriceGroupId("dimensional_price_group_id") + .build() + ) .build() ) .quantity(1.0) @@ -425,7 +452,26 @@ class InvoiceFetchUpcomingResponseTest { .containsExactly( InvoiceFetchUpcomingResponse.LineItem.builder() .id("id") + .adjustedSubtotal("5.00") + .addAdjustment( + InvoiceFetchUpcomingResponse.LineItem.Adjustment.AmountDiscountAdjustment + .builder() + .id("id") + .adjustmentType( + InvoiceFetchUpcomingResponse.LineItem.Adjustment + .AmountDiscountAdjustment + .AdjustmentType + .AMOUNT_DISCOUNT + ) + .amountDiscount("amount_discount") + .addAppliesToPriceId("string") + .isInvoiceLevel(true) + .planPhaseOrder(0L) + .reason("reason") + .build() + ) .amount("7.00") + .creditsApplied("6.00") .discount( PercentageDiscount.builder() .addAppliesToPriceId("h74gfhdjvn7ujokd") @@ -452,6 +498,7 @@ class InvoiceFetchUpcomingResponseTest { ) .minimumAmount("minimum_amount") .name("Fixed Fee") + .partiallyInvoicedAmount("4.00") .price( Price.UnitPrice.builder() .id("id") @@ -524,6 +571,12 @@ class InvoiceFetchUpcomingResponseTest { .unitAmount("unit_amount") .build() ) + .dimensionalPriceConfiguration( + Price.UnitPrice.DimensionalPriceConfiguration.builder() + .addDimensionValue("string") + .dimensionalPriceGroupId("dimensional_price_group_id") + .build() + ) .build() ) .quantity(1.0) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/InvoiceIssueParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/InvoiceIssueParamsTest.kt index 27a557f5..af106f96 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/InvoiceIssueParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/InvoiceIssueParamsTest.kt @@ -13,17 +13,17 @@ class InvoiceIssueParamsTest { } @Test - fun getBody() { + fun body() { val params = InvoiceIssueParams.builder().invoiceId("invoice_id").synchronous(true).build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.synchronous()).contains(true) } @Test - fun getBodyWithoutOptionalFields() { + fun bodyWithoutOptionalFields() { val params = InvoiceIssueParams.builder().invoiceId("invoice_id").build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull } diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/InvoiceLineItemCreateParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/InvoiceLineItemCreateParamsTest.kt index 5f98dcf7..541e4ead 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/InvoiceLineItemCreateParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/InvoiceLineItemCreateParamsTest.kt @@ -21,7 +21,7 @@ class InvoiceLineItemCreateParamsTest { } @Test - fun getBody() { + fun body() { val params = InvoiceLineItemCreateParams.builder() .amount("12.00") @@ -31,7 +31,7 @@ class InvoiceLineItemCreateParamsTest { .quantity(1.0) .startDate(LocalDate.parse("2023-09-22")) .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.amount()).isEqualTo("12.00") assertThat(body.endDate()).isEqualTo(LocalDate.parse("2023-09-22")) @@ -42,7 +42,7 @@ class InvoiceLineItemCreateParamsTest { } @Test - fun getBodyWithoutOptionalFields() { + fun bodyWithoutOptionalFields() { val params = InvoiceLineItemCreateParams.builder() .amount("12.00") @@ -52,7 +52,7 @@ class InvoiceLineItemCreateParamsTest { .quantity(1.0) .startDate(LocalDate.parse("2023-09-22")) .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.amount()).isEqualTo("12.00") assertThat(body.endDate()).isEqualTo(LocalDate.parse("2023-09-22")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/InvoiceLineItemCreateResponseTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/InvoiceLineItemCreateResponseTest.kt index 5ae2bccc..cbc9aad9 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/InvoiceLineItemCreateResponseTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/InvoiceLineItemCreateResponseTest.kt @@ -14,7 +14,24 @@ class InvoiceLineItemCreateResponseTest { val invoiceLineItemCreateResponse = InvoiceLineItemCreateResponse.builder() .id("id") + .adjustedSubtotal("5.00") + .addAdjustment( + InvoiceLineItemCreateResponse.Adjustment.AmountDiscountAdjustment.builder() + .id("id") + .adjustmentType( + InvoiceLineItemCreateResponse.Adjustment.AmountDiscountAdjustment + .AdjustmentType + .AMOUNT_DISCOUNT + ) + .amountDiscount("amount_discount") + .addAppliesToPriceId("string") + .isInvoiceLevel(true) + .planPhaseOrder(0L) + .reason("reason") + .build() + ) .amount("7.00") + .creditsApplied("6.00") .discount( PercentageDiscount.builder() .addAppliesToPriceId("h74gfhdjvn7ujokd") @@ -41,6 +58,7 @@ class InvoiceLineItemCreateResponseTest { ) .minimumAmount("minimum_amount") .name("Fixed Fee") + .partiallyInvoicedAmount("4.00") .price( Price.UnitPrice.builder() .id("id") @@ -109,6 +127,12 @@ class InvoiceLineItemCreateResponseTest { .unitConfig( Price.UnitPrice.UnitConfig.builder().unitAmount("unit_amount").build() ) + .dimensionalPriceConfiguration( + Price.UnitPrice.DimensionalPriceConfiguration.builder() + .addDimensionValue("string") + .dimensionalPriceGroupId("dimensional_price_group_id") + .build() + ) .build() ) .quantity(1.0) @@ -147,7 +171,27 @@ class InvoiceLineItemCreateResponseTest { .build() assertThat(invoiceLineItemCreateResponse).isNotNull assertThat(invoiceLineItemCreateResponse.id()).isEqualTo("id") + assertThat(invoiceLineItemCreateResponse.adjustedSubtotal()).isEqualTo("5.00") + assertThat(invoiceLineItemCreateResponse.adjustments()) + .containsExactly( + InvoiceLineItemCreateResponse.Adjustment.ofAmountDiscount( + InvoiceLineItemCreateResponse.Adjustment.AmountDiscountAdjustment.builder() + .id("id") + .adjustmentType( + InvoiceLineItemCreateResponse.Adjustment.AmountDiscountAdjustment + .AdjustmentType + .AMOUNT_DISCOUNT + ) + .amountDiscount("amount_discount") + .addAppliesToPriceId("string") + .isInvoiceLevel(true) + .planPhaseOrder(0L) + .reason("reason") + .build() + ) + ) assertThat(invoiceLineItemCreateResponse.amount()).isEqualTo("7.00") + assertThat(invoiceLineItemCreateResponse.creditsApplied()).isEqualTo("6.00") assertThat(invoiceLineItemCreateResponse.discount()) .contains( Discount.ofPercentage( @@ -180,6 +224,7 @@ class InvoiceLineItemCreateResponseTest { ) assertThat(invoiceLineItemCreateResponse.minimumAmount()).contains("minimum_amount") assertThat(invoiceLineItemCreateResponse.name()).isEqualTo("Fixed Fee") + assertThat(invoiceLineItemCreateResponse.partiallyInvoicedAmount()).isEqualTo("4.00") assertThat(invoiceLineItemCreateResponse.price()) .contains( Price.ofUnit( @@ -250,6 +295,12 @@ class InvoiceLineItemCreateResponseTest { .unitConfig( Price.UnitPrice.UnitConfig.builder().unitAmount("unit_amount").build() ) + .dimensionalPriceConfiguration( + Price.UnitPrice.DimensionalPriceConfiguration.builder() + .addDimensionValue("string") + .dimensionalPriceGroupId("dimensional_price_group_id") + .build() + ) .build() ) ) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/InvoiceListParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/InvoiceListParamsTest.kt index e6591571..d4e5b566 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/InvoiceListParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/InvoiceListParamsTest.kt @@ -36,7 +36,7 @@ class InvoiceListParamsTest { } @Test - fun getQueryParams() { + fun queryParams() { val params = InvoiceListParams.builder() .amount("amount") @@ -79,13 +79,13 @@ class InvoiceListParamsTest { expected.put("limit", "1") expected.put("status[]", InvoiceListParams.Status.DRAFT.toString()) expected.put("subscription_id", "subscription_id") - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } @Test - fun getQueryParamsWithoutOptionalFields() { + fun queryParamsWithoutOptionalFields() { val params = InvoiceListParams.builder().build() val expected = QueryParams.builder() - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } } diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/InvoiceMarkPaidParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/InvoiceMarkPaidParamsTest.kt index a03a2585..011c81c5 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/InvoiceMarkPaidParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/InvoiceMarkPaidParamsTest.kt @@ -19,7 +19,7 @@ class InvoiceMarkPaidParamsTest { } @Test - fun getBody() { + fun body() { val params = InvoiceMarkPaidParams.builder() .invoiceId("invoice_id") @@ -27,7 +27,7 @@ class InvoiceMarkPaidParamsTest { .externalId("external_payment_id_123") .notes("notes") .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.paymentReceivedDate()).isEqualTo(LocalDate.parse("2023-09-22")) assertThat(body.externalId()).contains("external_payment_id_123") @@ -35,13 +35,13 @@ class InvoiceMarkPaidParamsTest { } @Test - fun getBodyWithoutOptionalFields() { + fun bodyWithoutOptionalFields() { val params = InvoiceMarkPaidParams.builder() .invoiceId("invoice_id") .paymentReceivedDate(LocalDate.parse("2023-09-22")) .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.paymentReceivedDate()).isEqualTo(LocalDate.parse("2023-09-22")) } diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/InvoiceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/InvoiceTest.kt index 4819c450..e2795dd6 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/InvoiceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/InvoiceTest.kt @@ -101,7 +101,24 @@ class InvoiceTest { .addLineItem( Invoice.LineItem.builder() .id("id") + .adjustedSubtotal("5.00") + .addAdjustment( + Invoice.LineItem.Adjustment.AmountDiscountAdjustment.builder() + .id("id") + .adjustmentType( + Invoice.LineItem.Adjustment.AmountDiscountAdjustment + .AdjustmentType + .AMOUNT_DISCOUNT + ) + .amountDiscount("amount_discount") + .addAppliesToPriceId("string") + .isInvoiceLevel(true) + .planPhaseOrder(0L) + .reason("reason") + .build() + ) .amount("7.00") + .creditsApplied("6.00") .discount( PercentageDiscount.builder() .addAppliesToPriceId("h74gfhdjvn7ujokd") @@ -128,6 +145,7 @@ class InvoiceTest { ) .minimumAmount("minimum_amount") .name("Fixed Fee") + .partiallyInvoicedAmount("4.00") .price( Price.UnitPrice.builder() .id("id") @@ -202,6 +220,12 @@ class InvoiceTest { .unitAmount("unit_amount") .build() ) + .dimensionalPriceConfiguration( + Price.UnitPrice.DimensionalPriceConfiguration.builder() + .addDimensionValue("string") + .dimensionalPriceGroupId("dimensional_price_group_id") + .build() + ) .build() ) .quantity(1.0) @@ -392,7 +416,23 @@ class InvoiceTest { .containsExactly( Invoice.LineItem.builder() .id("id") + .adjustedSubtotal("5.00") + .addAdjustment( + Invoice.LineItem.Adjustment.AmountDiscountAdjustment.builder() + .id("id") + .adjustmentType( + Invoice.LineItem.Adjustment.AmountDiscountAdjustment.AdjustmentType + .AMOUNT_DISCOUNT + ) + .amountDiscount("amount_discount") + .addAppliesToPriceId("string") + .isInvoiceLevel(true) + .planPhaseOrder(0L) + .reason("reason") + .build() + ) .amount("7.00") + .creditsApplied("6.00") .discount( PercentageDiscount.builder() .addAppliesToPriceId("h74gfhdjvn7ujokd") @@ -419,6 +459,7 @@ class InvoiceTest { ) .minimumAmount("minimum_amount") .name("Fixed Fee") + .partiallyInvoicedAmount("4.00") .price( Price.UnitPrice.builder() .id("id") @@ -491,6 +532,12 @@ class InvoiceTest { .unitAmount("unit_amount") .build() ) + .dimensionalPriceConfiguration( + Price.UnitPrice.DimensionalPriceConfiguration.builder() + .addDimensionValue("string") + .dimensionalPriceGroupId("dimensional_price_group_id") + .build() + ) .build() ) .quantity(1.0) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/InvoiceUpdateParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/InvoiceUpdateParamsTest.kt index 184138e3..11b185bb 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/InvoiceUpdateParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/InvoiceUpdateParamsTest.kt @@ -21,7 +21,7 @@ class InvoiceUpdateParamsTest { } @Test - fun getBody() { + fun body() { val params = InvoiceUpdateParams.builder() .invoiceId("invoice_id") @@ -31,7 +31,7 @@ class InvoiceUpdateParamsTest { .build() ) .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.metadata()) .contains( @@ -42,9 +42,9 @@ class InvoiceUpdateParamsTest { } @Test - fun getBodyWithoutOptionalFields() { + fun bodyWithoutOptionalFields() { val params = InvoiceUpdateParams.builder().invoiceId("invoice_id").build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull } diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/ItemCreateParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/ItemCreateParamsTest.kt index fcee9610..b93d0607 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/ItemCreateParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/ItemCreateParamsTest.kt @@ -13,17 +13,17 @@ class ItemCreateParamsTest { } @Test - fun getBody() { + fun body() { val params = ItemCreateParams.builder().name("API requests").build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.name()).isEqualTo("API requests") } @Test - fun getBodyWithoutOptionalFields() { + fun bodyWithoutOptionalFields() { val params = ItemCreateParams.builder().name("API requests").build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.name()).isEqualTo("API requests") } diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/ItemListParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/ItemListParamsTest.kt index 57834202..ebfb9491 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/ItemListParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/ItemListParamsTest.kt @@ -14,18 +14,18 @@ class ItemListParamsTest { } @Test - fun getQueryParams() { + fun queryParams() { val params = ItemListParams.builder().cursor("cursor").limit(1L).build() val expected = QueryParams.builder() expected.put("cursor", "cursor") expected.put("limit", "1") - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } @Test - fun getQueryParamsWithoutOptionalFields() { + fun queryParamsWithoutOptionalFields() { val params = ItemListParams.builder().build() val expected = QueryParams.builder() - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } } diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/ItemUpdateParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/ItemUpdateParamsTest.kt index 20657384..7d60ec13 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/ItemUpdateParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/ItemUpdateParamsTest.kt @@ -24,7 +24,7 @@ class ItemUpdateParamsTest { } @Test - fun getBody() { + fun body() { val params = ItemUpdateParams.builder() .itemId("item_id") @@ -38,7 +38,7 @@ class ItemUpdateParamsTest { ) .name("name") .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.externalConnections()) .contains( @@ -55,9 +55,9 @@ class ItemUpdateParamsTest { } @Test - fun getBodyWithoutOptionalFields() { + fun bodyWithoutOptionalFields() { val params = ItemUpdateParams.builder().itemId("item_id").build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull } diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/MetricCreateParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/MetricCreateParamsTest.kt index 92fe23db..5a2746a4 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/MetricCreateParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/MetricCreateParamsTest.kt @@ -24,7 +24,7 @@ class MetricCreateParamsTest { } @Test - fun getBody() { + fun body() { val params = MetricCreateParams.builder() .description("Sum of bytes downloaded in fast mode") @@ -37,7 +37,7 @@ class MetricCreateParamsTest { .build() ) .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.description()).contains("Sum of bytes downloaded in fast mode") assertThat(body.itemId()).isEqualTo("item_id") @@ -53,7 +53,7 @@ class MetricCreateParamsTest { } @Test - fun getBodyWithoutOptionalFields() { + fun bodyWithoutOptionalFields() { val params = MetricCreateParams.builder() .description("Sum of bytes downloaded in fast mode") @@ -61,7 +61,7 @@ class MetricCreateParamsTest { .name("Bytes downloaded") .sql("SELECT sum(bytes_downloaded) FROM events WHERE download_speed = 'fast'") .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.description()).contains("Sum of bytes downloaded in fast mode") assertThat(body.itemId()).isEqualTo("item_id") diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/MetricListParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/MetricListParamsTest.kt index 8e1564e2..025707e4 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/MetricListParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/MetricListParamsTest.kt @@ -22,7 +22,7 @@ class MetricListParamsTest { } @Test - fun getQueryParams() { + fun queryParams() { val params = MetricListParams.builder() .createdAtGt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) @@ -39,13 +39,13 @@ class MetricListParamsTest { expected.put("created_at[lte]", "2019-12-27T18:11:19.117Z") expected.put("cursor", "cursor") expected.put("limit", "1") - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } @Test - fun getQueryParamsWithoutOptionalFields() { + fun queryParamsWithoutOptionalFields() { val params = MetricListParams.builder().build() val expected = QueryParams.builder() - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } } diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/MetricUpdateParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/MetricUpdateParamsTest.kt index 8e8fb984..43ef1e4b 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/MetricUpdateParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/MetricUpdateParamsTest.kt @@ -21,7 +21,7 @@ class MetricUpdateParamsTest { } @Test - fun getBody() { + fun body() { val params = MetricUpdateParams.builder() .metricId("metric_id") @@ -31,7 +31,7 @@ class MetricUpdateParamsTest { .build() ) .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.metadata()) .contains( @@ -42,9 +42,9 @@ class MetricUpdateParamsTest { } @Test - fun getBodyWithoutOptionalFields() { + fun bodyWithoutOptionalFields() { val params = MetricUpdateParams.builder().metricId("metric_id").build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull } diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/PlanCreateParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/PlanCreateParamsTest.kt index 828216fb..6d855c11 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/PlanCreateParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/PlanCreateParamsTest.kt @@ -72,7 +72,7 @@ class PlanCreateParamsTest { } @Test - fun getBody() { + fun body() { val params = PlanCreateParams.builder() .currency("currency") @@ -136,7 +136,7 @@ class PlanCreateParamsTest { .netTerms(0L) .status(PlanCreateParams.Status.ACTIVE) .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.currency()).isEqualTo("currency") assertThat(body.name()).isEqualTo("name") @@ -207,7 +207,7 @@ class PlanCreateParamsTest { } @Test - fun getBodyWithoutOptionalFields() { + fun bodyWithoutOptionalFields() { val params = PlanCreateParams.builder() .currency("currency") @@ -226,7 +226,7 @@ class PlanCreateParamsTest { .build() ) .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.currency()).isEqualTo("currency") assertThat(body.name()).isEqualTo("name") diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/PlanExternalPlanIdUpdateParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/PlanExternalPlanIdUpdateParamsTest.kt index 394ab6e7..37f206a4 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/PlanExternalPlanIdUpdateParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/PlanExternalPlanIdUpdateParamsTest.kt @@ -22,7 +22,7 @@ class PlanExternalPlanIdUpdateParamsTest { } @Test - fun getBody() { + fun body() { val params = PlanExternalPlanIdUpdateParams.builder() .otherExternalPlanId("external_plan_id") @@ -33,7 +33,7 @@ class PlanExternalPlanIdUpdateParamsTest { .build() ) .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.externalPlanId()).contains("external_plan_id") assertThat(body.metadata()) @@ -45,10 +45,10 @@ class PlanExternalPlanIdUpdateParamsTest { } @Test - fun getBodyWithoutOptionalFields() { + fun bodyWithoutOptionalFields() { val params = PlanExternalPlanIdUpdateParams.builder().otherExternalPlanId("external_plan_id").build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull } diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/PlanListParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/PlanListParamsTest.kt index d0206787..9c9527a2 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/PlanListParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/PlanListParamsTest.kt @@ -23,7 +23,7 @@ class PlanListParamsTest { } @Test - fun getQueryParams() { + fun queryParams() { val params = PlanListParams.builder() .createdAtGt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) @@ -42,13 +42,13 @@ class PlanListParamsTest { expected.put("cursor", "cursor") expected.put("limit", "1") expected.put("status", PlanListParams.Status.ACTIVE.toString()) - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } @Test - fun getQueryParamsWithoutOptionalFields() { + fun queryParamsWithoutOptionalFields() { val params = PlanListParams.builder().build() val expected = QueryParams.builder() - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } } diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/PlanTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/PlanTest.kt index 088a971d..1a755faa 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/PlanTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/PlanTest.kt @@ -172,6 +172,12 @@ class PlanTest { .unitConfig( Price.UnitPrice.UnitConfig.builder().unitAmount("unit_amount").build() ) + .dimensionalPriceConfiguration( + Price.UnitPrice.DimensionalPriceConfiguration.builder() + .addDimensionValue("string") + .dimensionalPriceGroupId("dimensional_price_group_id") + .build() + ) .build() ) .product( @@ -363,6 +369,12 @@ class PlanTest { .unitConfig( Price.UnitPrice.UnitConfig.builder().unitAmount("unit_amount").build() ) + .dimensionalPriceConfiguration( + Price.UnitPrice.DimensionalPriceConfiguration.builder() + .addDimensionValue("string") + .dimensionalPriceGroupId("dimensional_price_group_id") + .build() + ) .build() ) ) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/PlanUpdateParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/PlanUpdateParamsTest.kt index 969dd3f8..29c1d25c 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/PlanUpdateParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/PlanUpdateParamsTest.kt @@ -22,7 +22,7 @@ class PlanUpdateParamsTest { } @Test - fun getBody() { + fun body() { val params = PlanUpdateParams.builder() .planId("plan_id") @@ -33,7 +33,7 @@ class PlanUpdateParamsTest { .build() ) .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.externalPlanId()).contains("external_plan_id") assertThat(body.metadata()) @@ -45,9 +45,9 @@ class PlanUpdateParamsTest { } @Test - fun getBodyWithoutOptionalFields() { + fun bodyWithoutOptionalFields() { val params = PlanUpdateParams.builder().planId("plan_id").build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull } diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/PriceEvaluateParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/PriceEvaluateParamsTest.kt index eea1bcf4..f99743ed 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/PriceEvaluateParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/PriceEvaluateParamsTest.kt @@ -22,7 +22,7 @@ class PriceEvaluateParamsTest { } @Test - fun getBody() { + fun body() { val params = PriceEvaluateParams.builder() .priceId("price_id") @@ -33,7 +33,7 @@ class PriceEvaluateParamsTest { .filter("my_numeric_property > 100 AND my_other_property = 'bar'") .addGroupingKey("case when my_event_type = 'foo' then true else false end") .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.timeframeEnd()).isEqualTo(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) assertThat(body.timeframeStart()) @@ -47,14 +47,14 @@ class PriceEvaluateParamsTest { } @Test - fun getBodyWithoutOptionalFields() { + fun bodyWithoutOptionalFields() { val params = PriceEvaluateParams.builder() .priceId("price_id") .timeframeEnd(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .timeframeStart(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.timeframeEnd()).isEqualTo(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) assertThat(body.timeframeStart()) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/PriceExternalPriceIdUpdateParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/PriceExternalPriceIdUpdateParamsTest.kt index 615c3e95..9357e6a5 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/PriceExternalPriceIdUpdateParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/PriceExternalPriceIdUpdateParamsTest.kt @@ -21,7 +21,7 @@ class PriceExternalPriceIdUpdateParamsTest { } @Test - fun getBody() { + fun body() { val params = PriceExternalPriceIdUpdateParams.builder() .externalPriceId("external_price_id") @@ -31,7 +31,7 @@ class PriceExternalPriceIdUpdateParamsTest { .build() ) .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.metadata()) .contains( @@ -42,10 +42,10 @@ class PriceExternalPriceIdUpdateParamsTest { } @Test - fun getBodyWithoutOptionalFields() { + fun bodyWithoutOptionalFields() { val params = PriceExternalPriceIdUpdateParams.builder().externalPriceId("external_price_id").build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull } diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/PriceListParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/PriceListParamsTest.kt index 53f41a2f..6d9d6b06 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/PriceListParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/PriceListParamsTest.kt @@ -14,18 +14,18 @@ class PriceListParamsTest { } @Test - fun getQueryParams() { + fun queryParams() { val params = PriceListParams.builder().cursor("cursor").limit(1L).build() val expected = QueryParams.builder() expected.put("cursor", "cursor") expected.put("limit", "1") - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } @Test - fun getQueryParamsWithoutOptionalFields() { + fun queryParamsWithoutOptionalFields() { val params = PriceListParams.builder().build() val expected = QueryParams.builder() - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } } diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/PriceUpdateParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/PriceUpdateParamsTest.kt index 751fd643..b3d7d83c 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/PriceUpdateParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/PriceUpdateParamsTest.kt @@ -21,7 +21,7 @@ class PriceUpdateParamsTest { } @Test - fun getBody() { + fun body() { val params = PriceUpdateParams.builder() .priceId("price_id") @@ -31,7 +31,7 @@ class PriceUpdateParamsTest { .build() ) .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.metadata()) .contains( @@ -42,9 +42,9 @@ class PriceUpdateParamsTest { } @Test - fun getBodyWithoutOptionalFields() { + fun bodyWithoutOptionalFields() { val params = PriceUpdateParams.builder().priceId("price_id").build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull } diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionCancelParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionCancelParamsTest.kt index 2ecafcf5..beca43f1 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionCancelParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionCancelParamsTest.kt @@ -18,14 +18,14 @@ class SubscriptionCancelParamsTest { } @Test - fun getBody() { + fun body() { val params = SubscriptionCancelParams.builder() .subscriptionId("subscription_id") .cancelOption(SubscriptionCancelParams.CancelOption.END_OF_SUBSCRIPTION_TERM) .cancellationDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.cancelOption()) .isEqualTo(SubscriptionCancelParams.CancelOption.END_OF_SUBSCRIPTION_TERM) @@ -34,13 +34,13 @@ class SubscriptionCancelParamsTest { } @Test - fun getBodyWithoutOptionalFields() { + fun bodyWithoutOptionalFields() { val params = SubscriptionCancelParams.builder() .subscriptionId("subscription_id") .cancelOption(SubscriptionCancelParams.CancelOption.END_OF_SUBSCRIPTION_TERM) .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.cancelOption()) .isEqualTo(SubscriptionCancelParams.CancelOption.END_OF_SUBSCRIPTION_TERM) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionCancelResponseTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionCancelResponseTest.kt index 4e88c671..842e540b 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionCancelResponseTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionCancelResponseTest.kt @@ -340,6 +340,12 @@ class SubscriptionCancelResponseTest { .unitAmount("unit_amount") .build() ) + .dimensionalPriceConfiguration( + Price.UnitPrice.DimensionalPriceConfiguration.builder() + .addDimensionValue("string") + .dimensionalPriceGroupId("dimensional_price_group_id") + .build() + ) .build() ) .product( @@ -452,6 +458,12 @@ class SubscriptionCancelResponseTest { .unitAmount("unit_amount") .build() ) + .dimensionalPriceConfiguration( + Price.UnitPrice.DimensionalPriceConfiguration.builder() + .addDimensionValue("string") + .dimensionalPriceGroupId("dimensional_price_group_id") + .build() + ) .build() ) .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) @@ -812,6 +824,12 @@ class SubscriptionCancelResponseTest { .unitAmount("unit_amount") .build() ) + .dimensionalPriceConfiguration( + Price.UnitPrice.DimensionalPriceConfiguration.builder() + .addDimensionValue("string") + .dimensionalPriceGroupId("dimensional_price_group_id") + .build() + ) .build() ) .product( @@ -919,6 +937,12 @@ class SubscriptionCancelResponseTest { .unitAmount("unit_amount") .build() ) + .dimensionalPriceConfiguration( + Price.UnitPrice.DimensionalPriceConfiguration.builder() + .addDimensionValue("string") + .dimensionalPriceGroupId("dimensional_price_group_id") + .build() + ) .build() ) .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionCreateParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionCreateParamsTest.kt index 7105707c..183f56df 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionCreateParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionCreateParamsTest.kt @@ -273,12 +273,12 @@ class SubscriptionCreateParamsTest { .build() ) .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .trialDurationDays(0L) + .trialDurationDays(999999L) .build() } @Test - fun getBody() { + fun body() { val params = SubscriptionCreateParams.builder() .addAddAdjustment( @@ -551,9 +551,9 @@ class SubscriptionCreateParamsTest { .build() ) .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .trialDurationDays(0L) + .trialDurationDays(999999L) .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.addAdjustments()) .contains( @@ -847,13 +847,13 @@ class SubscriptionCreateParamsTest { ) ) assertThat(body.startDate()).contains(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - assertThat(body.trialDurationDays()).contains(0L) + assertThat(body.trialDurationDays()).contains(999999L) } @Test - fun getBodyWithoutOptionalFields() { + fun bodyWithoutOptionalFields() { val params = SubscriptionCreateParams.builder().build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull } } diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionCreateResponseTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionCreateResponseTest.kt index a190b163..890f2d39 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionCreateResponseTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionCreateResponseTest.kt @@ -340,6 +340,12 @@ class SubscriptionCreateResponseTest { .unitAmount("unit_amount") .build() ) + .dimensionalPriceConfiguration( + Price.UnitPrice.DimensionalPriceConfiguration.builder() + .addDimensionValue("string") + .dimensionalPriceGroupId("dimensional_price_group_id") + .build() + ) .build() ) .product( @@ -452,6 +458,12 @@ class SubscriptionCreateResponseTest { .unitAmount("unit_amount") .build() ) + .dimensionalPriceConfiguration( + Price.UnitPrice.DimensionalPriceConfiguration.builder() + .addDimensionValue("string") + .dimensionalPriceGroupId("dimensional_price_group_id") + .build() + ) .build() ) .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) @@ -812,6 +824,12 @@ class SubscriptionCreateResponseTest { .unitAmount("unit_amount") .build() ) + .dimensionalPriceConfiguration( + Price.UnitPrice.DimensionalPriceConfiguration.builder() + .addDimensionValue("string") + .dimensionalPriceGroupId("dimensional_price_group_id") + .build() + ) .build() ) .product( @@ -919,6 +937,12 @@ class SubscriptionCreateResponseTest { .unitAmount("unit_amount") .build() ) + .dimensionalPriceConfiguration( + Price.UnitPrice.DimensionalPriceConfiguration.builder() + .addDimensionValue("string") + .dimensionalPriceGroupId("dimensional_price_group_id") + .build() + ) .build() ) .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionFetchCostsParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionFetchCostsParamsTest.kt index d4838182..d8244900 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionFetchCostsParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionFetchCostsParamsTest.kt @@ -21,7 +21,7 @@ class SubscriptionFetchCostsParamsTest { } @Test - fun getQueryParams() { + fun queryParams() { val params = SubscriptionFetchCostsParams.builder() .subscriptionId("subscription_id") @@ -35,15 +35,15 @@ class SubscriptionFetchCostsParamsTest { expected.put("timeframe_end", "2022-03-01T05:00:00Z") expected.put("timeframe_start", "2022-02-01T05:00:00Z") expected.put("view_mode", SubscriptionFetchCostsParams.ViewMode.PERIODIC.toString()) - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } @Test - fun getQueryParamsWithoutOptionalFields() { + fun queryParamsWithoutOptionalFields() { val params = SubscriptionFetchCostsParams.builder().subscriptionId("subscription_id").build() val expected = QueryParams.builder() - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } @Test diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionFetchCostsResponseTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionFetchCostsResponseTest.kt index ae3beb81..6e263af5 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionFetchCostsResponseTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionFetchCostsResponseTest.kt @@ -105,6 +105,14 @@ class SubscriptionFetchCostsResponseTest { .unitAmount("unit_amount") .build() ) + .dimensionalPriceConfiguration( + Price.UnitPrice.DimensionalPriceConfiguration.builder() + .addDimensionValue("string") + .dimensionalPriceGroupId( + "dimensional_price_group_id" + ) + .build() + ) .build() ) .subtotal("subtotal") @@ -205,6 +213,12 @@ class SubscriptionFetchCostsResponseTest { .unitAmount("unit_amount") .build() ) + .dimensionalPriceConfiguration( + Price.UnitPrice.DimensionalPriceConfiguration.builder() + .addDimensionValue("string") + .dimensionalPriceGroupId("dimensional_price_group_id") + .build() + ) .build() ) .subtotal("subtotal") diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionFetchScheduleParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionFetchScheduleParamsTest.kt index 3e51f96c..a9d105c6 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionFetchScheduleParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionFetchScheduleParamsTest.kt @@ -23,7 +23,7 @@ class SubscriptionFetchScheduleParamsTest { } @Test - fun getQueryParams() { + fun queryParams() { val params = SubscriptionFetchScheduleParams.builder() .subscriptionId("subscription_id") @@ -41,15 +41,15 @@ class SubscriptionFetchScheduleParamsTest { expected.put("start_date[gte]", "2019-12-27T18:11:19.117Z") expected.put("start_date[lt]", "2019-12-27T18:11:19.117Z") expected.put("start_date[lte]", "2019-12-27T18:11:19.117Z") - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } @Test - fun getQueryParamsWithoutOptionalFields() { + fun queryParamsWithoutOptionalFields() { val params = SubscriptionFetchScheduleParams.builder().subscriptionId("subscription_id").build() val expected = QueryParams.builder() - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } @Test diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionFetchUsageParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionFetchUsageParamsTest.kt index 44fbeaee..affa3373 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionFetchUsageParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionFetchUsageParamsTest.kt @@ -27,7 +27,7 @@ class SubscriptionFetchUsageParamsTest { } @Test - fun getQueryParams() { + fun queryParams() { val params = SubscriptionFetchUsageParams.builder() .subscriptionId("subscription_id") @@ -53,15 +53,15 @@ class SubscriptionFetchUsageParamsTest { expected.put("timeframe_end", "2022-03-01T05:00:00Z") expected.put("timeframe_start", "2022-02-01T05:00:00Z") expected.put("view_mode", SubscriptionFetchUsageParams.ViewMode.PERIODIC.toString()) - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } @Test - fun getQueryParamsWithoutOptionalFields() { + fun queryParamsWithoutOptionalFields() { val params = SubscriptionFetchUsageParams.builder().subscriptionId("subscription_id").build() val expected = QueryParams.builder() - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } @Test diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionListParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionListParamsTest.kt index 8b30b282..28d76e77 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionListParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionListParamsTest.kt @@ -25,7 +25,7 @@ class SubscriptionListParamsTest { } @Test - fun getQueryParams() { + fun queryParams() { val params = SubscriptionListParams.builder() .createdAtGt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) @@ -48,13 +48,13 @@ class SubscriptionListParamsTest { expected.put("external_customer_id", "external_customer_id") expected.put("limit", "1") expected.put("status", SubscriptionListParams.Status.ACTIVE.toString()) - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } @Test - fun getQueryParamsWithoutOptionalFields() { + fun queryParamsWithoutOptionalFields() { val params = SubscriptionListParams.builder().build() val expected = QueryParams.builder() - assertThat(params.getQueryParams()).isEqualTo(expected.build()) + assertThat(params._queryParams()).isEqualTo(expected.build()) } } diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionPriceIntervalsParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionPriceIntervalsParamsTest.kt index ff211a4e..e94c1495 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionPriceIntervalsParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionPriceIntervalsParamsTest.kt @@ -27,18 +27,7 @@ class SubscriptionPriceIntervalsParamsTest { .expiresAtEndOfCadence(true) .build() ) - .addDiscount( - SubscriptionPriceIntervalsParams.Add.Discount.AmountDiscountCreationParams - .builder() - .amountDiscount(0.0) - .discountType( - SubscriptionPriceIntervalsParams.Add.Discount - .AmountDiscountCreationParams - .DiscountType - .AMOUNT - ) - .build() - ) + .addAmountDiscountCreationParamsDiscount(0.0) .endDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .externalPriceId("external_price_id") .addFixedFeeQuantityTransition( @@ -164,7 +153,7 @@ class SubscriptionPriceIntervalsParamsTest { } @Test - fun getBody() { + fun body() { val params = SubscriptionPriceIntervalsParams.builder() .subscriptionId("subscription_id") @@ -182,19 +171,7 @@ class SubscriptionPriceIntervalsParamsTest { .expiresAtEndOfCadence(true) .build() ) - .addDiscount( - SubscriptionPriceIntervalsParams.Add.Discount - .AmountDiscountCreationParams - .builder() - .amountDiscount(0.0) - .discountType( - SubscriptionPriceIntervalsParams.Add.Discount - .AmountDiscountCreationParams - .DiscountType - .AMOUNT - ) - .build() - ) + .addAmountDiscountCreationParamsDiscount(0.0) .endDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .externalPriceId("external_price_id") .addFixedFeeQuantityTransition( @@ -320,7 +297,7 @@ class SubscriptionPriceIntervalsParamsTest { .build() ) .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.add()) .contains( @@ -338,19 +315,7 @@ class SubscriptionPriceIntervalsParamsTest { .expiresAtEndOfCadence(true) .build() ) - .addDiscount( - SubscriptionPriceIntervalsParams.Add.Discount - .AmountDiscountCreationParams - .builder() - .amountDiscount(0.0) - .discountType( - SubscriptionPriceIntervalsParams.Add.Discount - .AmountDiscountCreationParams - .DiscountType - .AMOUNT - ) - .build() - ) + .addAmountDiscountCreationParamsDiscount(0.0) .endDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .externalPriceId("external_price_id") .addFixedFeeQuantityTransition( @@ -488,10 +453,10 @@ class SubscriptionPriceIntervalsParamsTest { } @Test - fun getBodyWithoutOptionalFields() { + fun bodyWithoutOptionalFields() { val params = SubscriptionPriceIntervalsParams.builder().subscriptionId("subscription_id").build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull } diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionPriceIntervalsResponseTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionPriceIntervalsResponseTest.kt index f8294462..dbe4cfd8 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionPriceIntervalsResponseTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionPriceIntervalsResponseTest.kt @@ -342,6 +342,12 @@ class SubscriptionPriceIntervalsResponseTest { .unitAmount("unit_amount") .build() ) + .dimensionalPriceConfiguration( + Price.UnitPrice.DimensionalPriceConfiguration.builder() + .addDimensionValue("string") + .dimensionalPriceGroupId("dimensional_price_group_id") + .build() + ) .build() ) .product( @@ -455,6 +461,12 @@ class SubscriptionPriceIntervalsResponseTest { .unitAmount("unit_amount") .build() ) + .dimensionalPriceConfiguration( + Price.UnitPrice.DimensionalPriceConfiguration.builder() + .addDimensionValue("string") + .dimensionalPriceGroupId("dimensional_price_group_id") + .build() + ) .build() ) .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) @@ -819,6 +831,12 @@ class SubscriptionPriceIntervalsResponseTest { .unitAmount("unit_amount") .build() ) + .dimensionalPriceConfiguration( + Price.UnitPrice.DimensionalPriceConfiguration.builder() + .addDimensionValue("string") + .dimensionalPriceGroupId("dimensional_price_group_id") + .build() + ) .build() ) .product( @@ -926,6 +944,12 @@ class SubscriptionPriceIntervalsResponseTest { .unitAmount("unit_amount") .build() ) + .dimensionalPriceConfiguration( + Price.UnitPrice.DimensionalPriceConfiguration.builder() + .addDimensionValue("string") + .dimensionalPriceGroupId("dimensional_price_group_id") + .build() + ) .build() ) .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionSchedulePlanChangeParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionSchedulePlanChangeParamsTest.kt index 69e89d9a..3273cc77 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionSchedulePlanChangeParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionSchedulePlanChangeParamsTest.kt @@ -285,12 +285,12 @@ class SubscriptionSchedulePlanChangeParamsTest { .priceId("h74gfhdjvn7ujokd") .build() ) - .trialDurationDays(0L) + .trialDurationDays(999999L) .build() } @Test - fun getBody() { + fun body() { val params = SubscriptionSchedulePlanChangeParams.builder() .subscriptionId("subscription_id") @@ -569,9 +569,9 @@ class SubscriptionSchedulePlanChangeParamsTest { .priceId("h74gfhdjvn7ujokd") .build() ) - .trialDurationDays(0L) + .trialDurationDays(999999L) .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.changeOption()) .isEqualTo(SubscriptionSchedulePlanChangeParams.ChangeOption.REQUESTED_DATE) @@ -867,17 +867,17 @@ class SubscriptionSchedulePlanChangeParamsTest { .build() ) ) - assertThat(body.trialDurationDays()).contains(0L) + assertThat(body.trialDurationDays()).contains(999999L) } @Test - fun getBodyWithoutOptionalFields() { + fun bodyWithoutOptionalFields() { val params = SubscriptionSchedulePlanChangeParams.builder() .subscriptionId("subscription_id") .changeOption(SubscriptionSchedulePlanChangeParams.ChangeOption.REQUESTED_DATE) .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.changeOption()) .isEqualTo(SubscriptionSchedulePlanChangeParams.ChangeOption.REQUESTED_DATE) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionSchedulePlanChangeResponseTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionSchedulePlanChangeResponseTest.kt index b90ea49a..11292f78 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionSchedulePlanChangeResponseTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionSchedulePlanChangeResponseTest.kt @@ -343,6 +343,12 @@ class SubscriptionSchedulePlanChangeResponseTest { .unitAmount("unit_amount") .build() ) + .dimensionalPriceConfiguration( + Price.UnitPrice.DimensionalPriceConfiguration.builder() + .addDimensionValue("string") + .dimensionalPriceGroupId("dimensional_price_group_id") + .build() + ) .build() ) .product( @@ -456,6 +462,12 @@ class SubscriptionSchedulePlanChangeResponseTest { .unitAmount("unit_amount") .build() ) + .dimensionalPriceConfiguration( + Price.UnitPrice.DimensionalPriceConfiguration.builder() + .addDimensionValue("string") + .dimensionalPriceGroupId("dimensional_price_group_id") + .build() + ) .build() ) .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) @@ -820,6 +832,12 @@ class SubscriptionSchedulePlanChangeResponseTest { .unitAmount("unit_amount") .build() ) + .dimensionalPriceConfiguration( + Price.UnitPrice.DimensionalPriceConfiguration.builder() + .addDimensionValue("string") + .dimensionalPriceGroupId("dimensional_price_group_id") + .build() + ) .build() ) .product( @@ -928,6 +946,12 @@ class SubscriptionSchedulePlanChangeResponseTest { .unitAmount("unit_amount") .build() ) + .dimensionalPriceConfiguration( + Price.UnitPrice.DimensionalPriceConfiguration.builder() + .addDimensionValue("string") + .dimensionalPriceGroupId("dimensional_price_group_id") + .build() + ) .build() ) .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionTest.kt index 16ef7d4e..e931a040 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionTest.kt @@ -337,6 +337,12 @@ class SubscriptionTest { .unitAmount("unit_amount") .build() ) + .dimensionalPriceConfiguration( + Price.UnitPrice.DimensionalPriceConfiguration.builder() + .addDimensionValue("string") + .dimensionalPriceGroupId("dimensional_price_group_id") + .build() + ) .build() ) .product( @@ -448,6 +454,12 @@ class SubscriptionTest { .unitAmount("unit_amount") .build() ) + .dimensionalPriceConfiguration( + Price.UnitPrice.DimensionalPriceConfiguration.builder() + .addDimensionValue("string") + .dimensionalPriceGroupId("dimensional_price_group_id") + .build() + ) .build() ) .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) @@ -804,6 +816,12 @@ class SubscriptionTest { .unitAmount("unit_amount") .build() ) + .dimensionalPriceConfiguration( + Price.UnitPrice.DimensionalPriceConfiguration.builder() + .addDimensionValue("string") + .dimensionalPriceGroupId("dimensional_price_group_id") + .build() + ) .build() ) .product( @@ -910,6 +928,12 @@ class SubscriptionTest { .unitAmount("unit_amount") .build() ) + .dimensionalPriceConfiguration( + Price.UnitPrice.DimensionalPriceConfiguration.builder() + .addDimensionValue("string") + .dimensionalPriceGroupId("dimensional_price_group_id") + .build() + ) .build() ) .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionTriggerPhaseParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionTriggerPhaseParamsTest.kt index e2790edc..36506209 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionTriggerPhaseParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionTriggerPhaseParamsTest.kt @@ -17,22 +17,22 @@ class SubscriptionTriggerPhaseParamsTest { } @Test - fun getBody() { + fun body() { val params = SubscriptionTriggerPhaseParams.builder() .subscriptionId("subscription_id") .effectiveDate(LocalDate.parse("2019-12-27")) .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.effectiveDate()).contains(LocalDate.parse("2019-12-27")) } @Test - fun getBodyWithoutOptionalFields() { + fun bodyWithoutOptionalFields() { val params = SubscriptionTriggerPhaseParams.builder().subscriptionId("subscription_id").build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull } diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionTriggerPhaseResponseTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionTriggerPhaseResponseTest.kt index 0b2570c6..598af83d 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionTriggerPhaseResponseTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionTriggerPhaseResponseTest.kt @@ -341,6 +341,12 @@ class SubscriptionTriggerPhaseResponseTest { .unitAmount("unit_amount") .build() ) + .dimensionalPriceConfiguration( + Price.UnitPrice.DimensionalPriceConfiguration.builder() + .addDimensionValue("string") + .dimensionalPriceGroupId("dimensional_price_group_id") + .build() + ) .build() ) .product( @@ -454,6 +460,12 @@ class SubscriptionTriggerPhaseResponseTest { .unitAmount("unit_amount") .build() ) + .dimensionalPriceConfiguration( + Price.UnitPrice.DimensionalPriceConfiguration.builder() + .addDimensionValue("string") + .dimensionalPriceGroupId("dimensional_price_group_id") + .build() + ) .build() ) .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) @@ -817,6 +829,12 @@ class SubscriptionTriggerPhaseResponseTest { .unitAmount("unit_amount") .build() ) + .dimensionalPriceConfiguration( + Price.UnitPrice.DimensionalPriceConfiguration.builder() + .addDimensionValue("string") + .dimensionalPriceGroupId("dimensional_price_group_id") + .build() + ) .build() ) .product( @@ -924,6 +942,12 @@ class SubscriptionTriggerPhaseResponseTest { .unitAmount("unit_amount") .build() ) + .dimensionalPriceConfiguration( + Price.UnitPrice.DimensionalPriceConfiguration.builder() + .addDimensionValue("string") + .dimensionalPriceGroupId("dimensional_price_group_id") + .build() + ) .build() ) .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionUnscheduleCancellationResponseTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionUnscheduleCancellationResponseTest.kt index 9bf1dfad..0b2dc1e2 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionUnscheduleCancellationResponseTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionUnscheduleCancellationResponseTest.kt @@ -345,6 +345,12 @@ class SubscriptionUnscheduleCancellationResponseTest { .unitAmount("unit_amount") .build() ) + .dimensionalPriceConfiguration( + Price.UnitPrice.DimensionalPriceConfiguration.builder() + .addDimensionValue("string") + .dimensionalPriceGroupId("dimensional_price_group_id") + .build() + ) .build() ) .product( @@ -458,6 +464,12 @@ class SubscriptionUnscheduleCancellationResponseTest { .unitAmount("unit_amount") .build() ) + .dimensionalPriceConfiguration( + Price.UnitPrice.DimensionalPriceConfiguration.builder() + .addDimensionValue("string") + .dimensionalPriceGroupId("dimensional_price_group_id") + .build() + ) .build() ) .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) @@ -824,6 +836,12 @@ class SubscriptionUnscheduleCancellationResponseTest { .unitAmount("unit_amount") .build() ) + .dimensionalPriceConfiguration( + Price.UnitPrice.DimensionalPriceConfiguration.builder() + .addDimensionValue("string") + .dimensionalPriceGroupId("dimensional_price_group_id") + .build() + ) .build() ) .product( @@ -932,6 +950,12 @@ class SubscriptionUnscheduleCancellationResponseTest { .unitAmount("unit_amount") .build() ) + .dimensionalPriceConfiguration( + Price.UnitPrice.DimensionalPriceConfiguration.builder() + .addDimensionValue("string") + .dimensionalPriceGroupId("dimensional_price_group_id") + .build() + ) .build() ) .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionUnscheduleFixedFeeQuantityUpdatesParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionUnscheduleFixedFeeQuantityUpdatesParamsTest.kt index c0d1349d..d04d5543 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionUnscheduleFixedFeeQuantityUpdatesParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionUnscheduleFixedFeeQuantityUpdatesParamsTest.kt @@ -16,25 +16,25 @@ class SubscriptionUnscheduleFixedFeeQuantityUpdatesParamsTest { } @Test - fun getBody() { + fun body() { val params = SubscriptionUnscheduleFixedFeeQuantityUpdatesParams.builder() .subscriptionId("subscription_id") .priceId("price_id") .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.priceId()).isEqualTo("price_id") } @Test - fun getBodyWithoutOptionalFields() { + fun bodyWithoutOptionalFields() { val params = SubscriptionUnscheduleFixedFeeQuantityUpdatesParams.builder() .subscriptionId("subscription_id") .priceId("price_id") .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.priceId()).isEqualTo("price_id") } diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionUnscheduleFixedFeeQuantityUpdatesResponseTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionUnscheduleFixedFeeQuantityUpdatesResponseTest.kt index 5f74f994..e4b19156 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionUnscheduleFixedFeeQuantityUpdatesResponseTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionUnscheduleFixedFeeQuantityUpdatesResponseTest.kt @@ -350,6 +350,12 @@ class SubscriptionUnscheduleFixedFeeQuantityUpdatesResponseTest { .unitAmount("unit_amount") .build() ) + .dimensionalPriceConfiguration( + Price.UnitPrice.DimensionalPriceConfiguration.builder() + .addDimensionValue("string") + .dimensionalPriceGroupId("dimensional_price_group_id") + .build() + ) .build() ) .product( @@ -463,6 +469,12 @@ class SubscriptionUnscheduleFixedFeeQuantityUpdatesResponseTest { .unitAmount("unit_amount") .build() ) + .dimensionalPriceConfiguration( + Price.UnitPrice.DimensionalPriceConfiguration.builder() + .addDimensionValue("string") + .dimensionalPriceGroupId("dimensional_price_group_id") + .build() + ) .build() ) .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) @@ -845,6 +857,12 @@ class SubscriptionUnscheduleFixedFeeQuantityUpdatesResponseTest { .unitAmount("unit_amount") .build() ) + .dimensionalPriceConfiguration( + Price.UnitPrice.DimensionalPriceConfiguration.builder() + .addDimensionValue("string") + .dimensionalPriceGroupId("dimensional_price_group_id") + .build() + ) .build() ) .product( @@ -953,6 +971,12 @@ class SubscriptionUnscheduleFixedFeeQuantityUpdatesResponseTest { .unitAmount("unit_amount") .build() ) + .dimensionalPriceConfiguration( + Price.UnitPrice.DimensionalPriceConfiguration.builder() + .addDimensionValue("string") + .dimensionalPriceGroupId("dimensional_price_group_id") + .build() + ) .build() ) .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionUnschedulePendingPlanChangesResponseTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionUnschedulePendingPlanChangesResponseTest.kt index 08bcf5a3..f3ebbf9f 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionUnschedulePendingPlanChangesResponseTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionUnschedulePendingPlanChangesResponseTest.kt @@ -348,6 +348,12 @@ class SubscriptionUnschedulePendingPlanChangesResponseTest { .unitAmount("unit_amount") .build() ) + .dimensionalPriceConfiguration( + Price.UnitPrice.DimensionalPriceConfiguration.builder() + .addDimensionValue("string") + .dimensionalPriceGroupId("dimensional_price_group_id") + .build() + ) .build() ) .product( @@ -461,6 +467,12 @@ class SubscriptionUnschedulePendingPlanChangesResponseTest { .unitAmount("unit_amount") .build() ) + .dimensionalPriceConfiguration( + Price.UnitPrice.DimensionalPriceConfiguration.builder() + .addDimensionValue("string") + .dimensionalPriceGroupId("dimensional_price_group_id") + .build() + ) .build() ) .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) @@ -832,6 +844,12 @@ class SubscriptionUnschedulePendingPlanChangesResponseTest { .unitAmount("unit_amount") .build() ) + .dimensionalPriceConfiguration( + Price.UnitPrice.DimensionalPriceConfiguration.builder() + .addDimensionValue("string") + .dimensionalPriceGroupId("dimensional_price_group_id") + .build() + ) .build() ) .product( @@ -940,6 +958,12 @@ class SubscriptionUnschedulePendingPlanChangesResponseTest { .unitAmount("unit_amount") .build() ) + .dimensionalPriceConfiguration( + Price.UnitPrice.DimensionalPriceConfiguration.builder() + .addDimensionValue("string") + .dimensionalPriceGroupId("dimensional_price_group_id") + .build() + ) .build() ) .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionUpdateFixedFeeQuantityParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionUpdateFixedFeeQuantityParamsTest.kt index fe1ceedc..44913809 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionUpdateFixedFeeQuantityParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionUpdateFixedFeeQuantityParamsTest.kt @@ -20,7 +20,7 @@ class SubscriptionUpdateFixedFeeQuantityParamsTest { } @Test - fun getBody() { + fun body() { val params = SubscriptionUpdateFixedFeeQuantityParams.builder() .subscriptionId("subscription_id") @@ -29,7 +29,7 @@ class SubscriptionUpdateFixedFeeQuantityParamsTest { .changeOption(SubscriptionUpdateFixedFeeQuantityParams.ChangeOption.IMMEDIATE) .effectiveDate(LocalDate.parse("2022-12-21")) .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.priceId()).isEqualTo("price_id") assertThat(body.quantity()).isEqualTo(0.0) @@ -39,14 +39,14 @@ class SubscriptionUpdateFixedFeeQuantityParamsTest { } @Test - fun getBodyWithoutOptionalFields() { + fun bodyWithoutOptionalFields() { val params = SubscriptionUpdateFixedFeeQuantityParams.builder() .subscriptionId("subscription_id") .priceId("price_id") .quantity(0.0) .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.priceId()).isEqualTo("price_id") assertThat(body.quantity()).isEqualTo(0.0) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionUpdateFixedFeeQuantityResponseTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionUpdateFixedFeeQuantityResponseTest.kt index 0d3232af..bd1434c1 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionUpdateFixedFeeQuantityResponseTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionUpdateFixedFeeQuantityResponseTest.kt @@ -345,6 +345,12 @@ class SubscriptionUpdateFixedFeeQuantityResponseTest { .unitAmount("unit_amount") .build() ) + .dimensionalPriceConfiguration( + Price.UnitPrice.DimensionalPriceConfiguration.builder() + .addDimensionValue("string") + .dimensionalPriceGroupId("dimensional_price_group_id") + .build() + ) .build() ) .product( @@ -458,6 +464,12 @@ class SubscriptionUpdateFixedFeeQuantityResponseTest { .unitAmount("unit_amount") .build() ) + .dimensionalPriceConfiguration( + Price.UnitPrice.DimensionalPriceConfiguration.builder() + .addDimensionValue("string") + .dimensionalPriceGroupId("dimensional_price_group_id") + .build() + ) .build() ) .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) @@ -824,6 +836,12 @@ class SubscriptionUpdateFixedFeeQuantityResponseTest { .unitAmount("unit_amount") .build() ) + .dimensionalPriceConfiguration( + Price.UnitPrice.DimensionalPriceConfiguration.builder() + .addDimensionValue("string") + .dimensionalPriceGroupId("dimensional_price_group_id") + .build() + ) .build() ) .product( @@ -932,6 +950,12 @@ class SubscriptionUpdateFixedFeeQuantityResponseTest { .unitAmount("unit_amount") .build() ) + .dimensionalPriceConfiguration( + Price.UnitPrice.DimensionalPriceConfiguration.builder() + .addDimensionValue("string") + .dimensionalPriceGroupId("dimensional_price_group_id") + .build() + ) .build() ) .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionUpdateParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionUpdateParamsTest.kt index a0579a54..d2a39864 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionUpdateParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionUpdateParamsTest.kt @@ -25,7 +25,7 @@ class SubscriptionUpdateParamsTest { } @Test - fun getBody() { + fun body() { val params = SubscriptionUpdateParams.builder() .subscriptionId("subscription_id") @@ -39,7 +39,7 @@ class SubscriptionUpdateParamsTest { ) .netTerms(0L) .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.autoCollection()).contains(true) assertThat(body.defaultInvoiceMemo()).contains("default_invoice_memo") @@ -54,9 +54,9 @@ class SubscriptionUpdateParamsTest { } @Test - fun getBodyWithoutOptionalFields() { + fun bodyWithoutOptionalFields() { val params = SubscriptionUpdateParams.builder().subscriptionId("subscription_id").build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull } diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionUpdateTrialParamsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionUpdateTrialParamsTest.kt index d9b37d86..f2a11c9a 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionUpdateTrialParamsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionUpdateTrialParamsTest.kt @@ -18,14 +18,14 @@ class SubscriptionUpdateTrialParamsTest { } @Test - fun getBody() { + fun body() { val params = SubscriptionUpdateTrialParams.builder() .subscriptionId("subscription_id") .trialEndDate(OffsetDateTime.parse("2017-07-21T17:32:28Z")) .shift(true) .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.trialEndDate()) .isEqualTo( @@ -37,13 +37,13 @@ class SubscriptionUpdateTrialParamsTest { } @Test - fun getBodyWithoutOptionalFields() { + fun bodyWithoutOptionalFields() { val params = SubscriptionUpdateTrialParams.builder() .subscriptionId("subscription_id") .trialEndDate(OffsetDateTime.parse("2017-07-21T17:32:28Z")) .build() - val body = params.getBody() + val body = params._body() assertThat(body).isNotNull assertThat(body.trialEndDate()) .isEqualTo( diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionUpdateTrialResponseTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionUpdateTrialResponseTest.kt index 72b3ee81..677258b4 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionUpdateTrialResponseTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionUpdateTrialResponseTest.kt @@ -341,6 +341,12 @@ class SubscriptionUpdateTrialResponseTest { .unitAmount("unit_amount") .build() ) + .dimensionalPriceConfiguration( + Price.UnitPrice.DimensionalPriceConfiguration.builder() + .addDimensionValue("string") + .dimensionalPriceGroupId("dimensional_price_group_id") + .build() + ) .build() ) .product( @@ -453,6 +459,12 @@ class SubscriptionUpdateTrialResponseTest { .unitAmount("unit_amount") .build() ) + .dimensionalPriceConfiguration( + Price.UnitPrice.DimensionalPriceConfiguration.builder() + .addDimensionValue("string") + .dimensionalPriceGroupId("dimensional_price_group_id") + .build() + ) .build() ) .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) @@ -816,6 +828,12 @@ class SubscriptionUpdateTrialResponseTest { .unitAmount("unit_amount") .build() ) + .dimensionalPriceConfiguration( + Price.UnitPrice.DimensionalPriceConfiguration.builder() + .addDimensionValue("string") + .dimensionalPriceGroupId("dimensional_price_group_id") + .build() + ) .build() ) .product( @@ -923,6 +941,12 @@ class SubscriptionUpdateTrialResponseTest { .unitAmount("unit_amount") .build() ) + .dimensionalPriceConfiguration( + Price.UnitPrice.DimensionalPriceConfiguration.builder() + .addDimensionValue("string") + .dimensionalPriceGroupId("dimensional_price_group_id") + .build() + ) .build() ) .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionsTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionsTest.kt index 225611d6..27f9a2d3 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionsTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/models/SubscriptionsTest.kt @@ -363,6 +363,14 @@ class SubscriptionsTest { .unitAmount("unit_amount") .build() ) + .dimensionalPriceConfiguration( + Price.UnitPrice.DimensionalPriceConfiguration.builder() + .addDimensionValue("string") + .dimensionalPriceGroupId( + "dimensional_price_group_id" + ) + .build() + ) .build() ) .product( @@ -490,6 +498,14 @@ class SubscriptionsTest { .unitAmount("unit_amount") .build() ) + .dimensionalPriceConfiguration( + Price.UnitPrice.DimensionalPriceConfiguration.builder() + .addDimensionValue("string") + .dimensionalPriceGroupId( + "dimensional_price_group_id" + ) + .build() + ) .build() ) .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) @@ -853,6 +869,12 @@ class SubscriptionsTest { .unitAmount("unit_amount") .build() ) + .dimensionalPriceConfiguration( + Price.UnitPrice.DimensionalPriceConfiguration.builder() + .addDimensionValue("string") + .dimensionalPriceGroupId("dimensional_price_group_id") + .build() + ) .build() ) .product( @@ -970,6 +992,12 @@ class SubscriptionsTest { .unitAmount("unit_amount") .build() ) + .dimensionalPriceConfiguration( + Price.UnitPrice.DimensionalPriceConfiguration.builder() + .addDimensionValue("string") + .dimensionalPriceGroupId("dimensional_price_group_id") + .build() + ) .build() ) .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/services/blocking/CouponServiceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/services/blocking/CouponServiceTest.kt index 4e866942..e4455a08 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/services/blocking/CouponServiceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/services/blocking/CouponServiceTest.kt @@ -25,15 +25,7 @@ class CouponServiceTest { val coupon = couponService.create( CouponCreateParams.builder() - .discount( - CouponCreateParams.Discount.NewCouponPercentageDiscount.builder() - .discountType( - CouponCreateParams.Discount.NewCouponPercentageDiscount.DiscountType - .PERCENTAGE - ) - .percentageDiscount(0.0) - .build() - ) + .newCouponPercentageDiscount(0.0) .redemptionCode("HALFOFF") .durationInMonths(12L) .maxRedemptions(1L) diff --git a/orb-java-core/src/test/kotlin/com/withorb/api/services/blocking/SubscriptionServiceTest.kt b/orb-java-core/src/test/kotlin/com/withorb/api/services/blocking/SubscriptionServiceTest.kt index 8131df88..bac338ee 100644 --- a/orb-java-core/src/test/kotlin/com/withorb/api/services/blocking/SubscriptionServiceTest.kt +++ b/orb-java-core/src/test/kotlin/com/withorb/api/services/blocking/SubscriptionServiceTest.kt @@ -318,7 +318,7 @@ class SubscriptionServiceTest { .build() ) .startDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .trialDurationDays(0L) + .trialDurationDays(999999L) .build() ) println(subscriptionCreateResponse) @@ -494,19 +494,7 @@ class SubscriptionServiceTest { .expiresAtEndOfCadence(true) .build() ) - .addDiscount( - SubscriptionPriceIntervalsParams.Add.Discount - .AmountDiscountCreationParams - .builder() - .amountDiscount(0.0) - .discountType( - SubscriptionPriceIntervalsParams.Add.Discount - .AmountDiscountCreationParams - .DiscountType - .AMOUNT - ) - .build() - ) + .addAmountDiscountCreationParamsDiscount(0.0) .endDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .externalPriceId("external_price_id") .addFixedFeeQuantityTransition( @@ -934,7 +922,7 @@ class SubscriptionServiceTest { .priceId("h74gfhdjvn7ujokd") .build() ) - .trialDurationDays(0L) + .trialDurationDays(999999L) .build() ) println(subscriptionSchedulePlanChangeResponse)